OfficialVerified

Loki MCP Server

Grafana Loki log data querying via LogQL directly from your AI assistant.

Data last scanned today · Reviewed today

Overview

Loki MCP Server provides a bridge between AI models and your Grafana Loki log infrastructure. Built in Go, it implements the Model Context Protocol to allow for direct execution of LogQL queries against your log storage, making it useful for developers who need to bridge the gap between AI-driven analysis and operational log data.

Our verdict

With a security score of 30/100, this server is classified as high-risk. This rating stems from the fact that it is a community-maintained project rather than an official Grafana offering, and it currently lacks a defined license, leaving legal usage terms unclear. Users should exercise caution regarding credentials, as authentication methods have not yet been editorially reviewed.

  • Supports direct execution of custom LogQL queries
  • Zero direct dependencies reduces supply chain attack surface
  • Includes a dedicated client for testing queries locally
  • No license detected creates legal ambiguity for users
  • Single-contributor bus-factor risk present
  • Authentication and read-only mechanisms lack third-party verification

Tools

ToolDescriptionRisk
loki_queryThe loki_query tool allows you to query Grafana Loki log data.low

Compatibility

ClientLocalDockerRemoteRead-only
ChatGPT
Claude Desktop
Cursor
VS Code
Windsurf

Frequently asked questions

What are the system requirements for running the Loki MCP server?

You need Go 1.16 or higher installed on your machine to build and run the server.

How can I authenticate with a Loki instance using this server?

You can use environment variables for authentication, including LOKI_USERNAME and LOKI_PASSWORD for basic auth, or LOKI_TOKEN for bearer token authentication.

What communication protocols does the server support?

The server supports both standard input/output (stdin/stdout) for local tools and HTTP with Server-Sent Events (SSE) for remote integration.

How do I change the default port for the HTTP server?

You can change the default port of 8080 by setting the SSE_PORT environment variable.

How does the server handle multi-tenant Loki setups?

The server supports the organization ID via the LOKI_ORG_ID environment variable or the org parameter in the query tool, which is sent as the X-Scope-OrgID header.

Alternatives

Changelog

Badge

Loki MCP Server security score, rated on RepoAI

Maintain this server? Add the live badge to your README.