
How to add Grafana MCP Server to Cursor
Grafana's official server for dashboards, Prometheus/Loki queries, alerts, and incidents. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 15, 2026 · 2.1k★ · stdio · apikey · official
Cursor config for Grafana MCP Server
docker run --rm -i -e GRAFANA_URL -e GRAFANA_SERVICE_ACCOUNT_TOKEN grafana/mcp-grafana -t stdio{
"mcpServers": {
"grafana-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"GRAFANA_URL",
"-e",
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
"grafana/mcp-grafana",
"-t",
"stdio"
],
"env": {
"GRAFANA_URL": "https://your-grafana-instance.example.com",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-grafana-service-account-token>"
}
}
}
}Requires Docker to be installed and running.
Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Grafana MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Grafana MCP Server's tools to confirm it's connected.
Before you start
- A Grafana instance, version 9.0+ recommended for full datasource functionality
- A Grafana service account token with RBAC permissions for the resources you want to access (create one under Administration > Service accounts)
- Set GRAFANA_URL and GRAFANA_SERVICE_ACCOUNT_TOKEN environment variables
- To install/build: the Go toolchain, or use the prebuilt binary, Docker image grafana/mcp-grafana, uvx, or the Helm chart
What Grafana MCP Server can do in Cursor
search_dashboardsFind dashboards by name/metadata.
get_dashboard_summaryGet a compact dashboard overview without the full JSON.
update_dashboardCreate or modify a dashboard.
list_datasourcesList configured Grafana data sources.
query_prometheusRun instant or range PromQL queries against a Prometheus datasource.
list_prometheus_metric_namesList available Prometheus metric names.
query_loki_logsRun LogQL queries against a Loki datasource.
list_loki_label_namesList Loki label names for log exploration.
Security
The service account token scopes what the agent can read or change in Grafana, so grant it only the roles needed (for example Viewer for read-only dashboards). Alerting tools can modify notification routing if the token has admin permissions.
Grafana MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Grafana MCP Server config there under the "mcpServers" key and restart the client.
Is Grafana MCP Server safe to use with Cursor?
The service account token scopes what the agent can read or change in Grafana, so grant it only the roles needed (for example Viewer for read-only dashboards). Alerting tools can modify notification routing if the token has admin permissions.
How do I authenticate?
Create a Grafana service account token and pass it via GRAFANA_SERVICE_ACCOUNT_TOKEN, along with GRAFANA_URL pointing at your instance. The token's RBAC permissions determine what the server can do.
Why don't I see ClickHouse / CloudWatch / admin tools?
Many datasource and admin tool categories are disabled by default and must be explicitly enabled. Turn on the relevant category to expose those tools.
Can I run it in read-only mode?
Yes. Start the server with --disable-write so it can query dashboards, metrics, and logs but cannot create or modify resources.