Prometheus MCP Server logo

Prometheus MCP Server

Query, inspect, configure, and manage a running Prometheus instance through MCP tools.

Install Prometheus MCP Server

Run the project’s own setup commands, in order.

Setup steps from the project

prometheus-mcp-server installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Start the server
    PROMETHEUS_MCP_PROMETHEUS_URL="https://$yourPrometheus:9090" /path/to/prometheus-mcp
    
  2. 2. Start the server
    docker run --rm -i ghcr.io/tjhop/prometheus-mcp-server:latest --prometheus.url "https://$yourPrometheus:9090"
    
  3. 3. Start the server
    docker run --rm -i -e PROMETHEUS_MCP_SERVER_PROMETHEUS_URL="https://$yourPrometheus:9090" ghcr.io/tjhop/prometheus-mcp-server:latest
    
  4. 4. Start the server
    docker run --rm -p 8080:8080 ghcr.io/tjhop/prometheus-mcp-server:latest --prometheus.url "https://$yourPrometheus:9090" --mcp.transport "http" --web.listen-address ":8080"
    
  5. 5. Start the server
    docker run --rm -p 8080:8080 -e PROMETHEUS_MCP_SERVER_PROMETHEUS_URL="https://$yourPrometheus:9090" -e PROMETHEUS_MCP_SERVER_MCP_TRANSPORT="http" -e PROMETHEUS_MCP_SERVER_WEB_LISTEN_ADDRESS=":8080" ghcr.io/tjhop/prometheus-mcp-server:latest
    
  6. 6. Install
    helm install prometheus-mcp-server oci://ghcr.io/tjhop/charts/prometheus-mcp-server \
      --version <version> \
      --set prometheus.url=http://prometheus:9090
    

Overview

prometheus-mcp-server connects AI clients to a running Prometheus instance through its HTTP API. It supports PromQL instant and range queries, metric and label exploration, target and alert inspection, runtime and configuration details, and embedded Prometheus documentation and runbooks. Optional tools can reload configuration, trigger shutdown, or perform TSDB administration, including deletion and snapshots. Reach for it when an agent needs to investigate metrics, review Prometheus health, or guide operators through common troubleshooting workflows.

Use cases

  • Investigate slow PromQL queries and high-cardinality metrics
  • Review Prometheus health, configuration, runtime details, and targets
  • Explore metric names, labels, series, exemplars, and metadata
  • Inspect active alerts and loaded recording or alerting rules
  • Follow embedded runbooks for missing-data and error-rate investigations

Key features

  • Instant and range PromQL queries
  • Metric, label, series, target, and exemplar discovery
  • Prometheus health, runtime, configuration, and rule inspection
  • Searchable Prometheus documentation and embedded runbooks
  • Optional TSDB administration tools
  • TOON output and configurable response truncation

Tools30

What Prometheus MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~611 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

23/23 checks healthy over the last 82d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars148Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Tools exposed30Callable tools this server registers over MCP.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Prometheus MCP Server works

What prometheus-mcp-server does

prometheus-mcp-server gives an MCP client structured access to a running Prometheus instance. Its tools cover PromQL queries, metric metadata, labels, series, exemplars, targets, alerts, rules, runtime details, configuration, feature flags, build information, and health endpoints. Responses from the Prometheus HTTP API are returned as JSON for the language model to process.

The server also includes access to official Prometheus documentation stored from the prometheus/docs repository. Agents can list available files, read a named Markdown file, or search the documentation. Embedded runbooks provide guided workflows for tasks such as health checks, missing-data investigations, error-rate analysis, high-cardinality review, and alerting or recording rule review.

How it works

The server acts as an MCP interface over the Prometheus API. query runs an instant PromQL query, while range_query evaluates a query across a time window. Discovery tools inspect label names, label values, series, scraped metric metadata, targets, and Alertmanager discovery. Other tools expose Prometheus management and status endpoints, including readiness, health, configuration reload, runtime information, and graceful shutdown.

All tools are registered by default except the TSDB administration tools, which require explicit opt-in. For clients with smaller context windows, a tool whitelist can be supplied so only selected non-core tools are registered. The core set includes documentation, runbook, query, range-query, metric, label, and series tools.

The server can also format API responses using TOON, a token-oriented representation intended to reduce context usage in some workloads. Response truncation can limit returned lines or entries; truncation is disabled by default, and supported tool calls may override the global limit.

Setup and configuration

The command-line interface supports selecting additional MCP tools. For example:

shell
prometheus-mcp --mcp.tools=build_info --mcp.tools=flags --mcp.tools=runtime_info

This registers the requested tools alongside the always-loaded core tools. The TSDB administration set must be enabled with --dangerous.enable-tsdb-admin-tools. That option exposes clean_tombstones, delete_series, and snapshot.

Tools and capabilities

  • Run instant and range PromQL queries.
  • Explore labels, series, exemplars, metric metadata, targets, and target metadata.
  • Review active alerts, loaded alerting and recording rules, Alertmanager discovery, and TSDB statistics.
  • Inspect build, runtime, configuration, flags, health, readiness, and WAL replay status.
  • Search and read official Prometheus documentation and embedded operational runbooks.
  • Reload configuration and rule files, or request a graceful Prometheus shutdown.
  • Enable TSDB cleanup, series deletion, and data snapshots when the administrative option is explicitly enabled.

Limitations and notes

TSDB administration can delete data or modify on-disk state, so those tools are disabled unless the dangerous-tools flag is supplied. The snapshot tool writes a snapshot beneath the Prometheus TSDB data directory. Response truncation may omit data when configured, while TOON output may not be more efficient for every response shape.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Prometheus MCP Server

prometheus-mcp-server is an MCP server that connects AI clients to a running Prometheus instance through its HTTP API. Its main tools execute instant and range PromQL queries, inspect metrics, labels, targets, alerts, rules, configuration, runtime details, and health, while also exposing Prometheus documentation and operational runbooks.

Enable them by starting the server with `--dangerous.enable-tsdb-admin-tools`. This exposes tools for cleaning tombstones, deleting selected series over a time range, and creating a TSDB snapshot. These tools are disabled by default because some operations can delete data or affect on-disk state.

Pass one or more `--mcp.tools` options when starting the server, such as `prometheus-mcp --mcp.tools=build_info --mcp.tools=flags --mcp.tools=runtime_info`. The selected tools are added to the core set, which always includes query, range-query, metric, label, series, documentation, and runbook tools.

Yes. It supports response truncation by limiting returned lines or entries, and it can encode API responses using TOON. Truncation is disabled by default, and TOON may be more useful for uniform arrays than for complex or irregular responses.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPrometheus MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/prometheus-mcp-server?style=directory)](https://allmcps.com/mcp/prometheus-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/prometheus-mcp-server"><img src="https://allmcps.com/api/badge/prometheus-mcp-server?style=directory" alt="Prometheus MCP Server on AllMCPs" /></a>