pmcp
Enables natural language interactions with Prometheus metrics through instant queries, range queries, metadata discovery, alert management, configuration access, and administrative operations like snapshots and health checks.
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., "@pmcpshow me the CPU usage for the last hour"
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
A Go-based MCP server that exposes Prometheus query capabilities via the Model Context Protocol.
Installation
go install github.com/yshngg/prometheus-mcp-server@latestOr pull the Docker image:
docker pull ghcr.io/yshngg/prometheus-mcp-server:latestRelated MCP server: grafana-mcp-analyzer
Usage
prometheus-mcp-server --prom-addr="http://localhost:9090"Flags
Flag | Default | Description |
|
| Prometheus server URL |
|
| MCP server listen address |
|
|
|
| `` | Bearer token for MCP endpoint authentication (optional) |
| Print version |
Environment Variables
All flags can be set via environment variables: PROM_ADDR, MCP_ADDR, TRANSPORT, AUTH_TOKEN.
MCP Client Configuration
Add the following config to your MCP client:
{
"mcpServers": {
"prometheus": {
"command": "prometheus-mcp-server",
"args": ["--prom-addr", "http://localhost:9090"]
}
}
}Install the binary viago install github.com/yshngg/prometheus-mcp-server@latest or pull the Docker image with docker pull ghcr.io/yshngg/prometheus-mcp-server:latest.
If you don't have the binary installed, use Docker:
{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"ghcr.io/yshngg/prometheus-mcp-server:latest",
"--prom-addr",
"http://host.docker.internal:9090"
]
}
}
}Client-specific configuration
Add to claude_desktop_config.json:
{
"mcpServers": {
"prometheus": {
"command": "prometheus-mcp-server",
"args": ["--prom-addr", "http://localhost:9090"]
}
}
}With Docker:
{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"ghcr.io/yshngg/prometheus-mcp-server:latest",
"--prom-addr",
"http://host.docker.internal:9090"
]
}
}
}Add to opencode.json (guide):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"prometheus": {
"type": "local",
"command": [
"prometheus-mcp-server",
"--prom-addr",
"http://localhost:9090"
]
}
}
}Run the server with HTTP transport:
prometheus-mcp-server --transport=http --mcp-addr="localhost:8080"Then configure your client to use http://localhost:8080/mcp.
For authenticated access, set AUTH_TOKEN:
AUTH_TOKEN=my-token prometheus-mcp-server --transport=httpYour client must then include Authorization: Bearer my-token in requests to /mcp.
Tools
Expression: instant_query, range_query
Metadata: find_series_by_labels, list_label_names, list_label_values, target_metadata_query, metric_metadata_query
Discovery: target_discovery, alert_query, rule_query, alertmanager_discovery
TSDB Admin: tsdb_snapshot, delete_series, clean_tombstones
Management: health_check, readiness_check, reload, quit
Resources
The server exposes Prometheus data as URI-addressable resources under the prom:/// scheme:
URI | Description |
| Currently loaded configuration (YAML) |
| Command-line flag values |
| Runtime information |
| Build information |
| TSDB cardinality statistics |
| WAL replay state |
Resource Templates
URI templates for dynamic data access:
Template | Description |
| Instant PromQL query result |
| Label values for a given label name |
Prompts
Name | Arguments | Description |
|
| Lists all metric names in the Prometheus instance |
License
Apache License 2.0
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/yshngg/prometheus-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server