Simple Loki MCP Server

MCP server for querying Loki logs via logcli

Local serverstdioTypeScript

What is the Simple Loki MCP MCP server?

If you already use Simple Loki MCP, the simple loki mcp mcp server is the piece that lets your assistant work with it directly. 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

Installation

@smithery/cli on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Credentials and setup notes

Configuration is passed through the environment: LOKI_ADDR, LOKI_TENANT_ID, LOKI_BEARER_TOKEN, LOKI_ORG_ID, LOKI_CONFIG_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • 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

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

Plenty of monitoring and observability servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. It is maintained by ghrud92; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

How to install the Simple Loki MCP MCP server

### for MCP

```json
{
  "mcpServers": {
    "simple-loki": {
      "command": "npx",
      "args": ["-y", "simple-loki-mcp"],
      "env": {
        "LOKI_ADDR": "https://loki.sup.band"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

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

It connects Simple Loki MCP to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Simple Loki MCP directly.