Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyCloud and servers

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

NameWhat it isRequired
PROMETHEUS_URLPrometheus server URL (e.g., http://localhost:9090)Yes
PROMETHEUS_URL_SSL_VERIFYSet to False to disable SSL verificationNo
PROMETHEUS_DISABLE_LINKSSet to True to disable Prometheus UI links in query results (saves context tokens in MCP clients)No
PROMETHEUS_USERNAMEUsername for Prometheus basic authenticationNo
PROMETHEUS_PASSWORDPassword for Prometheus basic authenticationNo
PROMETHEUS_TOKENBearer token for Prometheus authenticationNo
ORG_IDOrganization ID for multi-tenant Prometheus setupsNo
PROMETHEUS_CLIENT_CERTPath to client certificate file for mutual TLS authenticationNo
PROMETHEUS_CLIENT_KEYPath to client private key file for mutual TLS authenticationNo
PROMETHEUS_MCP_SERVER_TRANSPORTMCP server transport type (stdio, http, or sse)No
PROMETHEUS_MCP_BIND_HOSTHost address for HTTP/SSE transport (default: 127.0.0.1)No
PROMETHEUS_MCP_BIND_PORTPort number for HTTP/SSE transport (default: 8080)No
PROMETHEUS_MCP_STATELESS_HTTPEnable stateless HTTP mode for multi-replica support (default: false)No
PROMETHEUS_CUSTOM_HEADERSCustom headers as JSON string to include in Prometheus requestsNo

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 query
  • execute_range_query: run a range query with start, end and step
  • list_metrics: list metrics with paging and filtering
  • get_metric_metadata: read metadata for one or more metrics
  • get_targets: list scrape targets, with state filtering
  • health_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

A Prometheus server your computer can reach, with its address in PROMETHEUS_URL. Docker runs the server, or you can use the Helm chart on Kubernetes.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

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_URL is set and reachable from where the container runs
  • β€ΊIf the server hangs, check PROMETHEUS_REQUEST_TIMEOUT, which defaults to 30 seconds
  • β€ΊUse PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD, or PROMETHEUS_TOKEN, if your Prometheus needs login

5 new skills a week. 1 minute to read.