技能潮 SkillTide 提交收录
官方说明7 个来源MCP 服务8 天前
igorolv/loki-mcp-server

igorolv/loki-mcp-server

Read-only Grafana Loki
在 GitHub 查看 ↗直链 · 无中转页
配置模板(请按你的客户端调整)
claude mcp add loki-mcp-server -- npx -y loki-mcp-server
这是根据仓库名生成的可粘贴骨架,命令行参数与包名请以该项目 README 为准。
★ 数取值
0 ★ · igorolv/loki-mcp-server · 取自 GitHub 搜索 API · (2026-10-16 20:00:20 核对)
来源明细
收录自 punkpeye/awesome-mcp-servers 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
收录与活跃
收录于 2026-10-09 · 最近见到 2026-10-16 · 共见到 32 次 · 被 7 个来源列出
评分构成
综合分 703 · 7 个来源 · mcp
常见问题(答案都来自我们的记录)
怎么安装?
我们【没有】从该仓库取到安装命令(我们的 install 覆盖率只有约 4%)。请看它的 README 或 releases 页。
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库 igorolv/loki-mcp-server;我们收录于 2026-10-09;最近见到 2026-10-16。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
第三方质量标记

Loki MCP Server

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

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.
| Tool | Purpose |
|---|---|
| listConnections | Show configured stands, operator hints and effective tool limits |
| discoverLogs | List label names, values of one label, matching stream label sets, or values among those sets |
| queryLogs | Read newest or oldest bounded pages of a LogQL log query as compact text; raw=true previews returned lines and stream labels |
| countLogs | Count matching lines on Loki, optionally by label, clock aligned time bucket or both |
| exportLogs | Save matching lines to a local file, raw or rendered with a template |
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 count_over_time 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 LOKI_MCP_CONNECTIONS_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"]
}
}
}
~~~
The complete example uses environment variables for nonlocal URLs. hint gives the model stand specific selectors and field advice. serviceLabels names the labels used to display a service in compact lines. Optional formatFile names one JSON file with JSON profiles, plain-line patterns and an optional framePattern; see log-formats.json. Optional exportFormat sets the default template for exportLogs when the tool call omits format. The connection file may set exportRoots to restrict export destinations, and per connection limits. Authentication and tenant headers are configured per connection; URLs and credentials never appear in tool responses or diagnostics. The full format is in docs/connections.md.
The server loads configuration strictly at startup without probing Loki. An unknown field, duplicate key, missing environment variable or invalid format file stops startup with a safe configuration error. Changes require a restart.
来源
awesome · https://github.com/igorolv/loki-mcp-server
按领域浏览
MCP 服务
收录于
昨天

更多MCP 服务

查看MCP 服务全部 5,525 条 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引