{"id":26570843,"url":"https://github.com/pab1it0/prometheus-mcp-server","last_synced_at":"2026-05-01T21:05:20.410Z","repository":{"id":283328181,"uuid":"951416232","full_name":"pab1it0/prometheus-mcp-server","owner":"pab1it0","description":"A Model Context Protocol (MCP) server that enables AI agents and LLMs to query and analyze Prometheus metrics through standardized interfaces.","archived":false,"fork":false,"pushed_at":"2026-04-25T08:23:08.000Z","size":2656,"stargazers_count":424,"open_issues_count":9,"forks_count":87,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-04-25T10:23:07.047Z","etag":null,"topics":["ai","devops","llm","mcp","model-context-protocol","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pab1it0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-19T16:36:09.000Z","updated_at":"2026-04-25T08:22:45.000Z","dependencies_parsed_at":"2025-04-13T21:26:44.756Z","dependency_job_id":"3c711411-03b9-49eb-b5ce-e34741bfc412","html_url":"https://github.com/pab1it0/prometheus-mcp-server","commit_stats":null,"previous_names":["pab1it0/prometheus-mcp-server"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/pab1it0/prometheus-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pab1it0%2Fprometheus-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pab1it0%2Fprometheus-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pab1it0%2Fprometheus-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pab1it0%2Fprometheus-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pab1it0","download_url":"https://codeload.github.com/pab1it0/prometheus-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pab1it0%2Fprometheus-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","devops","llm","mcp","model-context-protocol","prometheus"],"created_at":"2025-03-22T22:19:18.207Z","updated_at":"2026-05-01T21:05:20.397Z","avatar_url":"https://github.com/pab1it0.png","language":"Python","funding_links":[],"categories":["Monitoring \u0026 Observability","Databases","Monitoring","📚 Projects (1974 total)","Community Servers","MCP 服务器精选列表","Legend","پیاده‌سازی‌های سرور","🤖 AI/ML","Servers","Cloud Services","📊 Monitoring \u0026 Observability","Table of Contents","MCP Servers","🗂️ Extensions by Category","🏗️ Infrastructure, Utils \u0026 Orchestration","Uncategorized"],"sub_categories":["📊 Metrics \u0026 Monitoring","Time-Series \u0026 Metrics","MCP Servers","🗄️ 数据库交互","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eپایگاه‌های داده","Monitoring \u0026 Observability","How to Submit","AI Services","Cloud \u0026 DevOps","📊 Analytics","⚙️ Infrastructure Analysis (Monitoring)","Uncategorized"],"readme":"# Prometheus MCP Server\n\n[![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)\n[![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)\n[![GitHub Release](https://img.shields.io/github/v/release/pab1it0/prometheus-mcp-server)](https://github.com/pab1it0/prometheus-mcp-server/releases)\n[![Codecov](https://codecov.io/gh/pab1it0/prometheus-mcp-server/branch/main/graph/badge.svg)](https://codecov.io/gh/pab1it0/prometheus-mcp-server)\n![Python](https://img.shields.io/badge/python-3.10%2B-blue)\n[![License](https://img.shields.io/github/license/pab1it0/prometheus-mcp-server)](https://github.com/pab1it0/prometheus-mcp-server/blob/main/LICENSE)\n\nGive AI assistants the power to query your Prometheus metrics.\n\nA [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.\n\n[mcp]: https://modelcontextprotocol.io\n\n## Getting Started\n\n### Prerequisites\n\n- Prometheus server accessible from your environment\n- MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)\n\n### Installation Methods\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Desktop\u003c/b\u003e\u003c/summary\u003e\n\nAdd to your Claude Desktop configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"prometheus\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\",\n        \"--rm\",\n        \"-e\",\n        \"PROMETHEUS_URL\",\n        \"ghcr.io/pab1it0/prometheus-mcp-server:latest\"\n      ],\n      \"env\": {\n        \"PROMETHEUS_URL\": \"\u003cyour-prometheus-url\u003e\"\n      }\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Code\u003c/b\u003e\u003c/summary\u003e\n\nInstall via the Claude Code CLI:\n\n```bash\nclaude mcp add prometheus --env PROMETHEUS_URL=http://your-prometheus:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latest\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eVS Code / Cursor / Windsurf\u003c/b\u003e\u003c/summary\u003e\n\nAdd to your MCP settings in the respective IDE:\n\n```json\n{\n  \"prometheus\": {\n    \"command\": \"docker\",\n    \"args\": [\n      \"run\",\n      \"-i\",\n      \"--rm\",\n      \"-e\",\n      \"PROMETHEUS_URL\",\n      \"ghcr.io/pab1it0/prometheus-mcp-server:latest\"\n    ],\n    \"env\": {\n      \"PROMETHEUS_URL\": \"\u003cyour-prometheus-url\u003e\"\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDocker Desktop\u003c/b\u003e\u003c/summary\u003e\n\nThe easiest way to run the Prometheus MCP server is through Docker Desktop:\n\n\u003ca href=\"https://hub.docker.com/open-desktop?url=https://open.docker.com/dashboard/mcp/servers/id/prometheus/config?enable=true\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/+%20Add%20to-Docker%20Desktop-2496ED?style=for-the-badge\u0026logo=docker\u0026logoColor=white\" alt=\"Add to Docker Desktop\" /\u003e\n\u003c/a\u003e\n\n1. **Via MCP Catalog**: Visit the [Prometheus MCP Server on Docker Hub](https://hub.docker.com/mcp/server/prometheus/overview) and click the button above\n\n2. **Via MCP Toolkit**: Use Docker Desktop's MCP Toolkit extension to discover and install the server\n\n3. Configure your connection using environment variables (see Configuration Options below)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eManual Docker Setup\u003c/b\u003e\u003c/summary\u003e\n\nRun directly with Docker:\n\n```bash\n# With environment variables\ndocker run -i --rm \\\n  -e PROMETHEUS_URL=\"http://your-prometheus:9090\" \\\n  ghcr.io/pab1it0/prometheus-mcp-server:latest\n\n# With authentication\ndocker run -i --rm \\\n  -e PROMETHEUS_URL=\"http://your-prometheus:9090\" \\\n  -e PROMETHEUS_USERNAME=\"admin\" \\\n  -e PROMETHEUS_PASSWORD=\"password\" \\\n  ghcr.io/pab1it0/prometheus-mcp-server:latest\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eHelm Chart (Kubernetes)\u003c/b\u003e\u003c/summary\u003e\n\nDeploy to Kubernetes using the Helm chart from the OCI registry:\n\n```bash\nhelm install prometheus-mcp-server \\\n  oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \\\n  --version 1.0.0 \\\n  --set prometheus.url=\"http://prometheus:9090\"\n```\n\nWith authentication:\n\n```bash\nhelm install prometheus-mcp-server \\\n  oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \\\n  --version 1.0.0 \\\n  --set prometheus.url=\"http://prometheus:9090\" \\\n  --set auth.username=\"admin\" \\\n  --set auth.password=\"secret\"\n```\n\nWith a custom values file:\n\n```bash\nhelm install prometheus-mcp-server \\\n  oci://ghcr.io/pab1it0/charts/prometheus-mcp-server \\\n  --version 1.0.0 \\\n  -f values.yaml\n```\n\nSee the [chart values](charts/prometheus-mcp-server/values.yaml) for all available configuration options.\n\u003c/details\u003e\n\n### Configuration Options\n\n| Variable | Description | Required |\n|----------|-------------|----------|\n| `PROMETHEUS_URL` | URL of your Prometheus server | Yes |\n| `PROMETHEUS_URL_SSL_VERIFY` | Set to False to disable SSL verification | No |\n| `PROMETHEUS_DISABLE_LINKS` | Set to True to disable Prometheus UI links in query results (saves context tokens) | No |\n| `PROMETHEUS_REQUEST_TIMEOUT` | Request timeout in seconds to prevent hanging requests (DDoS protection) | No (default: 30) |\n| `PROMETHEUS_USERNAME` | Username for basic authentication | No |\n| `PROMETHEUS_PASSWORD` | Password for basic authentication | No |\n| `PROMETHEUS_TOKEN` | Bearer token for authentication | No |\n| `PROMETHEUS_CLIENT_CERT` | Path to client certificate file for mutual TLS authentication | No |\n| `PROMETHEUS_CLIENT_KEY` | Path to client private key file for mutual TLS authentication | No |\n| `REQUESTS_CA_BUNDLE` | Path to CA bundle file for verifying the server's TLS certificate (standard `requests` library env var) | No |\n| `ORG_ID` | Organization ID for multi-tenant setups | No |\n| `PROMETHEUS_MCP_SERVER_TRANSPORT` | Transport mode (stdio, http, sse) | No (default: stdio) |\n| `PROMETHEUS_MCP_BIND_HOST` | Host for HTTP transport | No (default: 127.0.0.1) |\n| `PROMETHEUS_MCP_BIND_PORT` | Port for HTTP transport | No (default: 8080) |\n| `PROMETHEUS_MCP_STATELESS_HTTP` | Enable stateless HTTP mode for multi-replica support | No (default: False) |\n| `PROMETHEUS_CUSTOM_HEADERS` | Custom headers as JSON string | No |\n| `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 |\n\n## Available Tools\n\n| Tool | Category | Description |\n| --- | --- | --- |\n| `health_check` | System | Health check endpoint for container monitoring and status verification |\n| `execute_query` | Query | Execute a PromQL instant query against Prometheus |\n| `execute_range_query` | Query | Execute a PromQL range query with start time, end time, and step interval |\n| `list_metrics` | Discovery | List all available metrics in Prometheus with pagination and filtering support |\n| `get_metric_metadata` | Discovery | Get metadata for one metric or bulk metadata with optional filtering |\n| `get_targets` | Discovery | Get information about all scrape targets |\n\nThe 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.\n\n## Features\n\n- Execute PromQL queries against Prometheus\n- Discover and explore metrics\n  - List available metrics\n  - Get metadata for specific metrics\n  - Search metric metadata by name or description in a single call\n  - View instant query results\n  - View range query results with different step intervals\n- Authentication support\n  - Basic auth from environment variables\n  - Bearer token auth from environment variables\n- Docker containerization support\n- Provide interactive tools for AI assistants\n\n## Development\n\nContributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for detailed information on how to get started, coding standards, and the pull request process.\n\nThis project uses [`uv`](https://github.com/astral-sh/uv) to manage dependencies. Install `uv` following the instructions for your platform:\n\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\nYou can then create a virtual environment and install the dependencies with:\n\n```bash\nuv venv\nsource .venv/bin/activate  # On Unix/macOS\n.venv\\Scripts\\activate     # On Windows\nuv pip install -e .\n```\n\n### Testing\n\nThe project includes a comprehensive test suite that ensures functionality and helps prevent regressions.\n\nRun the tests with pytest:\n\n```bash\n# Install development dependencies\nuv pip install -e \".[dev]\"\n\n# Run the tests\npytest\n\n# Run with coverage report\npytest --cov=src --cov-report=term-missing\n```\n\nWhen adding new features, please also add corresponding tests.\n\n## License\n\nMIT\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpab1it0%2Fprometheus-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpab1it0%2Fprometheus-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpab1it0%2Fprometheus-mcp-server/lists"}