Data as of

Grafana MCP Server for VS Code: Setup & Config

VS Code: Connect MCP assistants to Grafana dashboards, datasources, alerts, and incident workflows.

Grafana MCP Server VS Code configuration

  1. Choose VS Code configuration scope

    For Grafana MCP Server, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.

  2. 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.

  3. 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

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 in VS Code: stdio checks

  • 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.
Tools
add_activity_to_incident, alerting_manage_routing, alerting_routing_write

Grafana MCP Server — details. VS Code guide

Frequently asked questions

For Grafana MCP Server, edit workspace .vscode/mcp.json. VS Code requires servers rather than mcpServers; preserve the displayed type on each entry.

VS Code's mcp-grafana example uses stdio.

Grafana MCP Server's VS Code configuration invokes uvx mcp-grafana (from uv, for Python tools).

VS Code's Grafana MCP Server example references GRAFANA_SERVICE_ACCOUNT_TOKEN, GRAFANA_URL. Check these names if startup or authentication fails; the example alone does not distinguish required from optional values.

Grafana MCP Server's stored list contains 40 tools, including add_activity_to_incident, alerting_manage_routing, alerting_routing_write. Compare those names with VS Code's connected tool list; the stored list is not a live check.