
How to add Grafana MCP Server to Windsurf
Grafana's official server for dashboards, Prometheus/Loki queries, alerts, and incidents. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 15, 2026 · 2.1k★ · stdio · apikey · official
Windsurf 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 Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the Grafana MCP Server config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5Grafana MCP Server's tools become available to Cascade.
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 Windsurf
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 + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Grafana MCP Server config there under the "mcpServers" key and restart the client.
Is Grafana MCP Server safe to use with Windsurf?
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.