Prometheus MCP Server

v1.6.2
io.github.pab1it0/prometheus-mcp-server Checked 8 hours ago Published 3 months ago

MCP server providing Prometheus metrics access and PromQL query execution for AI assistants

Values you need

VariableWhat it is
PROMETHEUS_URLrequired Prometheus server URL (e.g., http://localhost:9090)
PROMETHEUS_URL_SSL_VERIFYoptional Set to False to disable SSL verification
PROMETHEUS_DISABLE_LINKSoptional Set to True to disable Prometheus UI links in query results (saves context tokens in MCP clients)
PROMETHEUS_USERNAMEoptional Username for Prometheus basic authentication
PROMETHEUS_PASSWORDoptional secret Password for Prometheus basic authentication
PROMETHEUS_TOKENoptional secret Bearer token for Prometheus authentication
ORG_IDoptional Organization ID for multi-tenant Prometheus setups
PROMETHEUS_CLIENT_CERToptional Path to client certificate file for mutual TLS authentication
PROMETHEUS_CLIENT_KEYoptional Path to client private key file for mutual TLS authentication
PROMETHEUS_MCP_SERVER_TRANSPORToptional MCP server transport type (stdio, http, or sse)
PROMETHEUS_MCP_BIND_HOSToptional Host address for HTTP/SSE transport (default: 127.0.0.1)
PROMETHEUS_MCP_BIND_PORToptional Port number for HTTP/SSE transport (default: 8080)
PROMETHEUS_MCP_STATELESS_HTTPoptional Enable stateless HTTP mode for multi-replica support (default: false)
PROMETHEUS_CUSTOM_HEADERSoptional Custom headers as JSON string to include in Prometheus requests

Docker verified

Requires Docker

Run in a terminal
claude mcp add prometheus-mcp-server -e 'PROMETHEUS_URL=<PROMETHEUS_URL>' -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:1.6.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "prometheus-mcp-server": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PROMETHEUS_URL",
        "ghcr.io/pab1it0/prometheus-mcp-server:1.6.2"
      ],
      "command": "docker",
      "env": {
        "PROMETHEUS_URL": "<PROMETHEUS_URL>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "prometheus-mcp-server": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PROMETHEUS_URL",
        "ghcr.io/pab1it0/prometheus-mcp-server:1.6.2"
      ],
      "command": "docker",
      "env": {
        "PROMETHEUS_URL": "<PROMETHEUS_URL>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "PROMETHEUS_URL",
      "id": "prometheus-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "prometheus-mcp-server": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PROMETHEUS_URL",
        "ghcr.io/pab1it0/prometheus-mcp-server:1.6.2"
      ],
      "command": "docker",
      "env": {
        "PROMETHEUS_URL": "${input:prometheus-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.prometheus-mcp-server]
command = "docker"
args = ["run", "-i", "--rm", "-e", "PROMETHEUS_URL", "ghcr.io/pab1it0/prometheus-mcp-server:1.6.2"]
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: health_check, execute_query, execute_range_query, list_metrics, get_metric_metadata, get_targets.
  5. If it fails, check that the required runtime is installed (Docker) and that the values above are set.

Machine-readable: install.md · manifest.json