Prometheus MCP server
Last verified: 2026-09
Instant queries against Prometheus.
Community Cloud & infra Needs a secret Claude Desktop, Cursor, Windsurf, Claude Code
What it does
PromQL against a Prometheus (or compatible) URL. Instant queries, range queries, metric discovery, targets, health.
It sits in Cloud & infra: Most of these are admin APIs.
Good for
- execute_query with up or a PromQL you already trust.
- execute_range_query on a short window — huge ranges time out.
- list_metrics / get_targets when you do not remember the name.
- Point PROMETHEUS_URL at a read endpoint, not an admin proxy.
Tools
- health_check — Is the server up.
- execute_query / execute_range_query — PromQL.
- list_metrics / get_targets — Discovery.
Config (Claude Desktop / Cursor / Windsurf)
Paste the JSON below. Same mcpServers shape. Replace placeholder paths and secrets.
Windows paths look like C:\\Users\\you\\project, not /path/to.
Host-side steps →
Claude Desktop
| OS | Config file |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json
(usually C:\Users\<you>\AppData\Roaming\Claude\) |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Cursor
| Scope | macOS / Linux | Windows |
|---|---|---|
| This project | .cursor/mcp.json in the repo root | |
| This user | ~/.cursor/mcp.json |
%USERPROFILE%\.cursor\mcp.json |
Windsurf
| OS | Config file |
|---|---|
| macOS / Linux | ~/.codeium/windsurf/mcp_config.json |
| Windows | %USERPROFILE%\.codeium\windsurf\mcp_config.json |
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": [
"-y",
"prometheus-mcp-server"
],
"env": {
"PROMETHEUS_URL": "http://localhost:9090"
}
}
}
}
Windsurf remote MCP: use serverUrl instead of url if the block below is HTTP.
One-liner: npx -y prometheus-mcp-server
Secrets it wants: PROMETHEUS_URL
How to get started
- Point PROMETHEUS_URL at a read endpoint. Add token/basic auth if the instance needs it.
- Run a small instant query you already know (up).
- Range queries over huge windows will time out and load the server.
Access risk
Usually read-only. Still: query load on Prometheus and any secrets sitting in metric labels.
When to skip it
Skip it if Grafana already proxies the datasource, or if the metrics live only in Datadog.
Instead: Grafana, Datadog, Elasticsearch.
Vs alternatives
| Server | Official? | Needs a secret? | Best for |
|---|---|---|---|
| Prometheus | No | Yes | Instant queries against Prometheus. |
| Grafana | No | Yes | Dashboards and datasources. |
| Datadog | No | Yes | Metrics, logs, and monitors. |
| Elasticsearch | No | Yes | Search an Elasticsearch cluster. |
More in Cloud & infra
FAQ
Does it write?
Usually read-only PromQL. Risk is query load and secrets sitting in metric labels.
Prometheus or Grafana?
This talks to Prometheus (or compatible) directly. Grafana if you want dashboards and mixed datasources.
Auth?
Optional token/basic/client cert — see the repo. PROMETHEUS_URL is the minimum.
Can a query take down Prometheus?
Wide range queries can. Start with instant queries you already run.