Prometheus MCP Server
An MCP server for Prometheus: the agent runs PromQL queries, discovers metrics and checks scrape targets
Install
claude mcp add prometheus --env PROMETHEUS_URL=http://your-prometheus:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latestThis is third-party code. Review the repository files before installing.
What it does
The server gives the agent read access to Prometheus. The agent runs instant and range PromQL queries, lists metrics with filtering and pagination, reads metric metadata and checks scrape target status. It supports basic auth, Bearer tokens, mTLS and an organization header for multi-tenant setups. The tool set can be trimmed, and a name prefix lets you connect several environments at once.
Who it is for. For DevOps and SRE engineers who investigate incidents and load using Prometheus metrics.
Good fit when
- You need to see what happened to a service during an incident
- You need a PromQL query without remembering metric names
- You need to check which scrape targets are down
Not a fit when
- Your metrics are not in a Prometheus-compatible system
- You need to change alert rules or Prometheus configuration
Example request
Show how the 5xx error rate for the checkout service changed over the last six hoursLimitations
Requires a Prometheus URL reachable from your machine. The README covers only the Docker image and a Helm chart, so Docker or Kubernetes is needed. Heavy queries over long ranges can load Prometheus; the default timeout is 30 seconds.
How to disable. Run claude mcp remove prometheus or delete the prometheus block from the MCP config.
MCP
- Transport
- stdio, http, sse
- Authentication
- not required
| Environment variables | |
|---|---|
| PROMETHEUS_URL required | Prometheus server URL. |
| PROMETHEUS_USERNAME | Basic auth username. |
| PROMETHEUS_PASSWORD secret | Basic auth password. |
| PROMETHEUS_TOKEN secret | Bearer token. |
| PROMETHEUS_MCP_SERVER_TRANSPORT | stdio, http or sse. |
Security check
- Connects to Prometheus over the network and reads infrastructure metrics
- May use Prometheus access credentials
README in short
The README provides Docker-based configs for Claude Desktop, Claude Code, VS Code, Cursor and Windsurf, plus Docker Desktop and Helm chart installs. A table lists variables for URL, auth, TLS, timeout, transport and tool prefix. Six tools for queries and metric discovery are described. Python project with tests, MIT licensed.
FAQ
Can the agent change anything in Prometheus?
No, every tool is read-only.
How do I connect to a protected Prometheus?
Use PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD, PROMETHEUS_TOKEN or mTLS certificates.
Related
An MCP server built into the Netdata agent: metrics, logs, alerts and live process, service and container data for an AI assistant
GitHub's official MCP server: code, issues, pull requests, Actions and security alerts straight from the agent
AWS's official MCP server suite: docs, IaC, containers, serverless, databases, cost and monitoring
A GitHub Action that runs Claude Code in pull requests and issues: answers mentions, reviews and makes changes