prometheus_list_metricsLABSCO SUMMARY
Discovery first, which is what turns "write me a PromQL query" from a guess into a query.
The label and metric listing tools are why this is more than a query proxy: a model that cannot see your metric names and label values writes PromQL that returns an empty result set with no error to explain it. Everything is read-only and the three groups toggle independently, so giving an agent discovery without the ability to run expensive range queries is a supported configuration.
What it is
A Prometheus server exposing read-only tools in three groups: discovery of what exists, information about the server itself, and query execution.
What you get
- Discovery: prometheus_list_metrics for every metric name, prometheus_metric_metadata for one metric's metadata, prometheus_list_labels and prometheus_label_values for the label schema
- Targets: prometheus_list_targets for every scrape target, prometheus_scrape_pool_targets for the targets in one pool
- Queries: prometheus_query for an instant query, prometheus_query_range for a range with a start, an end and a resolution step
- Server information: prometheus_runtime_info and prometheus_build_info
- Each group can be switched off independently, so a deployment can expose discovery without queries or the reverse
- Every tool is marked read-only
Requirements
Node, and network access to a Prometheus server whose address you configure. It runs over stdio or HTTP, and a container image is published. It carries no credentials of its own — whatever protects your Prometheus still applies.
Setup effort
One command — npx prometheus-mcp@latest stdio
USE CASES
Writing a PromQL query against metrics you did not name
List the metric names and the label values first, then compose a query that can actually match.
Plotting a trend over an incident window
Run a range query bounded by a start and an end, at a resolution step you choose.
Finding out what stopped reporting
List the scrape targets and their status, then drill into the pool that looks wrong.
Understanding an unfamiliar metric
Read its metadata rather than inferring the unit and type from the name.
10 tools
Listed in project docs. Your client may show a different list.
prometheus_metric_metadataprometheus_list_labelsprometheus_label_valuesprometheus_list_targetsprometheus_scrape_pool_targetsprometheus_runtime_infoprometheus_build_infoprometheus_queryprometheus_query_rangeBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
- npx on PATH
- Node.js 20.19.0
INSTALLATION
Connect your client
Server setup
npx prometheus-mcp@latest stdioMCP Clients
VS Code
code --add-mcp '{"name":"prometheus","command":"npx","args":["prometheus-mcp@latest","stdio"],"env":{"PROMETHEUS_URL":"http://localhost:9090"}}'VS Code Insiders
code-insiders --add-mcp '{"name":"prometheus","command":"npx","args":["prometheus-mcp@latest","stdio"],"env":{"PROMETHEUS_URL":"http://localhost:9090"}}'Cursor, Windsurf, Claude Desktop
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": [
"prometheus-mcp@latest",
"stdio"
],
"env": {
"PROMETHEUS_URL": "http://localhost:9090"
}
}
}
}Any MCP client — Docker
{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"--pull=always",
"-e",
"PROMETHEUS_URL=http://host.docker.internal:9090",
"ghcr.io/idanfishman/prometheus-mcp",
"stdio"
]
}
}
}