
How to add Prometheus MCP Server to Cursor
Run PromQL queries and analyze Prometheus metrics from any MCP client. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 15, 2026 · 340★ · stdio · no auth
Cursor config for Prometheus MCP Server
uvx prometheus-mcp-server{
"mcpServers": {
"prometheus-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PROMETHEUS_URL",
"ghcr.io/pab1it0/prometheus-mcp-server:latest"
],
"env": {
"PROMETHEUS_URL": "<your-prometheus-url>"
}
}
}
}Requires Docker to be installed and running.
Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Prometheus MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Prometheus MCP Server's tools to confirm it's connected.
Before you start
- A reachable Prometheus server URL, set via the PROMETHEUS_URL environment variable
- Docker (recommended) — or Python 3.10+ with the uv package manager for a local install
- An MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)
- Optional credentials only if your Prometheus is secured: basic auth (PROMETHEUS_USERNAME/PASSWORD), bearer token (PROMETHEUS_TOKEN), mTLS client cert/key, or custom headers
What Prometheus MCP Server can do in Cursor
execute_queryRun an instant PromQL query at a single point in time
execute_range_queryRun a PromQL range query over a start/end time with a step
list_metricsList the metric names available in Prometheus
get_metric_metadataFetch metadata (type, help, unit) for a metric
get_targetsList scrape targets and their health/status
health_checkCheck connectivity and health of the configured Prometheus server
Security
Read access to Prometheus exposes all scraped infrastructure and application metrics; restrict network reachability to the Prometheus endpoint and set basic-auth credentials if the server is exposed. PromQL queries can be expensive, so consider rate limits on the upstream.
Prometheus MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Prometheus MCP Server config there under the "mcpServers" key and restart the client.
Is Prometheus MCP Server safe to use with Cursor?
Read access to Prometheus exposes all scraped infrastructure and application metrics; restrict network reachability to the Prometheus endpoint and set basic-auth credentials if the server is exposed. PromQL queries can be expensive, so consider rate limits on the upstream.
Does it require authentication to Prometheus?
Only if your Prometheus is secured. It works with no auth by default, and supports basic auth, bearer token, mutual TLS, and custom headers via environment variables.
Can it run remotely instead of as a local stdio process?
Yes. Besides the default stdio transport it can serve HTTP or SSE (default 127.0.0.1:8080), including a stateless HTTP mode suited to multi-replica/Kubernetes deployments.
How do I connect to more than one Prometheus?
Run multiple instances and set the TOOL_PREFIX environment variable on each so their tool names don't collide in the client.