Give AI assistants the power to query your Prometheus metrics. A [Model Context Protocol][mcp] (MCP) server that provides access to your Prometheus metrics and queries through standardized MCP interfaces, allowing AI assistants to execute PromQL queries and analyze your metrics data. [mcp]: https://modelcontextprotocol.io - Prometheus server accessible from your environment - MCP-compatible client
Add this skill
npx mdskills install pab1it0/prometheus-mcp-serverComprehensive MCP server with excellent documentation, multiple auth methods, and well-defined Prometheus tools
1# Prometheus MCP Server23[](https://github.com/users/pab1it0/packages/container/package/prometheus-mcp-server)4[](https://github.com/pab1it0/prometheus-mcp-server/releases)5[](https://codecov.io/gh/pab1it0/prometheus-mcp-server)67[](https://github.com/pab1it0/prometheus-mcp-server/blob/main/LICENSE)89Give AI assistants the power to query your Prometheus metrics.1011A [Model Context Protocol][mcp] (MCP) server that provides access to your Prometheus metrics and queries through standardized MCP interfaces, allowing AI assistants to execute PromQL queries and analyze your metrics data.1213[mcp]: https://modelcontextprotocol.io1415## Getting Started1617### Prerequisites1819- Prometheus server accessible from your environment20- MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)2122### Installation Methods2324<details>25<summary><b>Claude Desktop</b></summary>2627Add to your Claude Desktop configuration:2829```json30{31 "mcpServers": {32 "prometheus": {33 "command": "docker",34 "args": [35 "run",36 "-i",37 "--rm",38 "-e",39 "PROMETHEUS_URL",40 "ghcr.io/pab1it0/prometheus-mcp-server:latest"41 ],42 "env": {43 "PROMETHEUS_URL": "<your-prometheus-url>"44 }45 }46 }47}48```49</details>5051<details>52<summary><b>Claude Code</b></summary>5354Install via the Claude Code CLI:5556```bash57claude mcp add prometheus --env PROMETHEUS_URL=http://your-prometheus:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latest58```59</details>6061<details>62<summary><b>VS Code / Cursor / Windsurf</b></summary>6364Add to your MCP settings in the respective IDE:6566```json67{68 "prometheus": {69 "command": "docker",70 "args": [71 "run",72 "-i",73 "--rm",74 "-e",75 "PROMETHEUS_URL",76 "ghcr.io/pab1it0/prometheus-mcp-server:latest"77 ],78 "env": {79 "PROMETHEUS_URL": "<your-prometheus-url>"80 }81 }82}83```84</details>8586<details>87<summary><b>Docker Desktop</b></summary>8889The easiest way to run the Prometheus MCP server is through Docker Desktop:9091<a href="https://hub.docker.com/open-desktop?url=https://open.docker.com/dashboard/mcp/servers/id/prometheus/config?enable=true">92 <img src="https://img.shields.io/badge/+%20Add%20to-Docker%20Desktop-2496ED?style=for-the-badge&logo=docker&logoColor=white" alt="Add to Docker Desktop" />93</a>94951. **Via MCP Catalog**: Visit the [Prometheus MCP Server on Docker Hub](https://hub.docker.com/mcp/server/prometheus/overview) and click the button above96972. **Via MCP Toolkit**: Use Docker Desktop's MCP Toolkit extension to discover and install the server98993. Configure your connection using environment variables (see Configuration Options below)100101</details>102103<details>104<summary><b>Manual Docker Setup</b></summary>105106Run directly with Docker:107108```bash109# With environment variables110docker run -i --rm \111 -e PROMETHEUS_URL="http://your-prometheus:9090" \112 ghcr.io/pab1it0/prometheus-mcp-server:latest113114# With authentication115docker run -i --rm \116 -e PROMETHEUS_URL="http://your-prometheus:9090" \117 -e PROMETHEUS_USERNAME="admin" \118 -e PROMETHEUS_PASSWORD="password" \119 ghcr.io/pab1it0/prometheus-mcp-server:latest120```121</details>122123### Configuration Options124125| Variable | Description | Required |126|----------|-------------|----------|127| `PROMETHEUS_URL` | URL of your Prometheus server | Yes |128| `PROMETHEUS_URL_SSL_VERIFY` | Set to False to disable SSL verification | No |129| `PROMETHEUS_DISABLE_LINKS` | Set to True to disable Prometheus UI links in query results (saves context tokens) | No |130| `PROMETHEUS_REQUEST_TIMEOUT` | Request timeout in seconds to prevent hanging requests (DDoS protection) | No (default: 30) |131| `PROMETHEUS_USERNAME` | Username for basic authentication | No |132| `PROMETHEUS_PASSWORD` | Password for basic authentication | No |133| `PROMETHEUS_TOKEN` | Bearer token for authentication | No |134| `ORG_ID` | Organization ID for multi-tenant setups | No |135| `PROMETHEUS_MCP_SERVER_TRANSPORT` | Transport mode (stdio, http, sse) | No (default: stdio) |136| `PROMETHEUS_MCP_BIND_HOST` | Host for HTTP transport | No (default: 127.0.0.1) |137| `PROMETHEUS_MCP_BIND_PORT` | Port for HTTP transport | No (default: 8080) |138| `PROMETHEUS_CUSTOM_HEADERS` | Custom headers as JSON string | No |139| `TOOL_PREFIX` | Prefix for all tool names (e.g., `staging` results in `staging_execute_query`). Useful for running multiple instances targeting different environments in Cursor | No |140141## Available Tools142143| Tool | Category | Description |144| --- | --- | --- |145| `health_check` | System | Health check endpoint for container monitoring and status verification |146| `execute_query` | Query | Execute a PromQL instant query against Prometheus |147| `execute_range_query` | Query | Execute a PromQL range query with start time, end time, and step interval |148| `list_metrics` | Discovery | List all available metrics in Prometheus with pagination and filtering support |149| `get_metric_metadata` | Discovery | Get metadata for one metric or bulk metadata with optional filtering |150| `get_targets` | Discovery | Get information about all scrape targets |151152The 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.153154## Features155156- Execute PromQL queries against Prometheus157- Discover and explore metrics158 - List available metrics159 - Get metadata for specific metrics160 - Search metric metadata by name or description in a single call161 - View instant query results162 - View range query results with different step intervals163- Authentication support164 - Basic auth from environment variables165 - Bearer token auth from environment variables166- Docker containerization support167- Provide interactive tools for AI assistants168169## Development170171Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for detailed information on how to get started, coding standards, and the pull request process.172173This project uses [`uv`](https://github.com/astral-sh/uv) to manage dependencies. Install `uv` following the instructions for your platform:174175```bash176curl -LsSf https://astral.sh/uv/install.sh | sh177```178179You can then create a virtual environment and install the dependencies with:180181```bash182uv venv183source .venv/bin/activate # On Unix/macOS184.venv\Scripts\activate # On Windows185uv pip install -e .186```187188### Testing189190The project includes a comprehensive test suite that ensures functionality and helps prevent regressions.191192Run the tests with pytest:193194```bash195# Install development dependencies196uv pip install -e ".[dev]"197198# Run the tests199pytest200201# Run with coverage report202pytest --cov=src --cov-report=term-missing203```204205When adding new features, please also add corresponding tests.206207## License208209MIT210211---212
Full transparency — inspect the skill content before installing.