Loki MCP Server
About
A Go-based server to query Grafana Loki logs using the Model Context Protocol (MCP).
Details
- Author
- scottlepp
- GitHub stars
- 153
- Downloads
- 395
- Categories
- Developer Tools, Other, Infrastructure
Jump to
- Provides a loki_query tool for executing LogQL queries.
- Supports both stdin/stdout and SSE (HTTP) communication modes.
- Configurable via environment variables (LOKI_URL, LOKI_ORG_ID, LOKI_USERNAME, LOKI_PASSWORD, LOKI_TOKEN).
- Can be run locally with Docker Compose including Loki, Grafana, and a log generator.
- Supports multi-tenant setups via the X-Scope-OrgID header.
- Includes a test client and scripts for verification.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Loki MCP ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Build and run the server with Go (go build / go run) or Docker. It communicates using stdin/stdout and also supports HTTP with Server-Sent Events (SSE). Configuration is done through environment variables for Loki URL, organization ID, and authentication. To use with Claude Desktop, add the server to the MCP configuration file.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"loki mcp server": {
"loki-mcp": {
"command": "docker",
"args": [
"build",
"-t",
"loki-mcp-server",
"."
]
}
}
}
}
McpServers
{
"loki-mcp": {
"command": "docker",
"args": [
"build",
"-t",
"loki-mcp-server",
"."
]
}
}
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





