prometheus
Prometheus MCP Server
claude mcp add --transport stdio brenoepics-prometheus-mcp docker run --rm -it brenoepics/prometheus-mcp:latest --mcp --prometheus-url http://host.docker.internal:9090
How to use
Prometheus MCP provides a set of MCP tools to query Prometheus from the command line or from MCP-compatible clients. It exposes instant queries, range queries, and metadata discovery utilities, as well as a small in-process cache and an optional internal metrics exporter. You can run it as a standard MCP server over stdio or use the included CLI inside a container or binary to interact with Prometheus in real time. Typical workflows include querying current metrics (instant queries), evaluating time-bound series (range queries), listing available metric names, fetching metric metadata, and exploring series selectors and label values to construct precise queries.
To use the CLI, run commands such as prometheus-mcp query, prometheus-mcp range, prometheus-mcp list-metrics, prometheus-mcp metadata, prometheus-mcp series, and prometheus-mcp label-values. You can also start an MCP server over stdio with --mcp, which enables MCP clients to feed requests directly through standard input/output. If you enable the internal metrics exporter, you can monitor MCP activity at /metrics on the configured port. When running via Docker or in CI, provide the Prometheus URL with --prometheus-url and, if needed, set authentication via the provided username/password options or environment variables.
This server is designed to be lightweight and easy to wire into existing MCP workflows. The discovery helpers (list metrics, metadata, and label values) are especially helpful when constructing dynamic queries in MCP clients or in automation that adapts to the target Prometheus deployment.
How to install
Prerequisites:
- Docker installed (recommended) or a local Rust toolchain if you want to build from source.
- Access to a running Prometheus instance you want to query.
Option A: Run via Docker (recommended for quick start)
-
Pull and run the image with MCP enabled: docker run --rm -it brenoepics/prometheus-mcp:latest --mcp --prometheus-url http://host.docker.internal:9090
Notes:
- Use http://localhost:9090 if Prometheus runs on the host and you’re not using Docker networking tricks.
- For Linux hosts, you may need --network host or proper host.docker.internal resolution as shown in the docs.
-
If you want to pass a different Prometheus URL: docker run --rm -it brenoepics/prometheus-mcp:latest --mcp --prometheus-url http://prometheus.example.com:9090
Option B: Build from source (Rust)
- Install Rust and cargo from https://rust-lang.org
- Build the binary:
cargo install prometheus-mcp
or from source: cargo build --release
- Run the binary directly: prometheus-mcp --mcp --prometheus-url http://localhost:9090
Option C: Prebuilt binaries
- Download the latest release for your OS/arch from the project releases page.
- Run the binary with the same flags as above (e.g., --mcp and --prometheus-url).
Prerequisites summary:
- Docker or Rust toolchain (cargo) or prebuilt binaries
- Access to a Prometheus instance
- Optional: authentication credentials if your Prometheus requires auth
Additional notes
- Environment variables supported by the server include PROMETHEUS_URL, PROMETHEUS_USERNAME, and PROMETHEUS_PASSWORD to configure the target Prometheus and basic auth.
- The internal metrics exporter (metrics-exporter) can be enabled to expose /metrics for MCP performance monitoring; you can set a custom port with --metrics-port.
- When running in Docker, you may need to adjust networking (host networking or --add-host) to reach Prometheus depending on your network setup.
- If your Prometheus is behind basic auth, use PROMETHEUS_USERNAME/PROMETHEUS_PASSWORD or the corresponding CLI flags to supply credentials.
- The MCP server can operate over stdio or as a standalone CLI; for scripts and automation, the stdio mode (--mcp) is often the most straightforward integration point.
Related MCP Servers
CoexistAI
CoexistAI is a modular, developer-friendly research assistant framework . It enables you to build, search, summarize, and automate research workflows using LLMs, web search, Reddit, YouTube, and mapping tools—all with simple MCP tool calls or API calls or Python functions.
Gitingest
mcp server for gitingest
zed -github
A GitHub MCP Server extension for Zed
turbovault
MCP server that transforms your Obsidian vault into an intelligent knowledge system
mcp-loxone
An opinionated Model Context Protocol (MCP) server for controlling Loxone home automation systems.
ultrafast
High-performance, ergonomic Model Context Protocol (MCP) implementation in Rust