loki-mcp
by grafana·★ 141·Score 51
A production-ready MCP server for querying Grafana Loki logs with comprehensive documentation and multiple deployment options.
Overview
The Loki MCP Server is a robust Go-based implementation that provides seamless integration between AI assistants and Grafana Loki log data. It exposes a single powerful `loki_query` tool with comprehensive parameters for time ranges, limits, and multi-tenant support. The implementation demonstrates production-ready quality with support for both stdin/stdout and HTTP SSE communication modes, allowing integration with various clients including Claude Desktop and n8n workflows.
Try asking AI
After installing, here are 3 things you can ask your AI assistant:
When to choose this
Choose this server when you need to query Grafana Loki logs through natural language interfaces and already have a Loki deployment.
When NOT to choose this
Don't choose this if you need to query other logging systems besides Grafana Loki, or if you require advanced log processing capabilities beyond simple LogQL queries.
Tools this server exposes
1 tool extracted from the READMEloki_queryQuery Grafana Loki log data with LogQL
Comparable tools
Installation
Installation
Building from Source
go build -o loki-mcp-server ./cmd/server
./loki-mcp-serverUsing Docker
docker build -t loki-mcp-server .
docker run --rm -i loki-mcp-serverClaude Desktop Configuration
{
"mcpServers": {
"lokiserver": {
"command": "/path/to/loki-mcp-server",
"env": {
"LOKI_URL": "http://localhost:3100",
"LOKI_ORG_ID": "your-org-id"
},
"autoApprove": ["loki_query"]
}
}
}Compare loki-mcp with
Last updated · Auto-generated from public README + GitHub signals.