MCP Server for Prometheus
@CaesarYangs
A Model Context Protocol (MCP) server enabling LLMs to query, analyze, and interact with Prometheus databases through predefined routes.
Overview
What is MCP Server for Prometheus?
MCP Server for Prometheus is a Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to retrieve and analyze metric data from Prometheus databases. It provides tool functions for fetching specific metrics, performing statistical analysis, searching metric usage, and executing PromQL queries, with predefined routes for controlled usage.
How to use MCP Server for Prometheus?
Install automatically via Smithery using npx -y @smithery/cli install @CaesarYangs/prometheus_mcp_server --client claude, or manually by creating a Python virtual environment, installing dependencies from requirements.txt, and running server.py with uv or Python. Configure the Prometheus host via the PROMETHEUS_HOST environment variable and integrate with MCP clients like Claude Desktop or Cursor by specifying the command and directory in the client's MCP settings.
Key features of MCP Server for Prometheus
- Retrieve comprehensive metric information (names, descriptions) from Prometheus.
- Fetch and analyze specific metric data by name.
- Analyze metric data within custom time ranges.
- Execute advanced PromQL queries for in‑depth data exploration.
- Search and explore metric usage patterns.
Use cases of MCP Server for Prometheus
- Let an LLM answer questions about available metrics and their descriptions.
- Analyze time‑series metric data over a custom time window.
- Run complex PromQL queries to investigate infrastructure or application performance.
- Quickly find metric usage patterns without manual PromQL writing.
FAQ from MCP Server for Prometheus
What is MCP Server for Prometheus and what problem does it solve?
It is an MCP server that allows LLMs to interact with Prometheus databases through tool functions. This enables AI‑assisted retrieval, analysis, and querying of metric data without writing manual PromQL or using the Prometheus UI.
What are the prerequisites to run MCP Server for Prometheus?
You need a Python virtual environment (venv) with pip installed, the dependencies listed in requirements.txt, and access to a running Prometheus instance. The server can be started using uv or standard Python.
How do I configure the Prometheus host?
Set the environment variable PROMETHEUS_HOST to your Prometheus server URL (e.g., http://localhost:9090). This is specified in the MCP client configuration (e.g., Claude Desktop's claude_desktop_config.json) under the env key.
What capabilities are currently available?
The server supports retrieving metric names and descriptions, fetching and analyzing specific metric data, analyzing data within custom time ranges, and executing PromQL queries. Filtering by labels is still in development.
Are there any known limitations or features in development?
Label‑based filtering is not yet implemented (in development). Additional features are planned but not specified. The server relies on an external Prometheus database and requires that database to be reachable.