Overview
Features
Loki Query Tool (loki_query)
A dedicated MCP Loki tool that queries Grafana Loki log data. Requires a query parameter; supports optional url, start, end, limit, and org (X-Scope-OrgID) header.
MCP and SSE Communication
Supports MCP messaging over stdin/stdout and an HTTP SSE server for real-time streaming to MCP clients like n8n.
HTTP Endpoints (SSE and MCP)
When in HTTP mode, exposes SSE endpoint at /sse and MCP endpoint at /mcp; SSE_PORT configures the port (default 8080).
Docker & Docker Compose Support
Build and run the Loki MCP Server in Docker; includes docker build/run commands and Docker Compose support for orchestration.
Local Loki Testing Environment
Complete Docker Compose setup to run Loki, Grafana, a log generator, and the Loki MCP server for local end-to-end testing; includes test scripts.
Loki Connection Environment Variables
Supports LOKI_URL, LOKI_ORG_ID, LOKI_USERNAME, LOKI_PASSWORD, LOKI_TOKEN for default Loki configuration; notes on credential security.
Claude Desktop & Cursor Integration
Guides for integrating with Claude Desktop and Cursor, including configuration options and workflows for using the Loki MCP server with these tools.
Who Is This For?
- Developers:Developers building MCP clients to query Grafana Loki logs via MCP.
- DevOps:Ops teams testing Loki integration and log queries in Dockerized environments.
- AI/NLP Integrations:Integrators using Claude Desktop or n8n to orchestrate Loki queries through MCP.




