Query and analyze Prometheus - open-source monitoring system.
Documentation
Prometheus MCP Server
A Model Context Protocol (MCP) server for Prometheus. This provides access to your Prometheus metrics and queries through standardized MCP interfaces, allowing AI assistants to execute PromQL queries and analyze your metrics data.
Features
Execute PromQL queries against Prometheus
Discover and explore metrics
List available metrics
Get metadata for specific metrics
View instant query results
View range query results with different step intervals
Authentication support
Basic auth from environment variables
Bearer token auth from environment variables
Docker containerization support
Provide interactive tools for AI assistants
Usage
Ensure your Prometheus server is accessible from the environment where you'll run this MCP server.
Configure the environment variables for your Prometheus server, either through a .env file or system environment variables:
PROMETHEUS_URL=http://your-prometheus-server:9090\n\n# Optional: Authentication credentials (if needed)\n\n# Choose one of the following authentication methods if required:\n\n# For basic auth
PROMETHEUS_USERNAME=your_username
PROMETHEUS_PASSWORD=your_password\n\n# For bearer token auth
PROMETHEUS_TOKEN=your_token\n\n# Optional: For multi-tenant setups like Cortex, Mimir or Thanos
ORG_ID=your_organization_id
Add the server configuration to your client configuration file. For example, for Claude Desktop:
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements. This project uses uv to manage dependencies. Install uv following the instructions for your platform:
curl -LsSf https://astral.sh/uv/install.sh | sh
You can then create a virtual environment and install the dependencies with:
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
uv pip install -e .
Project Structure
The project has been organized with a src directory structure: