MCP Grafana
Safe-by-default MCP server for searching, querying and editing Grafana dashboards
MCP Grafana is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- CLI
- Runs
- Locally
- What it can do
- Can delete data (3 tools)
- Access
- Needs a secret key or token
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add mcp-grafana --env GRAFANA_TOKEN='<GRAFANA_TOKEN>' -- npx -y @dockndevai/mcp-grafanaAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"mcp-grafana": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-grafana"
],
"env": {
"GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
}
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"mcp-grafana": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-grafana"
],
"env": {
"GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
}
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-grafana": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-grafana"
],
"env": {
"GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
}
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"mcp-grafana": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-grafana"
],
"env": {
"GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
}
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add mcp-grafana --env GRAFANA_TOKEN='<GRAFANA_TOKEN>' -- npx -y @dockndevai/mcp-grafanaOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.mcp-grafana]
command = "npx"
args = ["-y", "@dockndevai/mcp-grafana"]
env = { GRAFANA_TOKEN = "<GRAFANA_TOKEN>" }Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-grafana": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-grafana"
],
"env": {
"GRAFANA_TOKEN": "<GRAFANA_TOKEN>"
}
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }Or run: gemini mcp add -s user -e GRAFANA_TOKEN='<GRAFANA_TOKEN>' mcp-grafana npx -- -y @dockndevai/mcp-grafana
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.
Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana" ], "env": { "GRAFANA_TOKEN": "<GRAFANA_TOKEN>" } } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
Configuration
GRAFANA_URLBase URL of the Grafana instance (e.g. http://localhost:3000).GRAFANA_TOKENGrafana service-account token (Bearer). Use a Viewer-role account for read-only use.RequiredGRAFANA_MODEAccess mode: read-only | read-write | admin. Starts read-only; writes need read-write.
About MCP Grafana
The server starts in read-only mode and only registers the tools a chosen mode allows, so an agent that is pointed at Grafana with a Viewer token cannot edit anything. Setting GRAFANA_MODE to read-write adds dashboard, folder and annotation writes, and admin mode adds deletes, which also need GRAFANA_ALLOW_DELETE.
On the read side the agent can search by name or tag, pull a dashboard's full JSON model, list datasources with secrets redacted, and run PromQL, LogQL or SQL through Grafana's unified query API. Alert rules and annotations are readable too.
Guards go beyond the token's own role: folder allowlists and protected folders (a protected folder also shields its sub-folders), a datasource allowlist, dry-run, a JSON audit line on stderr, and human approval through MCP elicitation before deletes. The repository also bundles a skill with conventions for dashboard JSON and query patterns. It authenticates with a Grafana service-account token and runs over stdio via npx.
Tools this server provides (16)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 3 of 16 tools delete data and 3 change data.
From the server's own tool labels and tool names; not verified by us.
- get_healthName suggests: reads
- Check the instance is up and report its version
- searchName suggests: reads
- Find dashboards and folders by name or tag
- list_dashboardsName suggests: reads
- List dashboards
- list_foldersName suggests: reads
- List folders
- get_dashboardName suggests: reads
- Return the full dashboard JSON model and metadata
- list_datasourcesName suggests: reads
- List datasources with secrets redacted
- get_datasourceName suggests: reads
- Get one datasource
- query_datasourceName suggests: reads
- Run PromQL, LogQL or SQL through the unified query API
- list_alert_rulesName suggests: reads
- List Grafana-managed alert rules
- list_annotationsName suggests: reads
- List annotations overlaid on graphs
- create_or_update_dashboardName suggests: changes
- Upsert a dashboard (read-write mode)
- create_folderName suggests: changes
- Create a folder (read-write mode)
- create_annotationName suggests: changes
- Add an annotation, for example a deploy or incident marker (read-write mode)
- delete_dashboardName suggests: deletes
- Delete a dashboard (admin mode)
- delete_folderName suggests: deletes
- Delete a folder (admin mode)
- delete_annotationName suggests: deletes
- Delete an annotation (admin mode)
What it does
- Read-only start
- Higher-capability tools are not even registered until the mode is raised.
- Datasource queries
- Run PromQL, LogQL or SQL through the unified query API.
- Dashboard JSON access
- Fetch the full dashboard model and metadata by UID.
- Folder protection
- Allowlist writable folders and mark others as read-only, including sub-folders.
- Confirmed deletes
- Deletes need admin mode, an allow flag and a human approval prompt.
- Audit and dry-run
- Log guarded operations as JSON and preview writes without executing them.
Good for
- Ask which dashboards cover a service and open their definitions
- Run a Prometheus or Loki query from chat while debugging an incident
- Mark a deploy or incident as an annotation on graphs
- Generate or update a dashboard in a staging folder
- Review alert rules without opening the Grafana UI
Pricing
Open source
MIT licence
MCP Grafana FAQ
What does MCP Grafana need to connect?
A Grafana base URL and a service-account token; a Viewer role is enough for read-only use.
Can the agent delete dashboards?
Only in admin mode with GRAFANA_ALLOW_DELETE set, and with a human approval prompt where the client supports it.
Are datasource secrets exposed?
No. Secrets, passwords and tokens are stripped from responses.
How is MCP Grafana installed?
Run npx -y @dockndevai/mcp-grafana from an MCP client such as Claude Code, Cursor, Codex, VS Code or Windsurf.
Is MCP Grafana free?
Yes. MCP Grafana is open source, so you can use and self-host it for free.
How do I add MCP Grafana to Claude Code?
Run this command in your terminal: claude mcp add mcp-grafana --env GRAFANA_TOKEN='<GRAFANA_TOKEN>' -- npx -y @dockndevai/mcp-grafana
What are the best alternatives to MCP Grafana?
The closest alternatives to MCP Grafana are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


