Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana/next/developer-resources/mcp/clients/cursor.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana/next/developer-resources/mcp/clients/cursor/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.
Cursor
This guide helps you set up the mcp-grafana server for Cursor.
Prerequisites
- Cursor IDE installed
- Grafana 9.0+ with a service account token
mcp-grafanabinary in your PATH
Configuration
Two options for configuration location:
| Scope | Path |
|---|---|
| Global (all projects) | ~/.cursor/mcp.json |
| Project-specific | .cursor/mcp.json in project root |
Add using the UI
- Open Cursor Settings -> Tools & Integrations
- Click New MCP Server
- This opens
~/.cursor/mcp.jsonfor editing
Manual configuration
Create or edit ~/.cursor/mcp.json:
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": [],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Docker configuration
{
"mcpServers": {
"grafana": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"GRAFANA_URL",
"-e",
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
"grafana/mcp-grafana",
"-t",
"stdio"
],
"env": {
"GRAFANA_URL": "http://host.docker.internal:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Debug mode
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": ["-debug"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Verify configuration
- Go to Cursor Settings -> Tools & Integrations
- Find grafana in the MCP servers list
- Click the refresh button if needed
- Green indicator = server running
- Open Composer and ask: “List my Grafana dashboards”
Troubleshooting
Server not appearing:
- Check JSON syntax (trailing commas break it)
- Restart Cursor
- Verify binary path:
which mcp-grafana
Tools not working:
- Click refresh button in MCP settings
- Check Grafana token permissions
- Enable
-debugflag and check output
Read-only mode
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": ["--disable-write"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Next steps
- Set up for other install options (uvx, Helm).
- Configure authentication for Grafana credentials.
Was this page helpful?
Related resources from Grafana Labs


