{"_id":"@elad-nofy/prometheus-mcp","_rev":"2-e38776ebaf6afaa66656bd0d56547fac","name":"@elad-nofy/prometheus-mcp","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@elad-nofy/prometheus-mcp","version":"1.0.0","keywords":["mcp","prometheus","metrics","monitoring","model-context-protocol","claude","ai","observability"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/prometheus-mcp@1.0.0","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/prometheus-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/prometheus-mcp/issues"},"bin":{"prometheus-mcp":"dist/index.js"},"dist":{"shasum":"558fa4a7dc6ee8d646228c65a3abadb4ef43d504","tarball":"https://registry.npmjs.org/@elad-nofy/prometheus-mcp/-/prometheus-mcp-1.0.0.tgz","fileCount":39,"integrity":"sha512-OCsrqhl+ID//jkVkjv1iMkJ2q0oLyg7k4eYXLN6efERY52W1y/JbMc8uz45IlahLWrqzaKrs6DSOejcTZpG8gg==","signatures":[{"sig":"MEUCIFHL3cPH28fTKMXeh+ftsDIqy+MWhXBPofgHFDUutkb3AiEAglm/YpZM0Y2bO241TPviEojoBLikcxA+pGvtPvFyAec=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126439},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"dd031c53904670aaebb984ee8499d90d7d962c0f","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"elad-nofy","email":"nofy@elad-health.com"},"repository":{"url":"git+https://github.com/elad-nofy/prometheus-mcp.git","type":"git"},"_npmVersion":"10.9.4","description":"MCP server for Prometheus - Query metrics, targets, alerts, and more","directories":{},"_nodeVersion":"22.21.1","dependencies":{"zod":"^3.24.1","axios":"^1.7.9","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5"},"_npmOperationalInternal":{"tmp":"tmp/prometheus-mcp_1.0.0_1767812067077_0.20972064997490136","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@elad-nofy/prometheus-mcp","version":"1.1.0","description":"MCP server for Prometheus - Query metrics, targets, alerts, and more","main":"dist/index.js","type":"module","bin":{"prometheus-mcp":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsc --watch","prepublishOnly":"npm run build"},"keywords":["mcp","prometheus","metrics","monitoring","model-context-protocol","claude","ai","observability"],"author":{"name":"Nof Yonany"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/elad-nofy/prometheus-mcp.git"},"bugs":{"url":"https://github.com/elad-nofy/prometheus-mcp/issues"},"homepage":"https://github.com/elad-nofy/prometheus-mcp#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","axios":"^1.7.9","zod":"^3.24.1","zod-to-json-schema":"^3.25.1"},"devDependencies":{"@types/node":"^22.10.5","typescript":"^5.7.2"},"engines":{"node":">=18.0.0"},"gitHead":"e8e9c17c10b3c3844cd6d9cfe75205206fa59339","types":"./dist/index.d.ts","_id":"@elad-nofy/prometheus-mcp@1.1.0","_nodeVersion":"22.21.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-9twnp4JrTyZClncfiQiL1HmGFsgNmB7q8zn9L9gOelXKrJM0/kAFJ+FhQ530v9WfFNDZ4XxbnJ1kzV8iOFOtFw==","shasum":"c426fbca5994368f8ffb0aa550a18ad02b8f6dc5","tarball":"https://registry.npmjs.org/@elad-nofy/prometheus-mcp/-/prometheus-mcp-1.1.0.tgz","fileCount":39,"unpackedSize":126439,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@elad-nofy%2fprometheus-mcp@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCgpZirpgBCRE39/vaz50UlsasTN6r9fazY6hATWKAFKQIgO6FSUTIDsPWjaCgJUS+vqHwxy0UATjBuBd/BmKN6Hik="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7c6fc48b-207f-4792-9bf3-49266f936a0f"}},"directories":{},"maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prometheus-mcp_1.1.0_1767813346898_0.7842865101804652"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-07T18:54:26.664Z","modified":"2026-01-07T19:15:47.427Z","1.0.0":"2026-01-07T18:54:27.224Z","1.1.0":"2026-01-07T19:15:47.044Z"},"bugs":{"url":"https://github.com/elad-nofy/prometheus-mcp/issues"},"author":{"name":"Nof Yonany"},"license":"MIT","homepage":"https://github.com/elad-nofy/prometheus-mcp#readme","keywords":["mcp","prometheus","metrics","monitoring","model-context-protocol","claude","ai","observability"],"repository":{"type":"git","url":"git+https://github.com/elad-nofy/prometheus-mcp.git"},"description":"MCP server for Prometheus - Query metrics, targets, alerts, and more","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"readme":"# Prometheus MCP Server\n\nA **READ-ONLY** MCP (Model Context Protocol) server that connects AI assistants to Prometheus. Works with Claude Code CLI, VS Code AI extensions (Continue, Cline), Cursor, Amazon Q Developer, and any MCP-compatible client.\n\n## Features\n\n- **Health Monitoring**: Check target status, scrape health\n- **PromQL Queries**: Execute instant and range queries\n- **Metrics Discovery**: List and search available metrics\n- **Alerting**: View active alerts and alerting rules\n- **Exporter Helpers**: Pre-built queries for windows_exporter and blackbox_exporter\n\n## Prerequisites\n\n- Node.js 18 or higher\n- Prometheus server (accessible via HTTP API)\n\n## Installation\n\n### Option 1: npm (Recommended)\n\n```bash\nnpx @elad-nofy/prometheus-mcp@latest\n```\n\n### Option 2: Clone and Build\n\n```bash\ngit clone https://github.com/elad-nofy/prometheus-mcp.git\ncd prometheus-mcp\nnpm install\nnpm run build\n```\n\n## Configuration\n\n### Configure MCP Client\n\n#### Claude Code CLI\n\nAdd to your global settings (`~/.claude.json` on macOS/Linux, `%USERPROFILE%\\.claude.json` on Windows):\n\n**Windows:**\n```json\n{\n  \"mcpServers\": {\n    \"prometheus\": {\n      \"command\": \"cmd\",\n      \"args\": [\"/c\", \"npx\", \"@elad-nofy/prometheus-mcp\"],\n      \"env\": {\n        \"PROMETHEUS_URL\": \"http://your-prometheus-server:9090\"\n      }\n    }\n  }\n}\n```\n\n**macOS / Linux:**\n```json\n{\n  \"mcpServers\": {\n    \"prometheus\": {\n      \"command\": \"npx\",\n      \"args\": [\"@elad-nofy/prometheus-mcp\"],\n      \"env\": {\n        \"PROMETHEUS_URL\": \"http://your-prometheus-server:9090\"\n      }\n    }\n  }\n}\n```\n\n#### Amazon Q Developer\n\nAdd to `%USERPROFILE%\\.aws\\amazonq\\agents\\mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"prometheus\": {\n      \"command\": \"cmd\",\n      \"args\": [\"/c\", \"npx\", \"@elad-nofy/prometheus-mcp\"],\n      \"env\": {\n        \"PROMETHEUS_URL\": \"http://your-prometheus-server:9090\"\n      }\n    }\n  }\n}\n```\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `PROMETHEUS_URL` | Yes | Prometheus server URL (e.g., `http://prometheus:9090`) |\n| `PROMETHEUS_USERNAME` | No | Basic auth username |\n| `PROMETHEUS_PASSWORD` | No | Basic auth password |\n\n## Available Tools\n\n### Health & Targets\n| Tool | Description |\n|------|-------------|\n| `test_connection` | Test connection to Prometheus |\n| `list_targets` | List all scrape targets and health status |\n| `get_target_health` | Get health of specific target by job/instance |\n\n### Queries\n| Tool | Description |\n|------|-------------|\n| `query_instant` | Execute PromQL instant query (current value) |\n| `query_range` | Execute PromQL range query (time series) |\n| `query_windows_exporter` | Query Windows server metrics (CPU, memory, disk, network, services) |\n| `query_node_exporter` | Query Linux server metrics (CPU, memory, disk, network, load, filesystem) |\n| `query_blackbox_exporter` | Query endpoint probe results |\n\n### Metrics\n| Tool | Description |\n|------|-------------|\n| `list_metrics` | List all available metric names |\n| `get_metric_metadata` | Get metric type and help text |\n| `get_label_values` | Get all values for a label |\n| `find_series` | Find time series matching a selector |\n\n### Alerts & Rules\n| Tool | Description |\n|------|-------------|\n| `list_alerts` | List firing/pending alerts |\n| `get_alert_rules` | Get alerting rules and states |\n| `get_alert_history` | Query alert state changes over time |\n| `get_recording_rules` | Get recording rules (pre-computed queries) |\n\n### Status & Info\n| Tool | Description |\n|------|-------------|\n| `get_prometheus_status` | Get Prometheus version, runtime info, config, and flags |\n| `get_tsdb_status` | Get TSDB statistics (cardinality, memory usage, top metrics) |\n\n## Usage Examples\n\nOnce configured, you can ask your AI assistant questions like:\n\n- \"Are all Prometheus targets healthy?\"\n- \"Show me the CPU usage of server1 over the last hour\"\n- \"What alerts are currently firing?\"\n- \"List all metrics containing 'http'\"\n- \"Check the memory usage on my Windows servers\"\n- \"What's the load average on my Linux servers?\"\n- \"Is the website responding? Check blackbox_exporter\"\n- \"What version of Prometheus is running?\"\n- \"Show me the top metrics by cardinality\"\n- \"What recording rules are configured?\"\n\n### Example Queries\n\n**Check target health:**\n```\nWhat's the health status of all Prometheus targets?\n```\n\n**Query CPU usage:**\n```\nShow me the CPU usage on instance \"server1:9182\" for the last 30 minutes\n```\n\n**Find metrics:**\n```\nList all metrics related to HTTP requests\n```\n\n**Check alerts:**\n```\nAre there any firing alerts? Show me the details\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Watch mode\nnpm run dev\n```\n\n## Troubleshooting\n\n### Connection errors\n- Verify `PROMETHEUS_URL` is correct and accessible\n- Check if basic auth is required and credentials are correct\n- Ensure your network allows connection to the Prometheus server\n\n### Query errors\n- Verify the PromQL syntax is correct\n- Check if the metric exists using `list_metrics`\n- Ensure the time range is valid\n\n### No data returned\n- Verify the target is being scraped\n- Check if the metric has data for the requested time range\n- Use `list_targets` to verify scrape status\n\n## License\n\nMIT\n","readmeFilename":"README.md"}