Home / MCP / Prometheus MCP Server
Provides access to Prometheus metrics and queries via MCP interfaces for AI assistants.
Configuration
View docs{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PROMETHEUS_URL",
"ghcr.io/pab1it0/prometheus-mcp-server:latest"
],
"env": {
"PROMETHEUS_URL": "<your-prometheus-url>",
"PROMETHEUS_URL_SSL_VERIFY": "False",
"PROMETHEUS_DISABLE_LINKS": "true",
"PROMETHEUS_USERNAME": "admin",
"PROMETHEUS_PASSWORD": "password",
"PROMETHEUS_TOKEN": "<token>",
"ORG_ID": "org-123",
"PROMETHEUS_MCP_SERVER_TRANSPORT": "stdio",
"PROMETHEUS_MCP_BIND_HOST": "127.0.0.1",
"PROMETHEUS_MCP_BIND_PORT": "8080",
"PROMETHEUS_CUSTOM_HEADERS": "{ \"X-Custom\": \"value\" }"
}
}
}
}You can access Prometheus metrics and PromQL queries through a Model Context Protocol (MCP) server. This MCP server exposes Prometheus data via standardized interfaces so AI assistants can discover metrics, fetch metadata, run instant queries, and explore range queries with configurable authentication and transport options.
Use an MCP client to connect to the Prometheus MCP Server. You can discover available metrics, request metadata for a specific metric, and execute PromQL queries—both instant and range queries. Authentication options let you secure access with basic credentials or a bearer token. You can run the server in a container or expose it via HTTP transport, depending on your environment.
Typical capabilities you can leverage include:
Prerequisites: Ensure your Prometheus server is accessible from the environment running the MCP server, and have an MCP-compatible client ready (Claude Desktop, VS Code, Cursor, Windsurf, etc.). Add the MCP server configuration to your client setup using one of the supported methods.
Install and run via Docker Desktop (recommended for quick setup):
# Manual Docker Setup example
# Run the MCP server container with your Prometheus URL
docker run -i --rm \
-e PROMETHEUS_URL="http://your-prometheus:9090" \
ghcr.io/pab1it0/prometheus-mcp-server:latest
# Optional authentication example
# 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:latestThe following examples show how the MCP server can be integrated into various environments. Use the method that best fits your workflow and tooling.
Claude Desktop users can add an MCP server configuration that runs the MCP server container with the required environment variable for Prometheus URL.
Claude Code users can install via the Claude Code CLI by providing the environment variable and running the container command.
Health check endpoint for container monitoring and status verification
Execute a PromQL instant query against Prometheus
Execute a PromQL range query with start time, end time, and step interval
List all available metrics in Prometheus with pagination and filtering support
Get metadata for a specific metric
Get information about all scrape targets