Grafana-Loki MCP Server
@tumf
关于 Grafana-Loki MCP Server
Grafana Loki MCP Repository
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"grafana-loki-mcp": {
"command": "uv",
"args": [
"venv"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is Grafana-Loki MCP Server?
It is a FastMCP server that allows querying Loki logs from a Grafana instance. It is intended for developers and operations teams who need to interact with Loki log data programmatically through the Model Context Protocol.
How to use Grafana-Loki MCP Server?
Install via pip install grafana-loki-mcp or run with uvx grafana-loki-mcp. Configure it by setting the GRAFANA_URL and GRAFANA_API_KEY environment variables, or pass them as command-line arguments (-u and -k). The server supports both stdio and SSE transport protocols.
Key features of Grafana-Loki MCP Server
- Query Loki logs through the Grafana API
- Retrieve Loki label names and label values
- Format query results as text, JSON, or markdown
- Supports stdio and SSE transport protocols
- Accepts Grafana-style relative time ranges (e.g.,
now-1h) - Limits log line length per entry (configurable max per line)
Use cases of Grafana-Loki MCP Server
- Integrate Loki log queries into MCP‑compatible AI assistants and tools
- Automate log analysis pipelines by fetching and formatting logs
- Programmatically retrieve label metadata for log exploration
- Build custom log dashboards or alerts using external scripts
FAQ from Grafana-Loki MCP Server
What are the runtime requirements?
Python 3.10 or higher, plus the FastMCP and Requests libraries.
How do I configure the server with Grafana?
Provide your Grafana instance URL and API key either via environment variables (GRAFANA_URL, GRAFANA_API_KEY) or with command-line arguments -u and -k.
What transport protocols does the server support?
It supports both stdio (default) and sse (set with --transport sse).
How can I query logs and format the results?
Use the query_loki tool with parameters such as query, start, end, limit, direction, and max_per_line. Pass the results to format_loki_results to output them in text, JSON, or markdown.
开发工具 分类下的更多 MCP 服务器
Grafana MCP server
grafanaMCP server for Grafana
Stakpak Agent CLI
stakpakShip your code, on autopilot. An open source agent that lives on your machines 24/7 and keeps your apps running. 🦀
MCP-Bridge
SecretiveShellA middleware to provide an openAI compatible endpoint that can call MCP tools
mcp-excalidraw
yctimlinMCP server and Claude Code skill for Excalidraw — programmatic canvas toolkit to create, edit, and export diagrams via AI agents with real-time canvas sync.
TalkToFigma
sonnylazuardiTalkToFigma: MCP integration between AI Agent (Cursor, Claude Code, Codex) and Figma, allowing Agentic AI to communicate with Figma for reading designs and modifying them programmatically.
评论