Grafana
MCP server by grafana Community
Gives AI assistants access to Grafana dashboards, datasources and query tools through the Model Context Protocol. It is for teams that use Grafana, including Grafana Cloud, and want to explore dashboards and data from an assistant.
Install Grafana
Built from the published package, never by AI.
claude mcp add grafana -e GRAFANA_URL=YOUR_GRAFANA_URL -- docker run -i --rm -e GRAFANA_URL docker.io/grafana/mcp-grafana:2.4.0Run in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"grafana": {
"env": {
"GRAFANA_URL": "YOUR_GRAFANA_URL"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"GRAFANA_URL",
"docker.io/grafana/mcp-grafana:2.4.0"
],
"command": "docker"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"grafana": {
"env": {
"GRAFANA_URL": "YOUR_GRAFANA_URL"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"GRAFANA_URL",
"docker.io/grafana/mcp-grafana:2.4.0"
],
"command": "docker"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"grafana": {
"env": {
"GRAFANA_URL": "YOUR_GRAFANA_URL"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"GRAFANA_URL",
"docker.io/grafana/mcp-grafana:2.4.0"
],
"command": "docker"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add grafana --env GRAFANA_URL=YOUR_GRAFANA_URL -- docker run -i --rm -e GRAFANA_URL docker.io/grafana/mcp-grafana:2.4.0{
"mcpServers": {
"grafana": {
"env": {
"GRAFANA_URL": "YOUR_GRAFANA_URL"
},
"args": [
"run",
"-i",
"--rm",
"-e",
"GRAFANA_URL",
"docker.io/grafana/mcp-grafana:2.4.0"
],
"command": "docker"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add grafana docker run -i --rm -e GRAFANA_URL docker.io/grafana/mcp-grafana:2.4.0Gemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the grafana block.
About
The Grafana MCP server gives AI assistants access to a Grafana instance and the wider ecosystem around it. It runs through uvx and is configured with a Grafana URL and a service account token. Once connected, the assistant can search and read dashboards, create or update them, patch parts of a dashboard, and run queries against connected datasources.
Tools cover Prometheus, Loki, CloudWatch, X-Ray, Google Cloud Logging, Azure Monitor, InfluxDB and SQL databases. Several groups are disabled by default and turned on with the enabled-tools flag. Dashboard tools include a summary tool and a JSONPath property tool to limit context window use. It suits people who work with Grafana dashboards and data from an AI assistant.
Written from the project's README and checked against it.
Tools it gives your assistant
get_dashboard_summaryGives a compact overview of a dashboard without the full JSON.get_dashboard_propertyExtracts specific parts of a dashboard using JSONPath expressions.get_dashboard_by_uidRetrieves full dashboard details, with an optional version parameter.Search for dashboardsFinds dashboards by title, folder UID, tag or starred status.Patch dashboardApplies specific changes to a dashboard without requiring the full JSON.Query PrometheusRuns PromQL instant and range queries against Prometheus datasources.Query Loki logs and metricsRuns LogQL log and metric queries against Loki datasources.Query CloudWatch LogsRuns CloudWatch Logs Insights queries across one or more log groups.query_cloud_loggingRuns Cloud Logging query filters with a time range and limit.Query InfluxDBRuns InfluxQL or Flux queries against InfluxDB datasources.
What you need
- A Grafana instance running version 9.0 or later
- uv, to run the server with uvx
- A Grafana service account token
- A Grafana URL, such as a Grafana Cloud instance URL
| Setting | Needed | What it is |
|---|---|---|
GRAFANA_Environment variable | Required | URL to your Grafana instance |
GRAFANA_Environment variable, secret | Optional | Service account token used to authenticate with your Grafana instance |
GRAFANA_Environment variable | Optional | Username to authenticate with your Grafana instance |
GRAFANA_Environment variable, secret | Optional | Password to authenticate with your Grafana instance |
GRAFANA_Environment variable | Optional | Organization ID for multi-org support. Can also be set via X-Grafana-Org-Id header in SSE/streamable HTTP transports. |
GRAFANA_Environment variable | Optional | JSON object of additional HTTP headers to send with all Grafana API requests |
GRAFANA_Environment variable | Optional | Comma-separated list of HTTP header names to forward from the incoming request to Grafana (SSE/streamable-http only). Example: Cookie,X-Session-Id |
X-Grafana-URLHeader | Optional | URL of your Grafana Cloud instance |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Summarize dashboard abc123 without loading its full JSON
- Run a PromQL query for request latency over the last hour
- Find Loki log lines with errors from the checkout service today
Good to know
- Notebook, query example, InfluxDB, SQL, CloudWatch, X-Ray and other tool groups are disabled by default.
- Some datasource operations may not work correctly on Grafana versions earlier than 9.0.
- Large dashboards can consume significant context window space when loaded in full.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to Grafana
All alternatives →Azure MCP Server bundles all Azure MCP tools into one local MCP server. It connects AI agents to Azure services and can be used alone or with the GitHub Copilot for Azure extension in VS Code.
Manages monitors, status pages, incidents and maintenances in an openstatus workspace from Claude, ChatGPT, or Cursor. It suits teams that run uptime monitoring and status pages and want their AI assistant to update them.
SmartBear MCP gives AI assistants access to SmartBear's testing and monitoring tools, including BugSnag, Reflect, Swagger, PactFlow and QTM4J. It is aimed at teams that already use these products. Products are reached through remote servers or a local npm package.
Lets AI assistants manage Fettle uptime monitoring, including monitors, incidents, heartbeats, maintenance windows and status page incidents. Built for developers and operations teams who use Fettle and want to work from Claude, Cursor or Codex.
Superlog is an open-source agentic telemetry system that ingests traces, logs and metrics and groups noisy signals into incidents. It is aimed at teams debugging production systems with OpenTelemetry data.
Microsoft Learn MCP gives AI assistants direct access to official Microsoft documentation and code samples through a remote MCP endpoint. It is for developers who use MCP-compatible clients and want answers based on current Microsoft docs.
Compare with Azure MCP Server, openstatus or SmartBear MCP
Grafana: common questions
Does it work with Grafana Cloud?
Yes. The source says to replace GRAFANA_URL with your instance URL, for example https://myinstance.grafana.net.
Which Grafana version is required?
Grafana 9.0 or later is required for full functionality. Some datasource features may not work on earlier versions.
Which datasources can the assistant query?
The source lists dedicated tools for Prometheus, Loki, InfluxDB, CloudWatch, X-Ray, Google Cloud Logging, Azure Monitor and SQL databases such as ClickHouse, PostgreSQL and MySQL.
How do I install Grafana?
In Claude Code run claude mcp add grafana -e GRAFANA_URL=YOUR_GRAFANA_URL -- docker run -i --rm -e GRAFANA_URL docker.io/grafana/mcp-grafana:2.4.0. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Grafana the official server?
Grafana is a community project by grafana, not verified by a company domain.
Is Grafana free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is Grafana safe to use?
It scores 93 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to Grafana?
Similar MCP servers: Azure MCP Server, openstatus, SmartBear MCP, Fettle.
Does Grafana work with ChatGPT?
Yes. Add its server URL in ChatGPT as a custom connector. See MCP in ChatGPT.
