- Home
- MCP servers
- Prometheus
Prometheus
- python
33
GitHub Stars
python
Language
6 months ago
First Indexed
2 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": {
"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 a Python-based MCP server that lets large language models fetch, analyze, and query data from Prometheus. This server exposes a lightweight interface to retrieve metrics, analyze them by ranges, and explore usage patterns, all through pre-defined start commands that you can run from your environment.
How to use
You use an MCP client to start the server and then interact with its endpoints to retrieve metric data, perform analyses, and run advanced queries. Start the local MCP server as described below, then configure your client to point to the running process. Ensure the Prometheus host is reachable at the URL you provide via the environment variable when needed.
How to install
Prerequisites you need before running the server:
- Python 3.x installed
- Python virtual environment tooling (venv)
- pip available in the active environment
- Access to a running Prometheus instance (hosted at a reachable URL)
Step-by-step setup options you can use right away.
# Manual installation: prepare a Python virtual environment
cd ./src/prometheus_mcp_server
python3 -m venv .venv
# Activate the virtual environment
# Linux/macOS:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# Ensure pip is available in the venv
# If pip is missing, install it manually
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
# Install required Python packages
pip install -r requirements.txt
```} ,{
Additional sections
Configuration notes and runtime guidance help you keep the server running smoothly and securely.
Environment variables you may need when running the server include the target Prometheus host, which you provide to the MCP client so the server can query the Prometheus API.