如何将 Grafana Cloud 远程 MCP 连接到 Windsurf
约 1 分钟即可把 Grafana Labs 的远程 MCP 服务端接入 Windsurf。如需排查 OAuth / 401 问题,可先用 OAuth 2.1 调试器体检端点。
Streamable HTTPhttps://mcp.grafana.com/mcp
Install in Cursor →
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"grafana": {
"url": "https://mcp.grafana.com/mcp"
}
}
}claude mcp add --transport http grafana https://mcp.grafana.com/mcp
Install in VS Code →
Or add to .vscode/mcp.json:
{
"servers": {
"grafana": {
"type": "http",
"url": "https://mcp.grafana.com/mcp"
}
}
}- Open Settings → Connectors (Integrations) → Add Custom Connector.
- Paste the endpoint URL:
https://mcp.grafana.com/mcp - Complete the browser OAuth 2.1 login flow when prompted.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"grafana": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.grafana.com/mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"grafana": {
"serverUrl": "https://mcp.grafana.com/mcp"
}
}
}Add to ~/.kiro/settings/mcp.json (or .kiro/settings/mcp.json in your workspace), then reopen Kiro's Agent panel to pick up the server:
{
"mcpServers": {
"grafana": {
"url": "https://mcp.grafana.com/mcp"
}
}
}Add to ~/.codex/config.toml — Codex reads remote HTTP servers from [mcp_servers.*] tables:
[mcp_servers.grafana] url = "https://mcp.grafana.com/mcp"
Add to cline_mcp_settings.json (Cline → MCP Servers → Configure), or paste it via Cline's MCP marketplace file:
{
"mcpServers": {
"grafana": {
"type": "streamableHttp",
"url": "https://mcp.grafana.com/mcp"
}
}
}Add to ~/.gemini/settings.json under mcpServers — httpUrl for Streamable HTTP, url for legacy SSE:
{
"mcpServers": {
"grafana": {
"httpUrl": "https://mcp.grafana.com/mcp"
}
}
}接入步骤
- 打开配置文件 — 编辑
~/.codeium/windsurf/mcp_config.json。 - 添加服务端 — 在
mcpServers中加入"grafana": { "serverUrl":https://mcp.grafana.com/mcp}。 - 完成认证 — 首次调用时客户端会打开 Grafana Labs 的 OAuth 授权页面——点击允许后工具即可用。
- 验证 — 在 在线 Inspector 中粘贴
https://mcp.grafana.com/mcp并运行 initialize + tools/list 验证连通性。
🧰 工具预览(47)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| search_dashboards ~34 tok | 🟢 Read | Search Grafana dashboards by title or tag. | — |
| get_dashboard_by_uid ~33 tok | 🟢 Read | Get a dashboard's full JSON model. | — |
| get_dashboard_summary ~34 tok | 🟢 Read | Get a compact summary of a dashboard. | — |
| get_dashboard_property ~38 tok | 🟢 Read | Extract a specific JSONPath value from a dashboard. | — |
| update_dashboard ~33 tok | 🟠 Write | Create or update a Grafana dashboard. | — |
| get_dashboard_panel_queries ~35 tok | 🟢 Read | Get queries used by dashboard panels. | — |
| list_datasources ~30 tok | 🟢 Read | List configured datasources. | — |
| get_datasource_by_uid ~31 tok | 🟢 Read | Get a datasource by UID. | — |
| get_datasource_by_name ~31 tok | 🟢 Read | Get a datasource by name. | — |
| query_prometheus ~31 tok | 🟢 Read | Query a Prometheus datasource. | — |
| list_prometheus_metric_names ~34 tok | 🟢 Read | List Prometheus metric names. | — |
| list_prometheus_metric_metadata ~35 tok | 🟢 Read | List Prometheus metric metadata. | — |
| list_prometheus_label_names ~33 tok | 🟢 Read | List Prometheus label names. | — |
| list_prometheus_label_values ~35 tok | 🟢 Read | List values of a Prometheus label. | — |
| query_loki_logs ~32 tok | 🟢 Read | Query logs from a Loki datasource. | — |
| list_loki_label_names ~30 tok | 🟢 Read | List Loki label names. | — |
| list_loki_label_values ~32 tok | 🟢 Read | List values of a Loki label. | — |
| query_loki_stats ~30 tok | 🟢 Read | Query Loki index statistics. | — |
| list_incidents ~29 tok | 🟢 Read | List Grafana incidents. | — |
| create_incident ~30 tok | 🟠 Write | Create a Grafana incident. | — |
| add_activity_to_incident ~34 tok | 🟠 Write | Add an activity note to an incident. | — |
| resolve_incident ~30 tok | 🟠 Write | Resolve a Grafana incident. | — |
| list_alert_rules ~30 tok | 🟢 Read | List Grafana alert rules. | — |
| get_alert_rule_by_uid ~31 tok | 🟢 Read | Get an alert rule by UID. | — |
| create_alert_rule ~31 tok | 🟠 Write | Create a Grafana alert rule. | — |
| update_alert_rule ~31 tok | 🟠 Write | Update a Grafana alert rule. | — |
| delete_alert_rule ~31 tok | 🔴 Destructive | Delete a Grafana alert rule. | — |
| list_contact_points ~31 tok | 🟢 Read | List alert contact points. | — |
| create_contact_point ~32 tok | 🟠 Write | Create an alert contact point. | — |
| list_oncall_schedules ~32 tok | 🟢 Read | List Grafana OnCall schedules. | — |
| get_oncall_shift ~28 tok | 🟢 Read | Get an OnCall shift. | — |
| get_current_oncall_users ~33 tok | 🟢 Read | List users currently on call. | — |
| list_teams ~27 tok | 🟢 Read | List Grafana teams. | — |
| list_users_by_org ~31 tok | 🟢 Read | List users in the organization. | — |
| query_tempo_search ~29 tok | 🟢 Read | Search Tempo traces. | — |
| query_tempo_trace ~30 tok | 🟢 Read | Fetch a Tempo trace by ID. | — |
| list_pyroscope_profile_types ~34 tok | 🟢 Read | List Pyroscope profile types. | — |
| list_pyroscope_label_names ~33 tok | 🟢 Read | List Pyroscope label names. | — |
| list_pyroscope_label_values ~33 tok | 🟢 Read | List Pyroscope label values. | — |
| fetch_pyroscope_profile ~34 tok | 🟢 Read | Fetch a Pyroscope flamegraph profile. | — |
| get_current_time ~32 tok | 🟢 Read | Get the current Grafana server time. | — |
| search_folders ~29 tok | 🟢 Read | Search Grafana folders. | — |
| create_folder ~29 tok | 🟠 Write | Create a Grafana folder. | — |
| list_sift_investigations ~32 tok | 🟢 Read | List Sift investigations. | — |
| get_sift_investigation ~33 tok | 🟢 Read | Get a Sift investigation result. | — |
| get_sift_analysis ~31 tok | 🟢 Read | Get a Sift analysis finding. | — |
| get_assertions_summary ~34 tok | 🟢 Read | Get service health assertions summary. | — |