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.
PMCP - Prometheus Model Context Protocol Server
🚀 A Model Context Protocol (MCP) server implementation for Prometheus that enables natural language interactions with Prometheus metrics and queries.
Table of Contents
Features
- Instant Query: Execute Prometheus queries at a specific point in time.
- Range Query: Retrieve historical metric data over defined time ranges.
- Metadata Query: Discover time series, label names, and label values.
- Transport Options: Support for HTTP, Server-Sent Events (SSE), and stdio.
- MCP Integration: Seamless communication with MCP-compatible clients.
Requirements
- Go 1.23.5 or higher
- A running Prometheus server (v2.x)
Installation
Install the pmcp
binary via go install
:
Ensure $GOPATH/bin
is in your $PATH
.
Usage
Run the server by specifying your Prometheus address and preferred transport:
Command Line Flags
Flag | Description | Default |
---|---|---|
-help | Show help information. | N/A |
-mcp-addr | Address for the MCP server to listen on. | localhost:8080 |
-prom-addr | Prometheus server URL. | http://localhost:9090 |
-transport | Communication transport (stdio , http , sse ). | stdio |
-version | Print version and exit. | N/A |
Binding Blocks
Tools
- Instant Query: Evaluate an instant query at a single point in time.
- Range Query: Evaluate an expression query over a range of time.
- Find Series by Labels: Return the list of time series that match a certain label set.
- List Label Names: Return a list of label names.
- List Label Values: Return a list of label values for a provided label name.
- Target Metadata Query: Return metadata about metrics currently scraped from targets.
- Metric Metadata Query: Return metadata about metrics currently scraped from targets. However, it does not provide any target information.
- Target Discovery: Return an overview of the current state of the Prometheus target discovery.
- Alert Query: Return a list of all active alerts.
- Rule Query: Return a list of alerting and recording rules that are currently loaded. In addition it returns the currently active alerts fired by the Prometheus instance of each alerting rule.
- Alertmanager Discovery: Return an overview of the current state of the Prometheus alertmanager discovery.
- Config: Return currently loaded configuration file.
- Flags: Return flag values that Prometheus was configured with.
- Runtime Information: Return various runtime information properties about the Prometheus server.
- Build Information: Return various build information properties about the Prometheus server.
- TSDB Stats: Return various cardinality statistics about the Prometheus TSDB.
- WAL Replay Stats: Return information about the WAL replay.
- TSDB Snapshot: Create a snapshot of all current data into snapshots/-.
- Delete Series: Delete data for a selection of series in a time range.
- Clean Tombstones: Remove the deleted data from disk and cleans up the existing tombstones.
- Health Check: Check Prometheus health.
- Readiness Check: Check if Prometheus is ready to serve traffic (i.e. respond to queries).
- Reload: Trigger a reload of the Prometheus configuration and rule files.
- Quit: Trigger a graceful shutdown of Prometheus.
Prompts
- All Available Metrics: Return a list of every metric exposed by the Prometheus instance.
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss improvements.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Acknowledgments
- Built with Model Context Protocol
- Powered by Prometheus
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
🚀 A Prometheus Model Context Protocol Server.
Related MCP Servers
- -securityAlicense-qualityMCP server for interacting with Prometheus metrics and data.Last updated -16JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides web content fetching and conversion capabilities.Last updated -47042JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides a scalable backend solution for efficient interaction with Medusa's data models through the JavaScript SDK.Last updated -24637TypeScriptMIT License
- -securityFlicense-qualityA tool that enables access to Prometheus metrics data through a Model Context Protocol server, allowing interaction with monitoring data using natural language.Last updated -Python