Prometheus MCP Server
Lets your AI agent run PromQL queries on your Prometheus server and browse its metrics and scrape targets.
522 stars on GitHubby pab1it0License MITUpdated 20 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add prometheus -e PROMETHEUS_URL="<your value>" -- docker run -i --rm -e PROMETHEUS_URL -e PROMETHEUS_URL_SSL_VERIFY -e PROMETHEUS_DISABLE_LINKS -e PROMETHEUS_USERNAME -e PROMETHEUS_PASSWORD -e PROMETHEUS_TOKEN -e ORG_ID -e PROMETHEUS_CLIENT_CERT -e PROMETHEUS_CLIENT_KEY -e PROMETHEUS_MCP_SERVER_TRANSPORT -e PROMETHEUS_MCP_BIND_HOST -e PROMETHEUS_MCP_BIND_PORT -e PROMETHEUS_MCP_STATELESS_HTTP -e PROMETHEUS_CUSTOM_HEADERS ghcr.io/pab1it0/prometheus-mcp-server:1.6.2
What to fill in
| Name | What it is | Required |
|---|---|---|
PROMETHEUS_URL | Prometheus server URL (e.g., http://localhost:9090) | Yes |
PROMETHEUS_URL_SSL_VERIFY | Set to False to disable SSL verification | No |
PROMETHEUS_DISABLE_LINKS | Set to True to disable Prometheus UI links in query results (saves context tokens in MCP clients) | No |
PROMETHEUS_USERNAME | Username for Prometheus basic authentication | No |
PROMETHEUS_PASSWORD | Password for Prometheus basic authentication | No |
PROMETHEUS_TOKEN | Bearer token for Prometheus authentication | No |
ORG_ID | Organization ID for multi-tenant Prometheus setups | No |
PROMETHEUS_CLIENT_CERT | Path to client certificate file for mutual TLS authentication | No |
PROMETHEUS_CLIENT_KEY | Path to client private key file for mutual TLS authentication | No |
PROMETHEUS_MCP_SERVER_TRANSPORT | MCP server transport type (stdio, http, or sse) | No |
PROMETHEUS_MCP_BIND_HOST | Host address for HTTP/SSE transport (default: 127.0.0.1) | No |
PROMETHEUS_MCP_BIND_PORT | Port number for HTTP/SSE transport (default: 8080) | No |
PROMETHEUS_MCP_STATELESS_HTTP | Enable stateless HTTP mode for multi-replica support (default: false) | No |
PROMETHEUS_CUSTOM_HEADERS | Custom headers as JSON string to include in Prometheus requests | No |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
List the metrics that mention http requests
Show the CPU rate over the last hour with a 5 minute step
What it is
This server connects your AI agent to a Prometheus server. The agent can run instant and range queries, list metrics, read metric metadata and check scrape targets. It supports basic auth, bearer tokens and client certificates.
What it can do
execute_query: run a PromQL instant queryexecute_range_query: run a range query with start, end and steplist_metrics: list metrics with paging and filteringget_metric_metadata: read metadata for one or more metricsget_targets: list scrape targets, with state filteringhealth_check: check that the server is alive
When to use
- βΊWhen you want to ask about CPU, memory or request rates without writing PromQL yourself
- βΊWhen you need to find which metrics exist on your Prometheus
- βΊWhen you want to check whether scrape targets are up
What you need
PROMETHEUS_URL. Docker runs the server, or you can use the Helm chart on Kubernetes.Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
prometheusHelps your agent set up Prometheus monitoring with PromQL queries, alerting rules and Grafana dashboards that stay useful.prometheus-configurationHelps your agent set up a system to collect and monitor important metrics. It's useful for ensuring infrastructure and applications are running smoothly.cloud-monitoring-promql-queryWrites valid PromQL queries for Cloud Monitoring from a metric's details, including aggregations for any Google Cloud resource.Frequently asked questions
Is it free and open source?
Yes. The readme says it is MIT licensed.
What do I need?
A reachable Prometheus server and an MCP client. The readme shows Docker as the way to run it.
Does it support authentication?
Yes. It supports basic auth, a bearer token, mutual TLS client certificates and custom headers, all through environment variables.
Can I run it for several environments?
Yes. Set TOOL_PREFIX so the tool names get a prefix such as staging_execute_query.
Can I turn tools off?
The readme says the list of tools is configurable, which saves context window space.
Does it run on Kubernetes?
Yes. A Helm chart is available from the OCI registry.
If it does not work
- βΊCheck that
PROMETHEUS_URLis set and reachable from where the container runs - βΊIf the server hangs, check
PROMETHEUS_REQUEST_TIMEOUT, which defaults to 30 seconds - βΊUse
PROMETHEUS_USERNAMEandPROMETHEUS_PASSWORD, orPROMETHEUS_TOKEN, if your Prometheus needs login
5 new skills a week. 1 minute to read.