Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana-cloud/machine-learning/mcp/clients/cursor.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/machine-learning/mcp/clients/cursor/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
Menu
Grafana Cloud
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:
JSON
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": [],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}Docker configuration
JSON
{
"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
JSON
{
"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
JSON
{
"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
Additional helpful documentation, links, and articles:
Video

Getting started with managing your metrics, logs, and traces using Grafana
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
Video

Intro to Kubernetes monitoring in Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.
Video

Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.
Choose a product
Scroll for more