The Prometheus MCP Server provides a Model Context Protocol (MCP) interface for AI assistants to interact with Prometheus metrics data. You can:
Execute PromQL Queries: Run both instant queries and range queries (with specified time ranges and step intervals)
Discover Metrics: List all available metrics and retrieve metadata for specific metrics
Get Scrape Targets: Retrieve information about all configured scrape targets
Authentication Support: Connect using Basic or Bearer token authentication
Docker Deployment: Easily deploy and run using Docker or Docker Compose
Configurable Tools: Customize available tools to optimize context window usage
Provides access to Prometheus metrics and queries, allowing execution of PromQL queries, metrics discovery and exploration, viewing instant and range query results, and retrieving target information from a Prometheus server.
Prometheus MCP Server
A (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
The list of tools is configurable, so you can choose which tools you want to make available to the MCP client. This is useful if you don't use certain functionality or if you don't want to take up too much of the context window.
Related MCP server: Prometheus MCP Server
Getting Started
Prerequisites
Prometheus server accessible from your environment
MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)
Installation Methods
Add to your Claude Desktop configuration:
Install via the Claude Code CLI:
Add to your MCP settings in the respective IDE:
The easiest way to run the Prometheus MCP server is through Docker Desktop:
Via MCP Catalog: Visit the Prometheus MCP Server on Docker Hub and click the button above
Via MCP Toolkit: Use Docker Desktop's MCP Toolkit extension to discover and install the server
Configure your connection using environment variables (see Configuration Options below)
Run directly with Docker:
Configuration Options
Variable | Description | Required |
| URL of your Prometheus server | Yes |
| Set to False to disable SSL verification | No |
| Set to True to disable Prometheus UI links in query results (saves context tokens) | No |
| Username for basic authentication | No |
| Password for basic authentication | No |
| Bearer token for authentication | No |
| Organization ID for multi-tenant setups | No |
| Transport mode (stdio, http, sse) | No (default: stdio) |
| Host for HTTP transport | No (default: 127.0.0.1) |
| Port for HTTP transport | No (default: 8080) |
| Custom headers as JSON string | No |
Development
Contributions are welcome! Please see our Contributing Guide for detailed information on how to get started, coding standards, and the pull request process.
This project uses uv to manage dependencies. Install uv following the instructions for your platform:
You can then create a virtual environment and install the dependencies with:
Testing
The project includes a comprehensive test suite that ensures functionality and helps prevent regressions.
Run the tests with pytest:
When adding new features, please also add corresponding tests.
Tools
Tool | Category | Description |
| System | Health check endpoint for container monitoring and status verification |
| Query | Execute a PromQL instant query against Prometheus |
| Query | Execute a PromQL range query with start time, end time, and step interval |
| Discovery | List all available metrics in Prometheus with pagination and filtering support |
| Discovery | Get metadata for a specific metric |
| Discovery | Get information about all scrape targets |
License
MIT