- Home
- MCP servers
- Prometheus Model Context Protocol Server
Prometheus Model Context Protocol Server
- go
3
GitHub Stars
go
Language
6 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": {
"yshngg-prometheus-mcp-server": {
"command": "prometheus-mcp-server",
"args": [
"--prom-addr",
"http://localhost:9090"
]
}
}
}You can use this Go-based MCP server to interact with Prometheus through natural language conversations. It provides a type-safe bridge that mirrors the Prometheus HTTP API, enabling you to query metrics, manage targets, and perform TSDB operations using MCP-compatible clients. This makes it easier to work with Prometheus data and configurations via conversational interfaces while preserving API compatibility.
How to use
Start the MCP server in stdio mode to connect with desktop MCP clients, or use HTTP transport for web-based integrations. You will interact with Prometheus data through natural language prompts that map to Prometheus API endpoints, such as instant and range queries, metadata discovery, and TSDB administration. Use plain language prompts to request metrics, series, labels, targets, and runtime information, and the server will handle the translation to Prometheus API calls.
How to install
Prerequisites you need before installing: Go toolchain (Go 1.23 or newer) and a running Prometheus server (v2.x). You may also use Docker for a quick setup.
# Prerequisites
go version
prometheus --version
# Install from source (build locally)
go install github.com/yshngg/prometheus-mcp-server@latest
# Ensure $GOPATH/bin is in your PATH
# Or build from source manually
# git clone https://github.com/yshngg/prometheus-mcp-server.git
# cd prometheus-mcp-server
# make build
If you prefer containerized deployment, you can run the pre-built image from the GitHub Container Registry. Use stdio transport for desktop clients or HTTP transport for web integrations.
# Pull the latest image
docker pull ghcr.io/yshngg/prometheus-mcp-server:latest
# Run with stdio transport (desktop clients)
docker run --rm ghcr.io/yshngg/prometheus-mcp-server:latest --prom-addr="http://host.docker.internal:9090"
# Run with HTTP transport (web integrations)
docker run --rm -p 8080:8080 ghcr.io/yshngg/prometheus-mcp-server:latest --prom-addr="http://host.docker.internal:9090" --transport=http --mcp-addr="0.0.0.0:8080"
Additional sections
Configuration notes. The server mirrors the Prometheus HTTP API so you can use the same patterns you are used to when querying and managing Prometheus data. You can choose between stdio and HTTP transports depending on your client needs. For desktop clients, stdio is typically the preferred option; for browser-based or server-to-server integrations, HTTP transport is recommended.
Security considerations. When exposing the MCP server over HTTP, ensure you secure access with appropriate network controls and, if needed, authentication layers or reverse proxy protections. Restrict the MCP port to trusted clients and monitor access patterns as you would with any API surface.
Operational notes. The server provides full compatibility with the Prometheus API, including instantaneous queries, range queries, metadata discovery, target management, and TSDB administration. It is designed as a Golang microservice with a modular structure and clear error propagation to help you build reliable MCP-based integrations.
Available tools
Instant Query
Evaluate an instant Prometheus query at a single point in time to retrieve the current value of a metric.
Range Query
Evaluate a Prometheus expression over a time range to retrieve historical data.
Find Series by Labels
Return a list of time series that match a given set of label filters.
List Label Names
List all label names available in the Prometheus dataset.
List Label Values
List all values for a specific label name across time series.
Target Discovery
Provide an overview of the current discovery state of scrape targets.
Target Metadata Query
Return metadata about metrics currently scraped by targets.
Metric Metadata Query
Return metadata about metrics currently scraped, without target information.
Alert Query
Return all active alerts from Prometheus alerting rules.
Rule Query
Return currently loaded recording and alerting rules.
Alertmanager Discovery
Offer an overview of the current Alertmanager discovery state.
Config
Retrieve the currently loaded configuration file.
Flags
Return the runtime flags with which Prometheus was started.
Runtime Information
Provide runtime information about the Prometheus server.
Build Information
Provide build details about the Prometheus server.
TSDB Stats
Return cardinality and TSDB-related statistics.
WAL Replay Stats
Provide information about WAL replay status.
TSDB Snapshot
Create a snapshot of the current TSDB data.
Delete Series
Delete data for a selection of time series within a time range.
Clean Tombstones
Remove deleted data and clean tombstones from storage.
Health Check
Check the health status of the Prometheus server.
Readiness Check
Check if Prometheus is ready to serve queries.
Reload
Trigger a reload of configuration and rule files.
Quit
Trigger a graceful shutdown of Prometheus.
All Available Metrics
Provide a complete list of metrics exposed by the Prometheus instance.