MCPSERV.CLUB
ghrud92

Simple Loki MCP Server

MCP Server

Query Grafana Loki logs via Model Context Protocol

Active(70)
5stars
0views
Updated Sep 18, 2025

About

Simple Loki MCP Server exposes a Model Context Protocol interface to query Grafana Loki logs using logcli or the HTTP API. It allows AI assistants to retrieve, filter, and analyze log data with full LogQL support.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Loki MCP Server Dashboard

Simple Loki MCP Server is a lightweight bridge that lets AI assistants—such as Claude, Gemini, or other MCP‑compatible agents—query Grafana Loki log streams directly through the Model Context Protocol. By exposing a set of high‑level tools that wrap Loki’s powerful LogQL language, the server eliminates the need for developers to write custom API clients or parse raw HTTP responses. Instead, an AI can ask natural‑language questions like “Show me the last 100 error logs from service X” and receive structured results in a format it can immediately consume or further analyze.

The core value lies in integration and automation. Developers routinely need to surface log data during debugging, monitoring, or compliance audits. With Simple Loki MCP, an assistant can pull logs on demand, filter by time range or label, and even retrieve all possible values for a given label—all through simple JSON payloads. The server’s automatic fallback to the Loki HTTP API when is missing ensures reliability across diverse deployment environments, from local dev machines to cloud‑hosted agents that cannot install external binaries.

Key capabilities include:

  • Full LogQL support: Pass any valid Loki query string, including complex filters and aggregations.
  • Label introspection: Retrieve available labels () or enumerate all values for a specific label (), aiding dynamic query construction.
  • Flexible output formats: Choose between a human‑friendly default view, raw text, or JSON Lines for downstream processing.
  • Secure configuration: Environment variables and optional config files cover basic auth, bearer tokens, TLS certificates, multi‑tenant IDs, and more.
  • Automatic HTTP API fallback: Seamless operation whether is present or not, simplifying CI/CD pipelines and containerized deployments.

Typical use cases span from real‑time debugging—where an assistant pulls recent logs to diagnose a flaky service—to compliance reporting, where periodic queries retrieve audit trails for security reviews. In observability workflows, the MCP server can feed log data into analytical pipelines or trigger alerts when patterns emerge. Its lightweight Node.js implementation and clear tooling make it a drop‑in addition to existing AI workflows, enabling developers to focus on business logic while delegating log retrieval and parsing to the assistant.