mcp-grafana

v0.4.1
io.github.dockndevai/mcp-grafana Checked 14 hours ago Published 8 days ago

Search & edit Grafana dashboards, query datasources (PromQL/LogQL/SQL), inspect alerts.

Values you need

VariableWhat it is
GRAFANA_URLoptional Base URL of the Grafana instance (e.g. http://localhost:3000).
GRAFANA_TOKENrequired secret Grafana service-account token (Bearer). Use a Viewer-role account for read-only use.
GRAFANA_MODEoptional Access mode: read-only | read-write | admin. Starts read-only; writes need read-write.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add mcp-grafana -e 'GRAFANA_TOKEN=<GRAFANA_TOKEN>' -- npx -y @dockndevai/mcp-grafana@0.4.1
Add to claude_desktop_config.json
{
  "mcpServers": {
    "mcp-grafana": {
      "args": [
        "-y",
        "@dockndevai/mcp-grafana@0.4.1"
      ],
      "command": "npx",
      "env": {
        "GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "mcp-grafana": {
      "args": [
        "-y",
        "@dockndevai/mcp-grafana@0.4.1"
      ],
      "command": "npx",
      "env": {
        "GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "GRAFANA_TOKEN",
      "id": "grafana-token",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "mcp-grafana": {
      "args": [
        "-y",
        "@dockndevai/mcp-grafana@0.4.1"
      ],
      "command": "npx",
      "env": {
        "GRAFANA_TOKEN": "${input:grafana-token}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.mcp-grafana]
command = "npx"
args = ["-y", "@dockndevai/mcp-grafana@0.4.1"]
env = { "GRAFANA_TOKEN" = "<GRAFANA_TOKEN>" }

For AI agents

  1. Ask the user for: GRAFANA_TOKEN. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: get_health, search, list_dashboards, get_dashboard, list_folders, get_folder, list_datasources, get_datasource, ….
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json