mcp-grafana MCP Server
Search & edit Grafana dashboards, query datasources (PromQL/LogQL/SQL), inspect alerts.
mcp-grafana scores 64 (Good), licensed MIT and written in TypeScript. It installs as a local process. It does not declare tools yet. Filed under Monitoring. GitHub shows 1 stars. Package registries report about 308 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
64 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade C
65/100 for listing completeness. Lost points: no listed tools, short summary.
How quality is graded
Where the 64 comes from
22 + 20 + 1 + 10 + 4 + 7 = 64. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 1 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "dockndevai-mcp-grafana": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-grafana@0.4.1" ], "env": { "GRAFANA_URL": "", "GRAFANA_TOKEN": "YOUR_GRAFANA_TOKEN", "GRAFANA_MODE": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
GRAFANA_URL | Optional | Base URL of the Grafana instance (e.g. http://localhost:3000). |
GRAFANA_TOKENSecret | Required | Grafana service-account token (Bearer). Use a Viewer-role account for read-only use. |
GRAFANA_MODE | Optional | Access mode: read-only | read-write | admin. Starts read-only; writes need read-write. |
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
mcp-grafana
A safe-by-default Model Context Protocol server for Grafana. It lets an agent explore and operate Grafana — search dashboards, read the dashboard JSON model, list and query datasources (Prometheus / Loki / SQL), inspect alert rules and annotations, and (in higher modes) create/update dashboards and folders, write annotations, and delete.
Part of the dockndevai MCP server suite — one governance model across all of them.

What it gives an agent
The server starts read-only (see Safe by default); higher-capability tools are only registered when you raise the mode.
| Tool | For | Needs mode |
|---|---|---|
get_health | check the instance is up, version | read-only |
search | find dashboards & folders by name/tag (get UIDs) | read-only |
list_dashboards / list_folders | enumerate dashboards / folders | read-only |
get_dashboard | the full dashboard JSON model + meta | read-only |
list_datasources / get_datasource | datasources (secrets redacted) | read-only |
query_datasource | run PromQL / LogQL / SQL via the unified query API | read-only |
list_alert_rules | Grafana-managed alert rules | read-only |
list_annotations | events overlaid on graphs | read-only |
create_or_update_dashboard | upsert a dashboard (versioned, reversible) | read-write |
create_folder | create a folder | read-write |
create_annotation | mark a deploy/incident on graphs | read-write |
delete_dashboard / delete_folder / delete_annotation | delete (irreversible) | admin + GRAFANA_ALLOW_DELETE |
Install
npx -y @dockndevai/mcp-grafana
You need a Grafana service account token (Administration → Service accounts → Add service account → Add token). Give it the least role that works — Viewer for read-only use, Editor to create/update, Admin only if you must delete.
Configure
{
"mcpServers": {
"grafana": {
"command": "npx",
"args": ["-y", "@dockndevai/mcp-grafana"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_TOKEN": "glsa_...",
"GRAFANA_MODE": "read-only"
}
}
}
}
See docs/CLIENTS.md for Claude Code / Cursor / Codex / VS Code / Windsurf snippets, and .env.example for every supported variable.
Safe by default
The access model is enforced by src/security.ts — defence in depth on top of the service-account token's own role:
GRAFANA_MODE—read-only(default) →read-write→admin. A tool is registered only if the mode allows its capability. Read-only exposes the 11 read tools; edits needread-write; deletes needadmin.GRAFANA_ALLOW_DELETE— deletes are irreversible, so on top ofadminmode they also require this flag.GRAFANA_FOLDER_ALLOWLIST/GRAFANA_PROTECTED_FOLDERS— confine which folders can be written to; mark folders (e.g.production) that may be read but never modified or deleted. Matched by folder UID or title. Writes check the target folder and, when overwriting, the folder the dashboard currently sits in;create_annotationchecks the folder of the dashboard it attaches to; deletes resolve the target's folder first. The General (root) folder is scoped like any other (name itGeneralin the allowlist or protected list). A protected folder also protects its sub-folders, anddelete_folderrefuses if a protected folder is nested inside. Anything that cannot be resolved is refused.GRAFANA_DATASOURCE_ALLOWLIST— restrict which datasourcesquery_datasourcemay hit.GRAFANA_DRY_RUN— validate and log writes without executing them.GRAFANA_AUDIT_LOG— a JSON audit line per guarded operation, on stderr (default on).- Interactive confirmation — when the client supports MCP elicitation, deleting a dashboard/folder/annotation prompts the human to approve before it runs. The prompt shows the tool, the exact arguments and a fingerprint; the target's version is pinned across the prompt and the action is refused if it changed; a prompt nobody answers is a refusal. Clients that can't elicit fall back to the
GRAFANA_ALLOW_DELETEgate. GRAFANA_REQUIRE_HUMAN_APPROVAL— defaultfalse. Whentrue, deletes are refused if the client cannot elicit (instead of falling back to theGRAFANA_ALLOW_DELETEgate alone).- Secrets are never returned — datasource
secureJsonData, passwords and tokens are stripped from every response.

See SECURITY.md.
Working with dashboards & queries
Conventions for the dashboard JSON model, panel/target shapes, PromQL/LogQL/SQL query patterns, folder organisation and safe editing live in the bundled skill: .claude/skills/grafana-dashboards-and-queries/SKILL.md. Agents that load it can build and edit dashboards to a consistent standard without being re-taught each time.
Developing
npm install
npm run build
GRAFANA_URL=http://localhost:3000 GRAFANA_TOKEN=glsa_… node dist/index.js
# introspect without a live Grafana:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | GRAFANA_TOKEN=x node dist/index.js
Licence
MIT
Frequently asked questions
What is mcp-grafana MCP Server?
Search & edit Grafana dashboards, query datasources (PromQL/LogQL/SQL), inspect alerts.
How do I install mcp-grafana MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. mcp-grafana MCP Server runs locally from the npm package @dockndevai/mcp-grafana with the command npx -y @dockndevai/mcp-grafana@0.4.1.
Is mcp-grafana MCP Server free and open source?
Yes. mcp-grafana MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does mcp-grafana MCP Server support remote (HTTP) connections?
No remote endpoint is listed for mcp-grafana MCP Server. It runs locally on your machine over stdio, started by your MCP client.
How is mcp-grafana MCP Server's trust score calculated?
mcp-grafana MCP Server scores 64 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.
