Prometheus MCP Server
Provides tools for querying Prometheus metrics, including instant and range queries, scrape targets, alerting rules, cluster health diagnostics, node and namespace diagnosis, top resource consumers, and pod investigation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Prometheus MCP ServerWhat's the current CPU usage across all nodes?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Prometheus MCP Server (Go)
A Model Context Protocol (MCP) server for Prometheus integration. Native Go binary with built-in Kubernetes connectivity via client-go.
Installation
npx
npx -y mcp-prometheus@latestMCP Client Configuration
Add to your MCP client configuration (VS Code, Cursor, Windsurf, etc.):
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": ["-y", "mcp-prometheus@latest"],
"env": {
"PROMETHEUS_URL": "http://localhost:9090"
}
}
}
}VS Code
code --add-mcp '{"name":"prometheus","command":"npx","args":["-y","mcp-prometheus@latest"],"env":{"PROMETHEUS_URL":"http://localhost:9090"}}'Kubernetes Auto-Connect
Automatically connects to Prometheus running in OpenShift/Kubernetes via the K8S API service proxy. Uses native kubeconfig/in-cluster config via client-go. No kubectl or port-forwarding required.
Default: openshift-monitoring/prometheus-operated:9090
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": ["-y", "mcp-prometheus@latest"]
}
}
}Binary
Download from GitHub Releases or build from source:
make build
./mcp-prometheusRelated MCP server: Kubernetes MCP Server
Configuration
Environment Variables
Variable | Description |
| Direct Prometheus API URL (overrides K8S auto-connect) |
CLI Flags
Flag | Description | Default |
| Direct Prometheus URL | - |
| Kubernetes namespace |
|
| Kubernetes service name |
|
| Kubernetes service port |
|
| Service scheme (http/https) |
|
| Path to kubeconfig file | auto-detect |
Precedence: --url / PROMETHEUS_URL > K8S auto-connect
Connection strategy:
Direct URL (if
--urlorPROMETHEUS_URLis set)K8S API proxy (auto-detect kubeconfig or in-cluster config)
Tools (11)
Basic Queries
Tool | Description |
| Execute a PromQL instant query |
| Execute a PromQL range query over time |
| Get scrape targets status |
| Get alerting and recording rules |
| Get server version and runtime info |
Cluster Diagnostics
Tool | Description |
| Comprehensive cluster health overview |
| Diagnose a specific node's health |
| Diagnose a namespace's health |
Resource Analysis
Tool | Description |
| Top CPU/memory/network consumers |
| Deep investigation of a specific pod |
| Compare metrics between two time periods |
Example Prompts
"What's the current CPU usage across all nodes?"
"Show me the cluster health overview"
"Which pods are using the most memory?"
"Diagnose node worker-1"
"Are all scrape targets healthy?"
"Compare CPU usage now vs 24 hours ago"
"Investigate pod my-app in namespace production"
"What alerting rules are defined?"Development
Build
make build # Build for current platform
make build-all-platforms # Cross-compile for all platformsContainer
podman build -f Containerfile -t mcp-prometheus .Kubernetes / OpenShift Deployment
Container Image
The container image is available on GitHub Container Registry:
ghcr.io/jeanlopezxyz/mcp-prometheus:latestHelm Chart
Deploy using the included Helm chart:
# Add the chart repository (or use local chart)
helm upgrade --install mcp-prometheus ./charts/mcp-prometheus \
--namespace mcp-servers \
--create-namespace \
--set openshift=trueHelm Values
Parameter | Description | Default |
| Container registry |
|
| Image repository |
|
| Image tag |
|
| Enable OpenShift Routes |
|
| Service port |
|
| Prometheus namespace |
|
| Prometheus service name |
|
| Use cluster-reader role |
|
Example with custom Prometheus
helm upgrade --install mcp-prometheus ./charts/mcp-prometheus \
--namespace mcp-servers \
--set openshift=true \
--set prometheus.url=http://prometheus.monitoring:9090License
This server cannot be installed
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jeanlopezxyz/mcp-prometheus'
If you have feedback or need assistance with the MCP directory API, please join our Discord server