Grafana Loki MCP Server

A [FastMCP](https://github.com/jlowin/fastmcp) server that allows querying Loki logs from Grafana.

Local serverstdioPython

What is the Grafana Loki MCP Server?

A FastMCP server that allows querying Loki logs from Grafana.

What the server does

  • Query Loki logs through Grafana API
  • Get Loki labels and label values
  • Format query results in different formats (text, JSON, markdown)
  • Support for both stdio and SSE transport protocols

Credentials and setup notes

  • Python 3.10+ - FastMCP - Requests

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.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
query_loki
get_loki_labels
get_loki_label_values
format_loki_results

How to install the Grafana Loki MCP Server

{
  "mcpServers": {
    "loki": {
      "command": "uvx",
      "args": [
        "grafana-loki-mcp",
        "-u",
        "GRAFANA_URL",
        "-k",
        "GRAFANA_API_KEY"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Python 3.10+ - FastMCP - Requests

Example prompts to try

  • “Use Grafana Loki MCP to Testing.”
  • “Use Grafana Loki MCP to query loki.”
  • “Use Grafana Loki MCP to get loki labels.”

Frequently asked questions

A [FastMCP](https://github.com/jlowin/fastmcp) server that allows querying Loki logs from Grafana. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.