Loki MCP Server
Read-only Grafana Loki for AI agents: label discovery, bounded LogQL queries, counts, exports
0 stars
Reviews
Write oneNobody has reviewed Loki MCP Server yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Loki MCP Server tools
No tool declarations could be read from the package source. They show once the server is installed.
Public scan report
scanner v0.1.10 · 2026-10-01 · same rubric, same numbers if you re-run it
- –Code scanpackage could not be scannedn/a
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 0 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Loki MCP Server compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 88/100
- higher than 75% of 48,273 servers
Install Loki MCP Server in Claude Code, Cursor or VS Code
claude mcp add loki-mcp-server -- docker run -i --rm ghcr.io/igorolv/loki-mcp-server:0.1.0
What the publisher says
From the Loki MCP Server repository's README, as published. We do not edit it. Read it on GitHub
Loki MCP Server
A local stdio MCP server for reading Grafana Loki with an agent. It exposes five text tools and supports Loki 2.6.1 and 3.x. Loki itself is read only; the only write is a local exportLogs file.
Every data tool requires an explicit connection. queryLogs, countLogs and exportLogs require a LogQL log query, such as {app="backend"} |= "ERROR". Use discoverLogs to find label names, values and real combinations in stream label sets. The server builds only the countovertime expression for countLogs; it does not infer filters or interpret causes. Tool responses are readable text without an output schema.
Build and run
JDK 21 or newer is required; the project uses a Java 21 toolchain and the Gradle wrapper.
~~~powershell .\gradlew.bat bootJar java -jar build/libs/loki-mcp-server.jar ~~~
On Linux/macOS use ./gradlew. The process waits for MCP JSON-RPC on stdin. stdout is reserved for JSON-RPC; diagnostics go to stderr and ~/.loki-mcp-server/logs/loki-mcp-server.log.
A prebuilt loki-mcp-server.jar is attached to every release, so building is optional.
For Claude Code, registering the jar is one command:
~~~bash claude mcp add --scope user loki -- java -jar /path/to/loki-mcp-server.jar ~~~
Docker
The image is published to GHCR with every release. Mount the directory holding connections.json at /data; the server also writes its logs and default exports there:
~~~bash docker run -i --rm -v ~/.loki-mcp-server:/data ghcr.io/igorolv/loki-mcp-server:latest ~~~
The same command is what an MCP client should launch; -i keeps stdin open for the stdio transport. Loki URLs in connections.json must be reachable from inside the container: use the Loki host name rather than localhost, or add --network host on Linux. An exportLogs directory outside /data is a path inside the container, so mount it as well. To build the image locally: docker build -t loki-mcp-server .
Connections
The server reads ~/.loki-mcp-server/connections.json, or the path in LOKIMCPCONNECTIONS_FILE. A minimal file:
~~~json { "connections": { "dev": { "description": "Development", "hint": "Start with {app=\"backend\"}; inspect app values with discoverLogs.", "url": "http://localhost:3100", "timezone": "Europe/Moscow", "serviceLabels": ["app", "container"] } } } ~~~
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Loki MCP Server: common questions
- Is Loki MCP Server safe?
- Yes, by our scan: it is graded A (88/100). Read the Loki MCP Server safety report
- How do I install Loki MCP Server?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Loki MCP Server need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Loki MCP Server maintained?
- The last commit was 33 days ago (2026-09-30). The latest release is v0.1.0.