- Home
- MCP servers
- Prometheus
Prometheus
- go
0
GitHub Stars
go
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"jeanlopezxyz-mcp-prometheus": {
"command": "npx",
"args": [
"-y",
"mcp-prometheus@latest"
],
"env": {
"PROMETHEUS_URL": "http://localhost:9090"
}
}
}
}You will run a Model Context Protocol (MCP) server that integrates Prometheus data, enabling you to query Prometheus metrics and perform health checks from MCP-enabled clients. This server runs as a native Go binary and can connect to Prometheus either directly or through Kubernetes service proxies, giving you flexible deployment options across environments.
How to use
You can run the Prometheus MCP Server in two primary ways: via the npx convenience command or by executing the built binary locally. In all cases, you can point the server at Prometheus either directly with a URL or indirectly through Kubernetes service discovery. Once running, you can leverage the server’s queries and diagnostics from MCP clients to fetch metrics, evaluate targets, inspect resources, and diagnose cluster health.
How to install
Prerequisites you need before installation: Node.js and npm (to use npx), or you can build the Go binary locally if you prefer. Ensure you have access to a Prometheus instance or a Prometheus service exposed within your cluster.
# Option A: Run via npx (no local install required)
npx -y mcp-prometheus@latest
# Option B: Build and run the local binary
make build
./mcp-prometheus
Kubernetes/OpenShift auto-connect guidance
If you want automatic connection to Prometheus through the Kubernetes API, you can rely on the built‑in Kubernetes connectivity. The server can discover Prometheus using the default OpenShift/Kubernetes setup and connect without manual port-forwarding.
# Example MCP client config using npx for automatic connect (no explicit port forward)
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": ["-y", "mcp-prometheus@latest"]
}
}
}
Binary usage
You can also run the prebuilt Go binary directly after building from source. This is useful for environments without Node.js or npx available.
# Build and run the binary locally
make build
./mcp-prometheus
Available tools
query
Execute a PromQL instant query against Prometheus data.
queryRange
Execute a PromQL range query over a time interval.
getTargets
Retrieve the status of Prometheus scrape targets.
getRules
Fetch alerting and recording rules configured in Prometheus.
getPrometheusStatus
Return Prometheus server version and runtime information.
getClusterHealthOverview
Provide a comprehensive cluster health overview.
diagnoseNode
Diagnose health of a specific node in the cluster.
diagnoseNamespace
Diagnose health of a Kubernetes namespace.
getTopResourceConsumers
List top CPU/memory/network resource consumers.
investigatePod
Deeply investigate metrics and statuses for a specific pod.
compareTimeRanges
Compare metrics between two distinct time ranges.