Grafana
Lets your AI agent search Grafana dashboards, query Prometheus and Loki data and update dashboards.
3.6k stars on GitHubby Grafana LabsLicense Apache-2.0Updated 18 days ago
How to install
This MCP has two ways to run: local or remote.
Pick one below. Local runs on your computer; remote runs in the cloud and needs nothing installed.
Paste in the terminal:
claude mcp add grafana -e GRAFANA_URL="<your value>" -- docker run -i --rm -e GRAFANA_URL -e GRAFANA_SERVICE_ACCOUNT_TOKEN -e GRAFANA_USERNAME -e GRAFANA_PASSWORD -e GRAFANA_ORG_ID -e GRAFANA_EXTRA_HEADERS -e GRAFANA_FORWARD_HEADERS docker.io/grafana/mcp-grafana:2.2.0
What to fill in
| Name | What it is | Required |
|---|---|---|
GRAFANA_URL | URL to your Grafana instance | Yes |
GRAFANA_SERVICE_ACCOUNT_TOKEN | Service account token used to authenticate with your Grafana instance | No |
GRAFANA_USERNAME | Username to authenticate with your Grafana instance | No |
GRAFANA_PASSWORD | Password to authenticate with your Grafana instance | No |
GRAFANA_ORG_ID | Organization ID for multi-org support. Can also be set via X-Grafana-Org-Id header in SSE/streamable HTTP transports. | No |
GRAFANA_EXTRA_HEADERS | JSON object of additional HTTP headers to send with all Grafana API requests | No |
GRAFANA_FORWARD_HEADERS | Comma-separated list of HTTP header names to forward from the incoming request to Grafana (SSE/streamable-http only). Example: Cookie,X-Session-Id | No |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Find the dashboards about checkout latency.
Give me a summary of the Kubernetes overview dashboard.
What it is
This server connects your agent to your Grafana instance and the data sources behind it. The agent can find and summarize dashboards, run queries on metrics and logs, and change dashboards. Many extra tool groups, such as SQL, CloudWatch and InfluxDB, are off by default and turned on with a flag.
What it can do
- Search dashboards by title, folder, tag or starred status
- Get a dashboard summary or a single part of it using JSONPath
- Update or patch a dashboard
- List data sources and read their details
- Query Prometheus with PromQL
- Query Loki logs and metrics with LogQL
- Run a dashboard panel's query (off by default)
- Optional SQL, CloudWatch, Graphite and Elasticsearch tools
When to use
- βΊWhen you want to ask what a dashboard shows without opening it.
- βΊWhen you are investigating an incident and need metrics or logs.
- βΊWhen you want your agent to make a small change to a dashboard.
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
monitoring-expertHelps your agent add logs, metrics, and traces to an app, then build Prometheus and Grafana dashboards and alerts that warn you before users notice problems.prometheusHelps your agent set up Prometheus monitoring with PromQL queries, alerting rules and Grafana dashboards that stay useful.loki-loggingLets your agent configure Grafana Loki to collect and analyze logs.Frequently asked questions
Is it official?
Yes. It is the Grafana MCP server from the grafana organization.
What does it need?
A Grafana URL and a service account token. Grafana Cloud URLs work too.
Which Grafana version works?
Version 9.0 or later is needed for full functionality.
Why do some tools not appear?
Several groups, such as SQL, CloudWatch, InfluxDB and run panel query, are disabled by default. Add them to the --enabled-tools flag.
Can big dashboards use up my context?
They can. The readme suggests the summary and property tools instead of getting the full dashboard JSON.
Are database credentials shared with the server?
For SQL tools, queries go through Grafana's data source plugins, so the MCP server never sees credentials.
If it does not work
- βΊCheck GRAFANA_URL and GRAFANA_SERVICE_ACCOUNT_TOKEN in the config env block.
- βΊIf a tool is missing, enable its group with
--enabled-tools. - βΊInstall uv if uvx is not found.
5 new skills a week. 1 minute to read.