prometheus-mcp

v0.1.0
io.github.mshegolev/prometheus-mcp Checked 1 hour ago Published 7 months ago

Prometheus MCP — query metrics, inspect alerts, and explore scrape targets (read-only).

Starts only with mcp<2 (written for an older SDK); the install commands pin it.

Values you need

VariableWhat it is
PROMETHEUS_URLrequired Prometheus server URL, e.g. https://prometheus.example.com (no trailing slash)
PROMETHEUS_TOKENoptional secret Bearer token for authentication. Takes priority over Basic auth.
PROMETHEUS_USERNAMEoptional HTTP Basic auth username. Used only when PROMETHEUS_TOKEN is not set.
PROMETHEUS_PASSWORDoptional secret HTTP Basic auth password.
PROMETHEUS_SSL_VERIFYoptional Verify SSL certificates (true/false). Set to 'false' for self-signed certs. Default: true

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add prometheus-mcp -e 'PROMETHEUS_URL=<PROMETHEUS_URL>' -- uvx --with 'mcp<2' prometheus-mcp==0.1.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "prometheus-mcp": {
      "args": [
        "--with",
        "mcp<2",
        "prometheus-mcp==0.1.0"
      ],
      "command": "uvx",
      "env": {
        "PROMETHEUS_URL": "<PROMETHEUS_URL>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "prometheus-mcp": {
      "args": [
        "--with",
        "mcp<2",
        "prometheus-mcp==0.1.0"
      ],
      "command": "uvx",
      "env": {
        "PROMETHEUS_URL": "<PROMETHEUS_URL>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "PROMETHEUS_URL",
      "id": "prometheus-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "prometheus-mcp": {
      "args": [
        "--with",
        "mcp<2",
        "prometheus-mcp==0.1.0"
      ],
      "command": "uvx",
      "env": {
        "PROMETHEUS_URL": "${input:prometheus-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.prometheus-mcp]
command = "uvx"
args = ["--with", "mcp<2", "prometheus-mcp==0.1.0"]
env = { "PROMETHEUS_URL" = "<PROMETHEUS_URL>" }

For AI agents

  1. Ask the user for: PROMETHEUS_URL. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: prometheus_list_metrics, prometheus_query, prometheus_query_range, prometheus_list_alerts, prometheus_list_targets.
  5. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json