Grafana MCP Server for VS Code: Setup & Config
VS Code: Connect MCP assistants to Grafana dashboards, datasources, alerts, and incident workflows.
What you can do with Grafana in VS Code
Choose it to investigate and manage Grafana observability resources from an MCP assistant.
- Inspect a dashboard without loading its complete JSON.
- Manage alert rules and temporary notification silences.
Before you start: Grafana in VS Code
- uv
- Grafana 9.0 or later for full functionality
- An MCP client
- A configured Grafana connection and service-account token
The README's quick start uses uvx. Set the instance URL for local Grafana or Grafana Cloud. Several optional query groups and administrative tools are disabled by default.
Grafana VS Code configuration
Choose VS Code configuration scope
For Grafana MCP Server, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.
Add Grafana MCP Server to VS Code
Use the mcp-grafana entry below in servers. Keep Grafana MCP Server's documented stdio connection fields and your other VS Code entries.
Check Grafana MCP Server in VS Code
Grafana MCP Server: Start in VS Code’s MCP controls; inspect output and trust prompts.
Config file · Workspace: .vscode/mcp.json
{
"servers": {
"mcp-grafana": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "<URL of your Grafana instance>",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<Grafana service-account token>"
}
}
}
}Grafana tools available to VS Code
Grafana's stored tool list documents 40 tools; compare it with VS Code's connected tool list, because the stored list is not a live check.
- add_activity_to_incident
Look for add_activity_to_incident among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Append an investigation note and optional URL context to an incident.
- alerting_manage_routing
Look for alerting_manage_routing among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Manage notification policies, destinations, and active or muted time intervals.
- alerting_routing_write
Look for alerting_routing_write among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Create Grafana-managed alert contact points with integration settings.
- alerting_rules_read
Look for alerting_rules_read among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Find and inspect alert rules using configuration and state filters.
- alerting_rules_write
Look for alerting_rules_write among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Create, replace, or remove Grafana alert rules.
- alerting_silences_read
Look for alerting_silences_read among VS Code's agent-mode tools after starting Grafana through the MCP controls.
List or retrieve alert notification silences.
- alerting_silences_write
Look for alerting_silences_write among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Create, update, or remove temporary notification suppression rules.
- analyze_loki_labels
Look for analyze_loki_labels among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Assess Loki labels and optionally investigate query performance using live cardinality.
- check_datasources_health
Look for check_datasources_health among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Test datasource health with optional type or UID filtering.
- create_annotation
Look for create_annotation among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Add dashboard or panel annotations, including Graphite-format entries.
- create_datasource
Look for create_datasource among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- create_folder
Look for create_folder among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- create_incident
Look for create_incident among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- create_snapshot
Look for create_snapshot among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- delete_annotation
Look for delete_annotation among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- delete_snapshot
Look for delete_snapshot among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- diff_tempo_traces
Look for diff_tempo_traces among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- generate_deeplink
Look for generate_deeplink among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_alert_group
Look for get_alert_group among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_annotation_tags
Look for get_annotation_tags among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_annotations
Look for get_annotations among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Find annotations by dashboard, time window, or tags.
- get_assertions
Look for get_assertions among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Retrieve an entity's assertion summary for a time range.
- get_current_oncall_users
Look for get_current_oncall_users among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Identify the people currently covering an OnCall schedule.
- get_dashboard_by_uid
Look for get_dashboard_by_uid among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Fetch a complete dashboard or a specified saved version.
- get_dashboard_panel_queries
Look for get_dashboard_panel_queries among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Extract dashboard panel queries with optional panel and variable selection.
- get_dashboard_property
Look for get_dashboard_property among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Select dashboard sections through JSONPath instead of fetching all content.
- get_dashboard_summary
Look for get_dashboard_summary among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Read compact dashboard metadata, panel counts, types, and variables.
- get_datasource
Look for get_datasource among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Inspect a datasource by name or UID, including connection and secure-field status.
- get_doc
Look for get_doc among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Fetch Grafana documentation as an outline or a selected section.
- get_incident
Look for get_incident among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Retrieve one incident's status, severity, labels, and metadata.
- get_oncall_shift
Look for get_oncall_shift among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_panel_image
Look for get_panel_image among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_plugin
Look for get_plugin among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_snapshot
Look for get_snapshot among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_tempo_trace
Look for get_tempo_trace among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- get_tempo_traceql_docs
Look for get_tempo_traceql_docs among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- grafana_api_request
Look for grafana_api_request among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- install_plugin
Look for install_plugin among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- list_alert_groups
Look for list_alert_groups among VS Code's agent-mode tools after starting Grafana through the MCP controls.
- list_dashboard_versions
Look for list_dashboard_versions among VS Code's agent-mode tools after starting Grafana through the MCP controls.
Troubleshooting Grafana in VS Code
- Make uvx mcp-grafana (from uv, for Python tools) available in the workspace, container, or remote environment hosting Grafana MCP Server. Start through VS Code's MCP controls; inspect output and trust prompts.
- For Grafana MCP Server, keep GRAFANA_SERVICE_ACCOUNT_TOKEN, GRAFANA_URL out of version control; VS Code documents input variables and secret handling.
- Grafana MCP Server uses stdio here: VS Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Full functionality requires Grafana 9.0 or newer.
- Known limitation: Some query and administrative groups need explicit enabling.
- Known limitation: Rendering and datasource features have additional service prerequisites.
- General VS Code troubleshooting lives in the /clients/vscode guide.
Grafana MCP Server — details. VS Code guide