MCP integration

Visual Studio Code

Wire Prometheus into Visual Studio Code through any MCP-aware extension (Continue, Cline, Roo Code, GitHub Copilot Chat agents).

Visual Studio Code does not speak MCP natively — the protocol is brought in by an extension. The setup below works with any MCP-aware VS Code extension; the JSON shape is the same, only the location of the config file changes.

1. Add the prometheus server to your MCP config

Most extensions read MCP servers from a JSON file in the workspace root (typical paths: .vscode/mcp.json, .continue/config.json's mcpServers block, or the extension-specific settings panel). The block to drop in:

{
  "mcpServers": {
    "prometheus": {
      "command": "npx",
      "args": ["-y", "@prometheus/context-mcp@latest"],
      "env": {
        "PROMETHEUS_API_KEY": "${PROMETHEUS_API_KEY}",
        "PROMETHEUS_WORKSPACE_ID": "${PROMETHEUS_WORKSPACE_ID}"
      }
    }
  }
}

2. Reload the extension

Either reload the VS Code window (Cmd-Shift-PDeveloper: Reload Window) or use the extension's own "reload MCP servers" command if it exposes one. The Prometheus tools appear in the extension's tool / agent panel under the prometheus namespace.

3. Verify

Open the extension's chat or agent panel and run a probe such as prometheus.search_code for a known symbol in the current workspace. You should see grounded results referencing real file paths and line ranges.

Tool naming

Extensions usually prefix external MCP tools with the server name, so search_code shows up as prometheus.search_code. If you instruct the model to call specific tools by name in your system prompt, include the prefix.

See MCP tools for the full surface and JSON schemas.