MCP server for querying Loki logs via logcli
Loki MCP MCP server exists for a simple reason — assistants are far more useful when they can act on Loki MCP directly instead of describing what you should do. MCP server for querying Loki logs via logcli.
Loki MCP Server is a Model Context Protocol (MCP) interface for querying Grafana Loki logs using logcli. The server enables AI assistants to access and analyze log data from Loki directly.
You will need 5 environment variables: LOKI_ADDR, LOKI_TENANT_ID, LOKI_BEARER_TOKEN, LOKI_ORG_ID, LOKI_CONFIG_PATH. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
logcli is not available, the server will automatically use the Loki HTTP API instead - Access to a Loki server instanceInstallation goes through your MCP client rather than a global install: point it at @smithery/cli on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
Among the monitoring and observability options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. It is maintained by ghrud92; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
### for MCP
```json
{
"mcpServers": {
"simple-loki": {
"command": "npx",
"args": ["-y", "simple-loki-mcp"],
"env": {
"LOKI_ADDR": "https://loki.sup.band"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
logcli is not available, the server will automatically use the Loki HTTP API instead - Access to a Loki server instance| Variable | Description | Required |
|---|---|---|
| LOKI_ADDR | Configuration value read at startup. | Optional |
| LOKI_TENANT_ID | Configuration value read at startup. | Optional |
| LOKI_BEARER_TOKEN | Credential the server authenticates with. | Yes |
| LOKI_ORG_ID | Configuration value read at startup. | Optional |
| LOKI_CONFIG_PATH | Filesystem location the server is allowed to use. | Optional |
Give your coding agent the full DevTools toolbox: traces, network, console, heap snapshots and Lighthouse.
Dashboards, Prometheus and Loki queries, incidents and alerts — observability by conversation.
Errors with full context — stack traces, issue triage and AI-powered root-cause analysis from Sentry's server.
Enables enhanced web research capabilities for large language models through intelligent search queuing and advanced content extraction.
Automates browser interactions and enables Large Language Models (LLMs) to interact with web pages through Playwright and Chrome DevTools Protocol
Guides tool usage by providing recommendations for MCP tools at each problem-solving stage.