An MCP server for querying Grafana Loki directly with a discovery-first workflow — labels, values, series, and LogQL queries without requiring Grafana.
{
"mcpServers": {
"loki-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}No install config available. Check the server's README for setup instructions.
Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
An MCP server for querying Grafana Loki directly with a discovery-first workflow — labels, values, series, and LogQL queries without requiring Grafana.
Is it safe?
No package registry to scan.
No authentication — any process on your machine can connect.
MIT. View license →
Is it maintained?
Last commit 14 days ago. 2 stars.
Will it work with my client?
Transport: stdio. Works with Claude Desktop, Cursor, Claude Code, and most MCP clients.
No automated test available for this server. Check the GitHub README for setup instructions.
No known vulnerabilities.
This server is missing a description. Tools and install config are also missing.If you've used it, help the community.
Add informationHave you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
MCP Server for GCP environment for interacting with various Observability APIs.
AI cost tracking: 11 tools for spend, budgets, and Claude Code + Cursor + Cline costs
Real-time GitHub Actions observability: DORA Metrics, Cost Analysis, CI/CD Health dashboards.
MCP server for Yandex.Direct API — campaigns, ads, statistics, keywords. Bearer token auth.
MCP Security Weekly
Get CVE alerts and security updates for Loki Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Query Grafana Loki logs directly from AI agents using the Model Context Protocol (MCP).
Built in Go. Enables AI-powered log analysis using LogQL.
Supports integration with:
The official grafana/loki-mcp exposes a single loki_query tool, which means the LLM must already know valid label names and values before it can build a query. This project takes a different approach by providing 5 granular tools — labels, label_values, and series let the LLM discover what's available in Loki first, then construct precise query_range or query calls. The result is more accurate log retrieval with fewer wasted round-trips.
Additionally, this server enforces strict input validation (limit caps, direction validation, label name format checks, mutually exclusive auth) to surface errors early instead of forwarding bad requests to Loki.
brew install incu6us/tap/loki-mcp-server
go install github.com/incu6us/loki-mcp-server/cmd/loki-mcp-server@latest
Or build from source:
git clone https://github.com/incu6us/loki-mcp-server.git
cd loki-mcp
go build -o loki-mcp-server ./cmd/loki-mcp-server
The server is configured entirely via environment variables, injected by the MCP client.
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| LOKI_URL | yes | — | Base URL of the Loki instance |
| LOKI_USERNAME | no | — | Basic auth username |
| LOKI_PASSWORD | no | — | Basic auth password |
| LOKI_BEARER_TOKEN | no | — | Bearer token authentication |
| LOKI_TLS_SKIP_VERIFY | no | false | Skip TLS certificate verification |
| LOKI_TENANT_ID | no | — | X-Scope-OrgID header for multi-tenant deployments |
| LOKI_HTTP_TIMEOUT | no | 30s | HTTP request timeout (Go duration, e.g. 10s, 1m) |
Note: Basic auth (
LOKI_USERNAME/LOKI_PASSWORD) and bearer token (LOKI_BEARER_TOKEN) are mutually exclusive.
Add to your Claude Code MCP configuration (~/.claude.json):
{
"mcpServers": {
"loki-mcp-server": {
"type": "stdio",
"command": "/path/to/loki-mcp-server",
"args": [],
"env": {
"LOKI_URL": "http://loki:3100",
"LOKI_USERNAME": "admin",
"LOKI_PASSWORD": "secret"
}
}
}
}
Add to your Claude Desktop config (`~/Library/Application Suppor