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/windsurf.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/machine-learning/mcp/clients/windsurf/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
Windsurf
This guide helps you set up the mcp-grafana server for Windsurf.
Prerequisites
- Windsurf IDE installed
- Grafana 9.0+ with a service account token
mcp-grafanabinary in your PATH
Configuration
Configuration file location:
| OS | Path |
|---|---|
| macOS/Linux | ~/.codeium/windsurf/mcp_config.json |
| Windows | %USERPROFILE%\.codeium\windsurf\mcp_config.json |
Add using the UI
- Open Windsurf Settings (Cmd+Shift+P -> Open Windsurf Settings)
- Scroll to Cascade section
- Click Add Server or View raw config
Manual configuration
Create or edit ~/.codeium/windsurf/mcp_config.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
- Click the refresh button after adding the server
- Open Cascade view
- Click the hammer icon (MCP servers)
- Grafana should show green status
- Ask: “List my Grafana dashboards”
Tool limit
Windsurf limits total MCP tools to 100. If you hit the limit:
- Go to Windsurf Settings -> Manage plugins
- Disable unused servers
- Toggle off individual tools you don’t need
Troubleshooting
Server not connecting:
- Press refresh button in Cascade settings
- Check JSON syntax
- Verify binary exists:
which mcp-grafana
SSE transport (remote server):
If you need HTTP-based connection instead of stdio:
mcp-grafana --transport streamable-http --address localhost:8000Then configure with serverUrl:
{
"mcpServers": {
"grafana": {
"serverUrl": "http://localhost:8000/mcp"
}
}
}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.
- Configure authentication for Grafana credentials.
Was this page helpful?
Related resources from Grafana Labs


