- Home
- MCP servers
- Prometheus
Prometheus
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"mcp-mirror-caesaryangs_prometheus_mcp_server": {
"command": "uv",
"args": [
"--directory",
"/path/to/prometheus_mcp_server",
"run",
"server.py"
],
"env": {
"PROMETHEUS_HOST": "http://localhost:9090"
}
}
}
}You can run an MCP server that fetches and analyzes data from Prometheus, enabling large language models to retrieve metrics, perform analyses, search usage patterns, and execute advanced queries through clearly defined tool endpoints.
How to use
You interact with the Prometheus MCP server by starting it in stdio mode and then issuing requests through your MCP client. The server exposes core capabilities such as retrieving metric information, fetching metric data, analyzing data over time ranges, and performing complex queries. You can connect your LLM workflow to fetch metrics, analyze results, and explore metric usage without directly querying Prometheus yourself.
How to install
Prerequisites you need before starting: a Python-enabled environment and, if you plan to run the client integration, a compatible MCP client setup.
cd ./src/prometheus_mcp_server
python3 -m venv .venv
# linux/macos:
source .venv/bin/activate
# windows:
.venv\Scripts\activate
Additional setup steps
Install Python packaging tools if they are not present and install required dependencies for the MCP server.
# ensure pip is available in your venv
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
# install dependencies
pip install -r requirements.txt
Starting the MCP server
You have two options to start the Prometheus MCP server in stdio mode. Use your preferred method and ensure the environment is set up as described.
# Option 1: Claude/UV method (stdio) using the project path you choose
uv --directory /path/to/prometheus_mcp_server run server.py
# Option 2: Direct Python start (stdio) with the inline server file
python3 server.py
Configuration basics
The MCP server reads its host configuration from environment variables when started in stdio mode. The following variable is used by the CLI to connect to the Prometheus instance.
{
"PROMETHEUS_HOST": "http://localhost:9090"
}
Available tools
data_retrieval
Fetch metric data by name and time ranges from Prometheus, enabling you to retrieve specific metrics or ranges for analysis.
metric_analysis
Analyze retrieved metric data statistically, summarize trends, and compute basic statistics over chosen time windows.
usage_search
Search metric usage patterns and connections across Prometheus metrics to identify relationships and hotspots.
complex_querying
Execute advanced PromQL queries to explore in-depth data and produce detailed results for deeper insights.