Simple Loki MCP Server

Simple Loki MCP Server is an MCP server that connects AI assistants to Grafana Loki log aggregation instances using logcli or direct HTTP calls. Built for software engineers, DevOps practitioners, and site reliability teams, it enables language models to inspect application and infrastructure logs directly within conversational interfaces. Users can execute arbitrary LogQL queries, inspect available log streams, and discover label names and values to pinpoint errors and diagnose production incidents. The server functions primarily by leveraging the Grafana Loki logcli binary when available on the host system. If logcli is not installed or accessible in the execution environment, the server automatically falls back to interacting with the standard Loki HTTP API without requiring separate configuration. In addition to basic query execution, the tool supports configurable time windows, output format adjustments across raw text, default log formatting, and JSON lines, as well as multi-tenant setups via dedicated tenant identifiers. Authentication accommodates HTTP basic authentication, bearer tokens, and custom TLS certificate configurations, allowing teams to safely connect LLM agents to internal Loki monitoring infrastructure.

Category: Developer Tools & Code Intelligence

Tags: logcli, logs, loki, monitoring

Visit Simple Loki MCP Server

How to install and configure Simple Loki MCP Server

  1. Install the server for Claude Desktop using Smithery by running npx -y @smithery/cli install @ghrud92/simple-loki-mcp --client claude. 2. Alternatively, add the server to your MCP client configuration manually: json { "mcpServers": { "simple-loki": { "command": "npx", "args": ["-y", "simple-loki-mcp"], "env": { "LOKI_ADDR": "https://loki.example.com" } } } } 3. Configure authentication parameters as needed using environment variables like LOKI_USERNAME, LOKI_PASSWORD, or LOKI_BEARER_TOKEN. 4. Restart your MCP client to access the query-loki, get-labels, and get-label-values tools.

What you can do with Simple Loki MCP Server

  • Executing LogQL queries: Execute LogQL expressions across specific time windows to retrieve error traces and diagnose system anomalies directly inside an AI conversation. - Discovering active log labels: Inspect all available metadata labels and their respective values to explore active log streams and construct precise filtering conditions. - Investigating production incidents: Correlate recent log records chronologically using the forward flag to track error propagation across microservices during active system outages. - Exporting structured log lines: Retrieve log entries in raw or JSON lines format to allow the AI assistant to parse structured telemetry payloads.

Key facts

  • Open Source
  • https://github.com/ghrud92/loki-mcp
  • Developer Tools & Code Intelligence, Monitoring & Observability
  • logcli, logs, loki, monitoring

Part of MCP Servers

Related MCP servers

  • MCP LaTeX Server — MCP LaTeX Server is an MCP server that provides tools for creating, editing, validating, and compiling LaTeX documents directly through…
  • MCP JSON — MCP JSON is an MCP server collection that bundles tools for file system operations, Google search, browser-based web automation, and…
  • MCP Jupyter Complete — MCP Jupyter Complete is an MCP server that provides tools for manipulating Jupyter notebook files through position-based cell operations and…
  • MCP LSP Go — MCP LSP Go is an MCP server that connects AI assistants to the official Go Language Server Protocol implementation, gopls,…
  • MCP Manager — MCP Manager is an MCP server management tool that connects directly to your Claude Desktop environment, enabling users to discover,…
  • MCP Lab — MCP Lab is an MCP server development environment designed for building, testing, and debugging custom Model Context Protocol servers integrated…

What is Simple Loki MCP Server?

Simple Loki MCP Server is an open source Model Context Protocol server that allows AI assistants to query and analyze logs stored in Grafana Loki. It acts as a bridge using either the logcli command-line utility or Loki HTTP API.

Do I need logcli installed to use Simple Loki MCP Server?

No, logcli is optional. If logcli is installed and in your system PATH, the server utilizes it for queries. If logcli is not found, the server automatically falls back to connecting directly via the Loki HTTP API using identical credentials.

What tools does Simple Loki MCP Server provide?

The server provides three MCP tools: query-loki for querying log streams using LogQL syntax and timestamp filters, get-labels for retrieving all available stream labels from Loki, and get-label-values for listing the discrete values associated with any specific label.

Which MCP clients work with Simple Loki MCP Server?

Any Model Context Protocol compatible client works with Simple Loki MCP Server, including Claude Desktop. You can register the server directly using the Smithery CLI or configure it manually using npx and environment variables within your client configuration file.

Is Simple Loki MCP Server open source?

Yes, Simple Loki MCP Server is open source software released under the MIT License. Developers are free to inspect, modify, and distribute the source code. You can find the full code repository and licensing details at https://github.com/ghrud92/loki-mcp.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories