Prometheus MCP Server & Agent Plugin
An Agent Plugins v1.0.0 compliant Prometheus observability suite combining 6 Progressive-Disclosure Agent Skills (methodology, runbooks, and zero-network local CLI generators) with a focused 19-Tool / 11-Resource MCP Execution Server for Prometheus 3.0+, Thanos, Mimir, Cortex, and VictoriaMetrics.
Let your AI assistant work with Prometheus: write and run PromQL, check service health and SLOs, test alert rules, find expensive metrics, and set up scraping and exporters. Works with Prometheus, Thanos, Mimir, Cortex, and VictoriaMetrics.
What you get
- 19 MCP tools (13 read-only) that work against your live Prometheus setup
- 11 resources your assistant can read for context, under
prom:// - 6 Agent Skills: step-by-step playbooks that teach your assistant how to use the tools well
- Safe by default: write tools are on unless you pass
--read-only(the examples below do), and destructive actions still ask for confirmation
Quick start
You'll need:
- Python 3.12+ and uv, or Docker
- A Prometheus-compatible URL
- Optional: Kubernetes access for scrape configs and exporters
1. Add the server to your MCP client. For Claude Desktop, Cursor, Windsurf, and most other clients, add this to your MCP config file:
{
"mcpServers": {
"prometheus": {
"command": "uvx",
"args": [
"--from",
"talkops-prometheus-mcp-server",
"prometheus-mcp-server",
"--read-only"
],
"env": {
"PROMETHEUS_BASE_URL": "http://localhost:9090"
}
}
}
}
Using Claude Code? Run this instead:
claude mcp add prometheus -e PROMETHEUS_BASE_URL=http://localhost:9090 -- uvx --from talkops-prometheus-mcp-server prometheus-mcp-server --read-only
uvx downloads talkops-prometheus-mcp-server from PyPI and runs it, so there's nothing else to install. Prefer a normal install? Run pip install talkops-prometheus-mcp-server and use prometheus-mcp-server as the command.
Prefer Docker? Pull talkopsai/prometheus-mcp-server from Docker Hub—no Python setup needed:
{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_TRANSPORT=stdio",
"-e",
"PROMETHEUS_BASE_URL",
"talkopsai/prometheus-mcp-server:latest",
"--read-only"
],
"env": {
"PROMETHEUS_BASE_URL": "http://host.docker.internal:9090"
}
}
}
}
2. Restart your client and try asking:
- "What's the error rate and p99 latency for the
checkoutservice over the last hour?" - "Are we burning our SLO error budget for
payments?" - "Which metrics have the highest cardinality, and how do I reduce them?"
Allowing changes
Unlike the other TalkOps servers, Prometheus starts with write tools enabled (creating and deleting rule groups, scrape configs, and exporters). That's why the examples above pass --read-only. Remove it, or set MCP_ALLOW_WRITE=true, when you want your assistant to make changes.
Configuration
Set these as environment variables (the env block in your client config, or -e with docker run) or pass the matching flag.
| Variable | Flag | Default | What it does |
|---|---|---|---|
PROMETHEUS_BASE_URL |
--prometheus-url |
http://localhost:9090 |
Your Prometheus URL |
PROMETHEUS_AUTH_HEADER |
— | none | Authorization header, e.g. Bearer <token> |
PROMETHEUS_TENANT_ID |
--tenant-id |
none | Tenant (X-Scope-OrgID) for Mimir, Cortex, or Thanos |
PROMETHEUS_BACKENDS |
— | none | JSON list of several backends (replaces the single URL) |
MCP_ALLOW_WRITE |
--allow-write |
true |
Enable tools that change rules, scrape configs, and exporters |
MCP_READ_ONLY |
--read-only |
false |
Force read-only mode |
PROMETHEUS_TOOLSETS |
--toolsets |
all |
Limit tools: diagnostics, query, rules, scrape, exporter, readonly |
MCP_TRANSPORT |
--transport |
stdio |
stdio or http |
MCP_PORT |
--port |
8767 |
Port when using HTTP |
Run uvx --from talkops-prometheus-mcp-server prometheus-mcp-server --help to see every option.
Running over HTTP
To share one server between several clients or run it remotely, start it in HTTP mode with Docker or uvx:
# With Docker (starts in HTTP mode by default)
docker run --rm -p 8767:8767 \
-e PROMETHEUS_BASE_URL=http://host.docker.internal:9090 \
-e MCP_READ_ONLY=true \
talkopsai/prometheus-mcp-server:latest
# Or with uvx
MCP_TRANSPORT=http MCP_PORT=8767 uvx --from talkops-prometheus-mcp-server prometheus-mcp-server
Then point your client at http://localhost:8767/mcp:
{
"mcpServers": {
"prometheus": {
"url": "http://localhost:8767/mcp"
}
}
}
Agent Skills
Skills live in skills/. Each one is a SKILL.md playbook (plus optional references/ and offline scripts/) that teaches your AI assistant how to do a job safely, while the MCP server does the actual work. Tools are the hands, skills are the know-how.
To use them, copy the folders into your assistant's skills directory, for example:
git clone https://github.com/talkops-ai/talkops-mcp.git
cp -r talkops-mcp/src/prometheus-mcp-server/skills/* ~/.claude/skills/
This folder is also a portable Agent Plugin (plugin.json + mcp.json + skills/), so plugin-aware clients can load the server and skills together.
| Skill | Use it to |
|---|---|
triaging-prometheus-incidents-and-slos |
Triage incidents with RED/USE checks and SLO burn rates. |
authoring-promql-and-analyzing-metrics |
Find the right metrics and write correct PromQL. |
authoring-and-testing-prometheus-rules |
Write, test, and safely deploy alerting and recording rules. |
optimizing-tsdb-cardinality-and-finops |
Find costly, high-cardinality metrics and cut them down. |
configuring-prometheus-scraping-and-discovery |
Set up and fix ServiceMonitors, PodMonitors, Probes, and scrape configs. |
onboarding-exporters-and-instrumentation |
Pick, deploy, and verify exporters, and instrument your apps. |
Reference
All 19 tools
| Tool | Access | What it does |
|---|---|---|
prom_analyze_cardinality |
Read | Analyze TSDB series cardinality, label value fan-out, and rule usage shares. |
prom_analyze_service_red |
Read | Compute RED golden signals (Request Rate, Error Ratio, p50/p95/p99 Duration) supporting classic and Prometheus 3.0 Native Histograms plus trace exemplars. |
prom_apply_scrape_config |
Write | Create or update a ServiceMonitor, PodMonitor, Probe, ScrapeConfig CRD, or file_sd target group. |
prom_compare_periods |
Read | Compare a PromQL expression between a current window and a time-shifted baseline window. |
prom_delete_rule_group |
Write (destructive) | Delete a rule group from its owning PrometheusRule CRD, local YAML file, or HTTP Ruler namespace without clobbering sibling rule groups. |
prom_delete_scrape_config |
Write (destructive) | Delete a Kubernetes scrape CRD (ServiceMonitor, PodMonitor, Probe, ScrapeConfig) or file_sd file. |
prom_evaluate_slo_burn |
Read | Evaluate Google SRE multi-window multi-burn-rate error budget consumption (1h/5m, 6h/30m, 24h/2h, 72h/6h) in one call. |
prom_explore_metrics |
Read | Discover metric names, types, HELP text, per-job target metrics, label values, or matching series selectors. |
prom_get_diagnostics |
Read | Collect unified backend health, runtime info, WAL replay, TSDB stats, and target health. |
prom_get_firing_alerts |
Read | Inspect Prometheus's native rule evaluation state (/api/v1/alerts) and ALERTS_FOR_STATE flapping history. |
prom_install_exporter |
Write | Deploy a Prometheus exporter (Deployment/DaemonSet, Service, and ServiceMonitor) to Kubernetes. |
prom_query_exemplars |
Read | Fetch OpenTelemetry/Tempo trace exemplars (trace_id, span_id) attached to metric samples. |
prom_query_instant |
Read | Execute a point-in-time PromQL instant query (or validate_only=True preflight check) with semantic counter guardrails. |
prom_query_range |
Read | Execute a PromQL range query with auto-step sizing, per-series stats, and optional A2UI chart. |
prom_simulate_rule_firing |
Read | Simulate whether an alerting rule would fire (pending -> firing over for) on historical or synthetic data. |
prom_uninstall_exporter |
Write (destructive) | Remove a deployed Prometheus exporter (Deployment/DaemonSet, Service, and ServiceMonitor) from Kubernetes. |
prom_upsert_rule_group |
Write | Create or update a Prometheus rule group via k8s_crd, http_ruler, local_file, or yaml_only with non-destructive multi-group merge. |
prom_validate_rules |
Read | Validate a rule group via promtool check rules, structural hygiene checks, and optional promtool test rules. |
prom_verify_metrics_endpoint |
Read | Verify a /metrics HTTP endpoint and/or poll Prometheus until up{job=...} == 1.0. |
All 11 resources
| Resource | What it returns |
|---|---|
prom://audit/recent |
Recent MCP write and dry-run operations with outcomes and timestamps |
prom://config/runtime |
Sanitized runtime configuration: global settings, remote-write targets, and TSDB stats |
prom://kubernetes/scrape-crds |
Inventory of deployed Prometheus Operator CRDs across the cluster: ServiceMonitor, PodMonitor, Probe, ScrapeConfig, and PrometheusRule |
prom://metadata/catalog |
Catalog of metric names with type and HELP text, used to prevent metric name hallucination |
prom://rules/groups |
Snapshot of all alerting and recording rule groups across backends |
prom://system/backends |
List all known Prometheus-compatible backends and their health status |
prom://topology/targets |
Scrape target health summary grouped by job/service plus failing target endpoints |
prom://tsdb/cardinality |
TSDB cardinality overview and top-N high-cardinality metrics for FinOps |
prom://kubernetes/manifests/{kind}/{namespace}/{name} |
Live redacted Kubernetes CRD manifest for a specific ServiceMonitor, PodMonitor, Probe, ScrapeConfig, or PrometheusRule |
prom://rules/{backend_id}/groups/{group_name} |
Full definition and evaluation health of a specific rule group by backend_id and group_name |
prom://system/backends/{backend_id} |
Get detailed backend capabilities, runtime info, and health |
Development
git clone https://github.com/talkops-ai/talkops-mcp.git
cd talkops-mcp/src/prometheus-mcp-server
uv sync --dev
uv run pytest
uv run prometheus-mcp-server --help
Get help
License
Apache 2.0. See LICENSE.
Metadata
Release files for talkops-prometheus-mcp-server 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| talkops_prometheus_mcp_server-0.2.1.tar.gz | 236.6 kB | With provenance | Details for talkops_prometheus_mcp_server-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| talkops_prometheus_mcp_server-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for talkops_prometheus_mcp_server-0.2.1-py3-none-any.whl |
Total release size: 341.6 kB
Release files / talkops_prometheus_mcp_server-0.2.1.tar.gz
| Download URL | talkops_prometheus_mcp_server-0.2.1.tar.gz |
|---|---|
| Size | 236.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75e17de3ec41fdd9590acd2d630fb6b3056c0e2077b6208a003c3f4b22671488
|
|
BLAKE2b-256 checksum How to use checksums |
4fe508104302cbf9bd5f9572966fa9512b190f0f33c10aa106a22a9dd8782652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / talkops_prometheus_mcp_server-0.2.1-py3-none-any.whl
| Download URL | talkops_prometheus_mcp_server-0.2.1-py3-none-any.whl |
|---|---|
| Size | 105.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23561ecc840ee619bf238944d8fa3f2e0560a7abcf5217f26708067d2e6a8c7c
|
|
BLAKE2b-256 checksum How to use checksums |
cce3be66fca9916a48ca28242c49c2fac79cbe2dd4fc7b5321af0e7ecb66a42f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for talkops-prometheus-mcp-server 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for talkops_prometheus_mcp_server-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.