prometheus-mcp
v0.1.0Prometheus 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
| Variable | What it is | |
|---|---|---|
PROMETHEUS_URL | required | Prometheus server URL, e.g. https://prometheus.example.com (no trailing slash) |
PROMETHEUS_TOKEN | optional secret | Bearer token for authentication. Takes priority over Basic auth. |
PROMETHEUS_USERNAME | optional | HTTP Basic auth username. Used only when PROMETHEUS_TOKEN is not set. |
PROMETHEUS_PASSWORD | optional secret | HTTP Basic auth password. |
PROMETHEUS_SSL_VERIFY | optional | 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.0Add 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
- Ask the user for: PROMETHEUS_URL. Never invent or guess these values; secrets go into the client config, not into chat logs.
- 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).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: prometheus_list_metrics, prometheus_query, prometheus_query_range, prometheus_list_alerts, prometheus_list_targets.
- 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