Skip to content
Back to search

prometheus-mcp-server

A Model Context Protocol (MCP) server that enables AI agents and LLMs to query and analyze Prometheus metrics through standardized interfaces.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/pab1it0/prometheus-mcp-server with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/pab1it0/prometheus-mcp-server'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/pab1it0--prometheus-mcp-server/badge.svg)](/listings/pab1it0--prometheus-mcp-server)

HTML

<a href="/listings/pab1it0--prometheus-mcp-server"><img src="/api/listings/pab1it0--prometheus-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites

- Prometheus server accessible from your environment - MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)

Installation Methods

<details> <summary><b>Claude Desktop</b></summary>

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "prometheus": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PROMETHEUS_URL",
        "ghcr.io/pab1it0/prometheus-mcp-server:latest"
      ],
      "env": {
        "PROMETHEUS_URL": "<your-prometheus-url>"
      }
    }
  }
}

</details>

<details> <summary><b>Claude Code</b></summary>

Install via the Claude Code CLI:

claude mcp add prometheus --env PROMETHEUS_URL=http://your-prometheus:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latest

</details>

<details> <summary><b>VS Code / Cursor / Windsurf</b></summary>

Add to your MCP settings in the respective IDE:

{
  "prometheus": {
    "command": "docker",
    "args": [
      "run",
      "-i",
      "--rm",
      "-e",
      "PROMETHEUS_URL",
      "ghcr.io/pab1it0/prometheus-mcp-server:latest"
    ],
    "env": {
      "PROMETHEUS_URL": "<your-prometheus-url>"
    }
  }
}

</details>

<details> <summary><b>Docker Desktop</b></summary>

The easiest way to run the Prometheus MCP server is through Docker Desktop:

<a href="https://hub.docker.com/open-desktop?url=https://open.docker.com/dashboard/mcp/servers/id/prometheus/config?enable=true"> </a>

1. **Via MCP Catalog**: Visit the [Prometheus MCP Server on Docker Hub](https://hub.docker.com/mcp/server/prometheus/overview) and click the button above

2. **Via MCP Toolkit**: Use Docker Desktop's MCP Toolkit extension to discover and install the server

3. Configure your connection using environment variables (see Configuration Options below)

</details>

<details> <summary><b>Manual Docker Setup</b></summary>

Run directly with Docker:

# With environment variables
docker run -i --rm \
  -e PROMETHEUS_URL="http://your-prometheus:9090" \
  ghcr.io/pab1it0/prometheus-mcp-server:latest

# With authentication
docker run -i --rm \
  -e PROMETHEUS_URL="http://your-prometheus:9090" \
  -e PROMETHEUS_USERNAME="admin" \
  -e PROMETHEUS_PASSWORD="password" \
  ghcr.io/pab1it0/prometheus-mcp-server:latest

</details>

<details> <summary><b>Helm Chart (Kubernetes)</b></summary>

Deploy to Kubernetes using the Helm chart from the OCI registry:

helm install prometheus-mcp-server \
  oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \
  --version 1.1.1 \
  --set prometheus.url="http://prometheus:9090"

With authentication:

helm install prometheus-mcp-server \
  oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \
  --version 1.1.1 \
  --set prometheus.url="http://prometheus:9090" \
  --set auth.username="admin" \
  --set auth.password="secret"

With a custom values file:

helm install prometheus-mcp-server \
  oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \
  --version 1.1.1 \
  -f values.yaml

See the [chart values](charts/prometheus-mcp-server/values.yaml) for all available configuration options. </details>

Configuration Options

| Variable | Description | Required | |----------|-------------|----------| | `PROMETHEUS_URL` | URL of your Prometheus server | Yes | | `PROMETHEUS_URL_SSL_VERIFY` | Set to False to disable SSL verification | No | | `PROMETHEUS_DISABLE_LINKS` | Set to True to disable Prometheus UI links in query results (saves context tokens) | No | | `PROMETHEUS_REQUEST_TIMEOUT` | Request timeout in seconds to prevent hanging requests (DDoS protection) | No (default: 30) | | `PROMETHEUS_USERNAME` | Username for basic authentication | No | | `PROMETHEUS_PASSWORD` | Password for basic authentication | No | | `PROMETHEUS_TOKEN` | Bearer token for authentication | No |

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 252 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Prometheus MCP Server
  2. [![GitHub Container Registry](https://img.shields.io/badge/ghcr.io-pab1it0%2Fprometheus--mcp--server-blue?logo=docker)](https://github.com/users/pab1it0/packages/container/package/prometheus-mcp-server)
  3. [![Helm Chart](https://img.shields.io/badge/helm%20chart-ghcr.io-blue?logo=helm)](https://github.com/pab1it0/prometheus-mcp-server/pkgs/container/charts%2Fprometheus-mcp-server)
  4. [![GitHub Release](https://img.shields.io/github/v/release/pab1it0/prometheus-mcp-server)](https://github.com/pab1it0/prometheus-mcp-server/releases)
  5. [![Codecov](https://codecov.io/gh/pab1it0/prometheus-mcp-server/branch/main/graph/badge.svg)](https://codecov.io/gh/pab1it0/prometheus-mcp-server)
  6. ![Python](https://img.shields.io/badge/python-3.10%2B-blue)
  7. [![License](https://img.shields.io/github/license/pab1it0/prometheus-mcp-server)](https://github.com/pab1it0/prometheus-mcp-server/blob/main/LICENSE)
  8. Give AI assistants the power to query your Prometheus metrics.
  9. 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.
  10. [mcp]: https://modelcontextprotocol.io
  11. ## Getting Started
  12. ### Prerequisites
  13. - Prometheus server accessible from your environment
  14. - MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)
  15. ### Installation Methods
  16. <details>
  17. <summary><b>Claude Desktop</b></summary>
  18. Add to your Claude Desktop configuration:
  19. ```json
  20. {
  21. "mcpServers": {
  22. "prometheus": {
  23. "command": "docker",
  24. "args": [
  25. "run",
  26. "-i",
  27. "--rm",
  28. "-e",
  29. "PROMETHEUS_URL",
  30. "ghcr.io/pab1it0/prometheus-mcp-server:latest"
  31. ],
  32. "env": {
  33. "PROMETHEUS_URL": "<your-prometheus-url>"
  34. }
  35. }
  36. }
  37. }
  38. ```
  39. </details>
  40. <details>
  41. <summary><b>Claude Code</b></summary>
  42. Install via the Claude Code CLI:
  43. ```bash
  44. claude mcp add prometheus --env PROMETHEUS_URL=http://your-prometheus:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latest
  45. ```
  46. </details>
  47. <details>
  48. <summary><b>VS Code / Cursor / Windsurf</b></summary>
  49. Add to your MCP settings in the respective IDE:
  50. ```json
  51. {
  52. "prometheus": {
  53. "command": "docker",
  54. "args": [
  55. "run",
  56. "-i",
  57. "--rm",
  58. "-e",
  59. "PROMETHEUS_URL",
  60. "ghcr.io/pab1it0/prometheus-mcp-server:latest"
  61. ],
  62. "env": {
  63. "PROMETHEUS_URL": "<your-prometheus-url>"
  64. }
  65. }
  66. }
  67. ```
  68. </details>
  69. <details>
  70. <summary><b>Docker Desktop</b></summary>
  71. The easiest way to run the Prometheus MCP server is through Docker Desktop:
  72. <a href="https://hub.docker.com/open-desktop?url=https://open.docker.com/dashboard/mcp/servers/id/prometheus/config?enable=true">
  73. <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" />
  74. </a>
  75. 1. **Via MCP Catalog**: Visit the [Prometheus MCP Server on Docker Hub](https://hub.docker.com/mcp/server/prometheus/overview) and click the button above
  76. 2. **Via MCP Toolkit**: Use Docker Desktop's MCP Toolkit extension to discover and install the server
  77. 3. Configure your connection using environment variables (see Configuration Options below)
  78. </details>
  79. <details>
  80. <summary><b>Manual Docker Setup</b></summary>
  81. Run directly with Docker:
  82. ```bash
  83. # With environment variables
  84. docker run -i --rm \
  85. -e PROMETHEUS_URL="http://your-prometheus:9090" \
  86. ghcr.io/pab1it0/prometheus-mcp-server:latest
  87. # With authentication
  88. docker run -i --rm \
  89. -e PROMETHEUS_URL="http://your-prometheus:9090" \
  90. -e PROMETHEUS_USERNAME="admin" \
  91. -e PROMETHEUS_PASSWORD="password" \
  92. ghcr.io/pab1it0/prometheus-mcp-server:latest
  93. ```
  94. </details>
  95. <details>
  96. <summary><b>Helm Chart (Kubernetes)</b></summary>
  97. Deploy to Kubernetes using the Helm chart from the OCI registry:
  98. ```bash
  99. helm install prometheus-mcp-server \
  100. oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \
  101. --version 1.1.1 \
  102. --set prometheus.url="http://prometheus:9090"
  103. ```
  104. With authentication:
  105. ```bash
  106. helm install prometheus-mcp-server \
  107. oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \
  108. --version 1.1.1 \
  109. --set prometheus.url="http://prometheus:9090" \
  110. --set auth.username="admin" \
  111. --set auth.password="secret"
  112. ```
  113. With a custom values file:
  114. ```bash
  115. helm install prometheus-mcp-server \
  116. oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \
  117. --version 1.1.1 \
  118. -f values.yaml
  119. ```
  120. See the [chart values](charts/prometheus-mcp-server/values.yaml) for all available configuration options.
  121. </details>
  122. ### Configuration Options
  123. | Variable | Description | Required |
  124. |----------|-------------|----------|
  125. | `PROMETHEUS_URL` | URL of your Prometheus server | Yes |
  126. | `PROMETHEUS_URL_SSL_VERIFY` | Set to False to disable SSL verification | No |
  127. | `PROMETHEUS_DISABLE_LINKS` | Set to True to disable Prometheus UI links in query results (saves context tokens) | No |
  128. | `PROMETHEUS_REQUEST_TIMEOUT` | Request timeout in seconds to prevent hanging requests (DDoS protection) | No (default: 30) |
  129. | `PROMETHEUS_USERNAME` | Username for basic authentication | No |
  130. | `PROMETHEUS_PASSWORD` | Password for basic authentication | No |
  131. | `PROMETHEUS_TOKEN` | Bearer token for authentication | No |
  132. | `PROMETHEUS_CLIENT_CERT` | Path to client certificate file for mutual TLS authentication | No |
  133. | `PROMETHEUS_CLIENT_KEY` | Path to client private key file for mutual TLS authentication | No |
  134. | `REQUESTS_CA_BUNDLE` | Path to CA bundle file for verifying the server's TLS certificate (standard `requests` library env var) | No |
  135. | `ORG_ID` | Organization ID for multi-tenant setups | No |
  136. | `PROMETHEUS_MCP_SERVER_TRANSPORT` | Transport mode (stdio, http, sse) | No (default: stdio) |
  137. | `PROMETHEUS_MCP_BIND_HOST` | Host for HTTP transport | No (default: 127.0.0.1) |
  138. | `PROMETHEUS_MCP_BIND_PORT` | Port for HTTP transport | No (default: 8080) |
  139. | `PROMETHEUS_MCP_STATELESS_HTTP` | Enable stateless HTTP mode for multi-replica support | No (default: False) |
  140. | `PROMETHEUS_CUSTOM_HEADERS` | Custom headers as JSON string | No |
  141. | `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 |
  142. ## Available Tools
  143. | 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 scrape targets, with server-side `state`/`scrape_pool` filtering and optional pagination |
  151. 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.
  152. ## Features
  153. - Execute PromQL queries against Prometheus
  154. - Discover and explore metrics
  155. - List available metrics
  156. - Get metadata for specific metrics
  157. - Search metric metadata by name or description in a single call
  158. - View instant query results
  159. - View range query results with different step intervals
  160. - Open range query results in the Prometheus UI with the same time window and resolution
  161. - Authentication support
  162. - Basic auth from environment variables
  163. - Bearer token auth from environment variables
  164. - Docker containerization support
  165. - Provide interactive tools for AI assistants
  166. ## Development
  167. Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for detailed information on how to get started, coding standards, and the pull request process.
  168. This project uses [`uv`](https://github.com/astral-sh/uv) to manage dependencies. Install `uv` following the instructions for your platform:
  169. ```bash
  170. curl -LsSf https://astral.sh/uv/install.sh | sh
  171. ```
  172. You can then create a virtual environment and install the dependencies with:
  173. ```bash
  174. uv venv
  175. source .venv/bin/activate # On Unix/macOS
  176. .venv\Scripts\activate # On Windows
  177. uv pip install -e .
  178. ```
  179. ### Testing
  180. The project includes a comprehensive test suite that ensures functionality and helps prevent regressions.
  181. Run the tests with pytest:
  182. ```bash
  183. # Install development dependencies
  184. uv pip install -e ".[dev]"
  185. # Run the tests
  186. pytest
  187. # Run with coverage report
  188. pytest --cov=src --cov-report=term-missing
  189. ```
  190. When adding new features, please also add corresponding tests.
  191. ## License
  192. MIT
  193. ---

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.