Loki MCP Server
@scottlepp
About Loki MCP Server
No overview available yet
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
4Execute LogQL queries and retrieve matching log entries
Retrieve all label names available in the logs
Get all values for a specific label
Analyze log volume over time
Overview
What is Loki MCP Server?
A Model Context Protocol (MCP) server for Grafana Loki that provides AI agents with access to log data. It implements the MCP protocol to expose tools and resources for querying and analyzing logs stored in a Loki instance, giving Large Language Models (LLMs) additional context.
How to use Loki MCP Server?
Clone the repository, build with Go 1.18+, and start the server with a --loki-url flag or LOKI_URL environment variable. Then configure an MCP-compatible AI agent (e.g., Claude Desktop) to connect to the server using the provided JSON configuration examples.
Key features of Loki MCP Server
- Execute LogQL queries and retrieve matching log entries
- Retrieve all label names and values from logs
- Analyze log volume over time
- Access log streams by label selector via URI template
- Fetch recent error logs across all services
- Retrieve logs for a specific service
Use cases of Loki MCP Server
- Find error logs in a frontend service from the last hour
- List all possible values for the “app” label
- Access logs for an authentication service using a specific URI
- Provide AI agents with real-time log context for debugging
FAQ from Loki MCP Server
What are the prerequisites to run Loki MCP Server?
Go 1.18 or later and access to a running Grafana Loki instance are required.
How do I configure authentication?
Authentication can be set via command-line flags or environment variables: --username/LOKI_USERNAME, --password/LOKI_PASSWORD, --api-key/LOKI_API_KEY, and --tenant-id/LOKI_TENANT_ID for multi-tenant setups.
What is the default query timeout?
The default query timeout is 30 seconds, configurable with the --query-timeout flag or QUERY_TIMEOUT environment variable.
How do I use Loki MCP Server with Claude Desktop?
Add a “loki” entry to claude_desktop_config.json with the server’s command and any needed environment variables, as shown in the examples directory.
Where does the log data live?
All log data is stored in the externally provided Grafana Loki instance; the server itself does not store logs.
Frequently asked questions
What are the prerequisites to run Loki MCP Server?
Go 1.18 or later and access to a running Grafana Loki instance are required.
How do I configure authentication?
Authentication can be set via command-line flags or environment variables: `--username`/`LOKI_USERNAME`, `--password`/`LOKI_PASSWORD`, `--api-key`/`LOKI_API_KEY`, and `--tenant-id`/`LOKI_TENANT_ID` for multi-tenant setups.
What is the default query timeout?
The default query timeout is 30 seconds, configurable with the `--query-timeout` flag or `QUERY_TIMEOUT` environment variable.
How do I use Loki MCP Server with Claude Desktop?
Add a “loki” entry to `claude_desktop_config.json` with the server’s command and any needed environment variables, as shown in the examples directory.
Where does the log data live?
All log data is stored in the externally provided Grafana Loki instance; the server itself does not store logs.
Basic information
More Other MCP servers
Inbox Zero AI MCP
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale
Codelf
unbugA search tool helps dev to solve the naming things problem.

DeepMark
DeepMark helps teachers deliver rapid, consistent marking with meaningful feedback for every student — in a fraction of the time. What once took a week, now takes one free period.

Peekaboo MCP – lightning-fast macOS screenshots for AI agents
steipetePeekaboo is a macOS CLI & optional MCP server that enables AI agents to capture screenshots of applications, or the entire system, with optional visual question answering through local or remote AI models.
Comments