Simple Loki MCP Server

MCP server for querying Loki logs via logcli

Local serverstdioTypeScript

What is the Simple Loki MCP Server?

MCP server for querying Loki logs via logcli

What the server does

Loki MCP Server is a Model Context Protocol (MCP) interface for querying Grafana Loki logs using logcli. The server enables AI assistants to access and analyze log data from Loki directly.

  • Query Loki logs with full LogQL support
  • Get label values and metadata
  • Authentication and configuration support via environment variables or config files
  • Provides formatted results in different output formats (default, raw, JSON lines)
  • Automatic fallback to HTTP API when logcli is not available in the environment

Credentials and setup notes

  • Node.js v16 or higher - TypeScript - (Optional) Grafana Loki logcli installed and accessible in your PATH. If logcli is not available, the server will automatically use the Loki HTTP API instead - Access to a Loki server instance

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Configuration

  • Node.js v16 or higher - TypeScript - (Optional) Grafana Loki logcli installed and accessible in your PATH. If logcli is not available, the server will automatically use the Loki HTTP API instead - Access to a Loki server instance
VariableDescriptionRequired
LOKI_ADDRConfiguration value read at startup.Optional
LOKI_TENANT_IDConfiguration value read at startup.Optional
LOKI_BEARER_TOKENCredential the server authenticates with.Yes
LOKI_ORG_IDConfiguration value read at startup.Optional
LOKI_CONFIG_PATHFilesystem location the server is allowed to use.Optional

Frequently asked questions

MCP server for querying Loki logs via logcli Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.