What is A Model Context Protocol (MCP) server for Prometheus providing access to metrics and queries.?
This MCP server allows AI assistants to execute PromQL queries and analyze Prometheus metrics data through standardized interfaces. Features include executing queries, discovering metrics, and supporting authentication methods.
This provides access to your Prometheus metrics and queries through standardized MCP interfaces, allowing AI assistants to execute PromQL queries and analyze your metrics data.
Features
Execute PromQL queries against Prometheus
Discover and explore metrics
List available metrics
Get metadata for specific metrics
View instant query results
View range query results with different step intervals
Authentication support
Basic auth from environment variables
Bearer token auth from environment variables
Docker containerization support
Provide interactive tools for AI assistants
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.
Usage
Ensure your Prometheus server is accessible from the environment where you'll run this MCP server.
Configure the environment variables for your Prometheus server, either through a .env file or system environment variables:
PROMETHEUS_URL=http://your-prometheus-server:9090
# Optional: Authentication credentials (if needed)\n\n# Choose one of the following authentication methods if required:
# For basic auth
PROMETHEUS_USERNAME=your_username
PROMETHEUS_PASSWORD=your_password
# For bearer token auth
PROMETHEUS_TOKEN=your_token
# Optional: For multi-tenant setups like Cortex, Mimir or Thanos
ORG_ID=your_organization_id
Add the server configuration to your client configuration file. For example, for Claude Desktop: