Grafana
Query Grafana dashboards, metrics, logs and alerts from an AI assistant
- Pricing
- Open source
- Platforms
- CLI, API, self-hosted
- Runs
- Locally or Remotely
- Version
- v2.3.0
- Listing updated
- 3 days ago
About Grafana
Grafana is an open-source MCP server for analytics and data. It can run locally on your machine or as a hosted remote server.
Setup is a single uvx mcp-grafana entry in the client config, with GRAFANA_URL and a service account token passed as environment variables. It also ships as a Docker image and over streamable HTTP, and Grafana Labs documents binary and Helm installs. Optional settings cover an organisation ID for multi-org setups and extra or forwarded HTTP headers.
The server reaches beyond dashboards: it can query datasources such as Prometheus and Loki, manage alert rules, work with Grafana Incident and OnCall, and build deeplinks to Grafana resources. Dashboard tools are written with context size in mind, so an assistant can fetch a summary or a JSONPath-selected slice of a dashboard, or patch one, instead of loading the full JSON.
Grafana 9.0 or later is needed for full functionality, and datasource operations may fail on older versions. Running panel queries is off by default and has to be enabled through the --enabled-tools flag.
Install
Run in a terminal
claude mcp add --transport http mcp-grafana https://mcp.grafana.com/mcpAdd to Settings → Connectors → Add custom connector
https://mcp.grafana.com/mcpAdd to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-grafana": {
"url": "https://mcp.grafana.com/mcp"
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp-grafana": {
"type": "http",
"url": "https://mcp.grafana.com/mcp"
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-grafana": {
"serverUrl": "https://mcp.grafana.com/mcp"
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-grafana": {
"type": "http",
"url": "https://mcp.grafana.com/mcp"
}
}
}Configuration
GRAFANA_URLURL to your Grafana instanceRequiredGRAFANA_SERVICE_ACCOUNT_TOKENService account token used to authenticate with your Grafana instanceGRAFANA_USERNAMEUsername to authenticate with your Grafana instanceGRAFANA_PASSWORDPassword to authenticate with your Grafana instanceGRAFANA_ORG_IDOrganization ID for multi-org support. Can also be set via X-Grafana-Org-Id header in SSE/streamable HTTP transports.GRAFANA_EXTRA_HEADERSJSON object of additional HTTP headers to send with all Grafana API requestsGRAFANA_FORWARD_HEADERSComma-separated list of HTTP header names to forward from the incoming request to Grafana (SSE/streamable-http only). Example: Cookie,X-Session-Id
Tools this server provides (2)
Taken from the project documentation; the running server may differ.
- get_dashboard_summary
- Compact overview of a dashboard: title, panel count, panel types and variables.
- get_dashboard_property
- Extract parts of a dashboard with a JSONPath expression.
What it does
- Dashboard search and edit
- Find dashboards by title, folder, tag or starred status, then create, update or patch them.
- Context-saving reads
- Summaries and JSONPath property lookups keep large dashboards from filling the model's context window.
- Datasource queries
- Query metrics and logs from datasources such as Prometheus and Loki.
- Alerting and incidents
- Manage alert rules and work with Grafana Incident and OnCall.
- Panel query runner
- Run a panel's query with custom time ranges and variable overrides once enabled.
- Flexible transports
- Run over stdio or streamable HTTP via uvx, Docker, a binary or Helm.
Good for
- Ask an assistant what a dashboard shows without opening Grafana
- Pull recent logs or metrics into a chat while triaging an incident
- Review or adjust alert rules from an editor
- Patch one panel of a large dashboard without resending its JSON
- Generate links to Grafana resources to paste into tickets
Pricing
Open source
Apache 2.0 licence; no charge for the server itself
Prices change. Check grafana.com before you buy.
Grafana FAQ
Which Grafana versions work?
Grafana 9.0 or later is required for full functionality; datasource features may not work on earlier versions.
How does it authenticate?
The open source server uses a Grafana service account token, with optional username and password variables. Grafana's hosted Cloud MCP server uses OAuth 2.1 instead.
Is it open source?
Yes, it is licensed under Apache 2.0.
Does it work with Grafana Cloud?
Yes. Set GRAFANA_URL to your instance address, for example https://myinstance.grafana.net.
Is Grafana free?
Yes. Grafana is open source, so you can use and self-host it for free.
How do I add Grafana to Claude Code?
Run this command in your terminal: claude mcp add --transport http mcp-grafana https://mcp.grafana.com/mcp
What are the best alternatives to Grafana?
The closest alternatives to Grafana are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to Grafana

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Agent-Native Analytics
MCP serverOpen-source analytics app where an AI agent builds charts and dashboards from your data
- Remote
- Open source
- 7.7K GitHub stars
- Analytics and data