# Prometheus MCP Server

Lets your AI agent talk to a running Prometheus over its API: run PromQL queries, inspect metrics, alerts and targets. Handy when a query is slow or you need a health check.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 127
- Author: prometheus
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/prometheus/prometheus-mcp
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/mcp/prometheus-prometheus-mcp-server

## What it does

The server connects to a running Prometheus instance and exposes its HTTP API to the agent. Tools hand back JSON that the model reads directly: `query` and `range_query` for instant and range queries, `series`, `label_names`, `label_values`, `metric_metadata` for labels and metrics, plus `list_alerts`, `list_rules`, `list_targets` and `tsdb_stats` for an overview. Official Prometheus docs are searchable too, through `docs_list`, `docs_read` and `docs_search`.

When context gets tight, you can switch API responses to TOON encoding or cap how many lines and entries come back. Truncation is off by default and `0` disables it; for supported tools the agent can override that global limit per call.

Management endpoints like `quit` and `reload` work out of the box. The TSDB Admin API, which can delete data, does not. To turn it on you start the server with `--dangerous.enable-tsdb-admin-tools`. Leave that flag off and the destructive calls stay out of reach, which is the safer default for most setups.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add prometheus-prometheus-mcp-server -- docker run -i --rm ghcr.io/tjhop/prometheus-mcp-server:0.18.0
```

### Codex

**Platform CLI**
```bash
codex mcp add prometheus-prometheus-mcp-server -- docker run -i --rm ghcr.io/tjhop/prometheus-mcp-server:0.18.0
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "prometheus-prometheus-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/tjhop/prometheus-mcp-server:0.18.0"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "prometheus-prometheus-mcp-server": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/tjhop/prometheus-mcp-server:0.18.0"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add prometheus-prometheus-mcp-server docker run -i --rm ghcr.io/tjhop/prometheus-mcp-server:0.18.0
```

## When to use it
- find out why a PromQL query is slow
- check active alerts and loaded rules
- see which targets Prometheus is scraping
- look up metrics and labels by matcher
- read TSDB cardinality and usage stats

## Example prompts
- Querying my metrics is slow, help me figure out why
- List the active alerts and the rules that are loaded
- Check the TSDB stats and point out high cardinality

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23643
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17160
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109

## Other versions with the same name
- [Prometheus MCP Server · pab1it0](https://affpapa.org/en/nevibecode/mcp/prometheus-mcp-server.md) — ★ 519

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
