{"type":"mcp_server","name":"prometheus-mcp-server","description":"This repository provides a Model Context Protocol (MCP) server for Prometheus, enabling AI assistants to query and analyze Prometheus metrics through standardized interfaces. It supports PromQL execution, metric discovery, and authentication.","category":"System Tools","language":"Python","stars":487,"forks":0,"owner":"pab1it0","github_url":"https://github.com/pab1it0/prometheus-mcp-server","homepage":null,"setup":"## Setup\n\n1. Ensure your Prometheus server is accessible from the environment where you'll run this MCP server.\n\n2. Configure the environment variables for your Prometheus server, either through a `.env` file or system environment variables:\n\n```env\n# Required: Prometheus configuration\nPROMETHEUS_URL=http://your-prometheus-server:9090\n\n# Optional: Authentication credentials (if needed)\n# Choose one of the following authentication methods if required:\n\n# For basic auth\nPROMETHEUS_USERNAME=your_username\nPROMETHEUS_PASSWORD=your_password\n\n# For bearer token auth\nPROMETHEUS_TOKEN=your_token\n```\n\n3. Add the server configuration to your client configuration file. For example, for Claude Desktop:\n\n```json\n{\n  \"mcpServers\": {\n    \"prometheus\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"--directory\",\n        \"<full path to prometheus-mcp-server directory>\",\n        \"run\",\n        \"src/prometheus_mcp_server/main.py\"\n      ],\n      \"env\": {\n        \"PROMETHEUS_URL\": \"http://your-prometheus-server:9090\",\n        \"PROMETHEUS_USERNAME\": \"your_username\",\n        \"PROMETHEUS_PASSWORD\": \"your_password\"\n      }\n    }\n  }\n}\n```\n\n> Note: if you see `Error: spawn uv ENOENT` in Claude Desktop, you may need to specify the full path to `uv` or set the environment variable `NO_UV=1` in the configuration.\n\nFor Docker usage:\n\n1.  Build the Docker image using: `docker build -t prometheus-mcp-server .`\n2.  Run with Docker using `docker run` or `docker-compose` after creating a `.env` file with your Prometheus credentials.\n3.  To use with Claude Desktop, update the configuration to use Docker with the environment variables.","tools":"## Available Tools\n\n1. Execute PromQL queries against Prometheus.\n2. Discover and explore metrics including listing available metrics, getting metadata, viewing instant query results, and viewing range query results.\n3. Authentication support with basic auth and bearer token auth from environment variables.\n4. Docker containerization support.\n5. Provide interactive tools for AI assistants.\n6. `execute_query` (Execute a PromQL instant query against Prometheus)\n7. `execute_range_query` (Execute a PromQL range query with start time, end time, and step interval)\n8. `list_metrics` (List all available metrics in Prometheus)\n9. `get_metric_metadata` (Get metadata for a specific metric)\n10. `get_targets` (Get information about all scrape targets)","faq":null,"created_at":"2025-03-19T16:36:09+00:00","updated_at":"2025-03-28T05:53:30+00:00","source_url":"https://model-context-protocol.com/servers/prometheus-mcp-server-ai-metrics-analysis","related_articles":[]}