MCP server · Data and analytics
Grafana MCP server
Lets an assistant search dashboards, query Prometheus, Loki and other data sources, and work with alerts and incidents in Grafana.
- Maintainer
- Grafana Labs (official)
- Licence
- Apache-2.0
- Runs
- Locally (uvx)
- Sign-in
- A token or API key
- Registry version
- v2.0.2 (updated 2026-10-10)
- Last activity
- 2026-10-13
Overview
What it does
Grafana Labs’ MCP server gives an assistant access to a Grafana instance and the services around it. The quick start runs the mcp-grafana Python package with uvx, pointed at your Grafana URL with a service account token. It also ships as a Docker image (grafana/mcp-grafana), a binary and a Helm chart, and supports stdio, SSE and Streamable HTTP transports. It works with self-hosted Grafana 9.0 or later and with Grafana Cloud.
Use it when you want an assistant to help during an incident: find the right dashboard, run a PromQL or LogQL query, check alert rules or see who is on call. Beyond Prometheus and Loki, tools for InfluxDB, SQL data sources, CloudWatch, Google Cloud Logging, Graphite, Elasticsearch, OpenSearch and Quickwit are off by default; turn them on with --enabled-tools. It also covers incidents, Grafana OnCall, annotations, snapshots, panel rendering and provisioning. A --disable-write flag runs it in read-only mode, and multi-organisation setups are supported.
Tools
What the assistant can do
- Search, read and update dashboards and run panel queries
- Query Prometheus and Loki; InfluxDB, SQL, CloudWatch, Elasticsearch and other data sources are opt-in (--enabled-tools)
- Read and manage alert rules
- Work with incidents and Grafana OnCall schedules
- Create annotations and snapshots, and render panels
- Generate deep links to dashboards and Explore
Install
Install Grafana MCP server in your app
You need:
- uv (for uvx), or Docker
- Grafana 9.0 or later, or a Grafana Cloud instance (set GRAFANA_URL to its address)
- A Grafana service account token
Run in your project. --scope local keeps the servers private to you in this project; use user for every project.
claude mcp add --env GRAFANA_URL=http://localhost:3000 --env GRAFANA_SERVICE_ACCOUNT_TOKEN="${GRAFANA_SERVICE_ACCOUNT_TOKEN}" --scope local grafana -- uvx mcp-grafana
claude mcp add --env GRAFANA_URL=http://localhost:3000 --env GRAFANA_SERVICE_ACCOUNT_TOKEN="$env:GRAFANA_SERVICE_ACCOUNT_TOKEN" --scope local grafana -- uvx mcp-grafana
- Set GRAFANA_SERVICE_ACCOUNT_TOKEN first, e.g. export GRAFANA_SERVICE_ACCOUNT_TOKEN=… in your shell. The command saves the value, not the variable.
Project root. Commit it to share the servers with your team; each person sets the variables in their own shell.
{
"mcpServers": {
"grafana": {
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "${GRAFANA_SERVICE_ACCOUNT_TOKEN}"
}
}
}
}
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json (Settings → Developer → Edit Config). Restart Claude after saving.
{
"mcpServers": {
"grafana": {
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<GRAFANA_SERVICE_ACCOUNT_TOKEN>"
}
}
}
}
- Claude Desktop doesn’t read variables in this file: replace <GRAFANA_SERVICE_ACCOUNT_TOKEN> with the real values.
- This file contains your keys once filled in. It lives in your user folder; never commit or share it.
In your project, or ~/.cursor/mcp.json for every project.
{
"mcpServers": {
"grafana": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "${env:GRAFANA_SERVICE_ACCOUNT_TOKEN}"
}
}
}
}
In your workspace. VS Code asks for each secret the first time a server starts and stores it securely.
{
"inputs": [
{
"type": "promptString",
"id": "grafana-service-account-token",
"description": "GRAFANA_SERVICE_ACCOUNT_TOKEN",
"password": true
}
],
"servers": {
"grafana": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "${input:grafana-service-account-token}"
}
}
}
}
macOS/Linux: ~/.config/devin/mcp_config.json · Windows: %APPDATA%\devin\mcp_config.json. Read by the default Devin Local agent and by the legacy Cascade agent.
{
"mcpServers": {
"grafana": {
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "${env:GRAFANA_SERVICE_ACCOUNT_TOKEN}"
}
}
}
}
- Devin’s docs confirm ${env:…} references for the legacy Cascade agent; for the default Devin Local agent they only document them in OAuth settings. If a server can’t authenticate, check Devin’s MCP docs.
Want it alongside other servers? Open Grafana MCP server in the MCP config generator and add the rest; it writes one file per app. The snippets follow the setup in the server’s README, checked on 2026-10-14.
Before you install
- The server can do whatever the service account can. The README notes the Editor role is simpler but grants broad read and write access; fine-grained RBAC scopes are the least-privilege option.
- Run with --disable-write to block write operations such as updating dashboards and creating folders.
- Queries return raw metrics and log lines to the assistant, so anything sensitive in your logs can end up in the conversation.
- A local MCP server runs with your user account’s permissions. Install it only from the source linked above. See how to choose a safe server.
Why it’s listed
Why we list it
The vendor’s own server for a common observability stack, covering many data sources with a documented read-only mode.
Related
More MCP servers
- Apify MCP ServerLets an assistant find and run Apify Actors to scrape websites, search engines, maps and social media, then read the results.
- dbt MCP ServerLets an assistant run dbt commands on your project and, with a dbt platform account, explore lineage, metrics and job runs.
- Filesystem MCP ServerLets an assistant read, write, edit, move and search files, but only inside the folders you allow.
All MCP serversMCP config generatorGuide: MCP servers in Claude CodeGuide: what is MCP?