A Model Context Protocol (MCP) server enabling LLMs to query, analyze, and interact with Prometheus databases through predefined routes.
A Model Context Protocol (MCP) server for retrieving data from Prometheus databases. This MCP server enables Large Language Models (LLMs) to invoke tool functions that retrieve and analyze vast amounts of metric data, search metric usage, execute complex queries, and perform other related tasks through pre-defined routes with enhanced control over usage.
✅ Retrieve comprehensive metric information, including names and descriptions, from Prometheus
✅ Fetch and analyze specific metric data using metric names
✅ Analyze metric data within custom time ranges
🚧 Filter and match data using specific labels (in development)
⏳ Additional features planned…
MCP runing requires a python virtual environment(venv), all packages should be installed into this venv so the MCP server can be automically started.
Prepare python env
cd ./src/prometheus_mcp_server
python3 -m venv .venv
## linux/macos:
source .venv/bin/activate
## windows:
.venv\Scripts\activate
Then it is ready to be used as a dedicated python environment.
Install required packages
Make sure pip is properly isntalled. If your venv is installed without pip, then manually install it using:
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
Then install all required packages:
pip install -r requirements.txt
Ready to update depend on more easy-to-use Cursor environment.
Set this in the MCP section in Cursor Settings:
uv --directory /path/to/prometheus_mcp_server run server.py

Config your Claude Desktop app’s configuration at ~/Library/Application Support/Claude/claude_desktop_config.json(macos)
{
"mcpServers": {
"prometheus": {
"command": "uv",
"args": [
"--directory",
"/path/to/prometheus_mcp_server",
"run",
"server.py"
],
"env": {
"PROMETHEUS_HOST": "http://localhost:9090"
}
}
}
}
Started this MCP server alone:
uv method
uv --directory /path/to/prometheus_mcp_server run server.py
This is also a way to make sure this MCP server can be automatically started since the Claude Desktop is using this ux script way to start when the app launches.
regular python method
python3 server.py
Contributions are welcome! Here’s a quick guide:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)For major changes, please open an issue first to discuss what you would like to change.
Thank you for your contributions!
MIT License
This project was inspired by or uses code from the following open-source projects:
Mcp Server Ts Trello
TypeScript implementation of a Model Context Protocol (MCP) server for Trello integration
Esxi Mcp Server
A VMware ESXi/vCenter management server based on MCP (Model Control Protocol), providing simple REST API interfaces for virtual machine management.
Mcp Crypto Price
A Model Context Protocol (MCP) server that provides real-time cryptocurrency analysis via CoinCap's API. Enables Claude and other MCP clients to fetch crypto prices, analyze market trends, and track historical data.
MCP server that enables MCP to make REST API calls
Database Upadter MCP
This Model Context Protocol (MCP) server enables LLMs like Claude to perform internet research using the Perplexity API. It provides real-time, up-to-date information with source citations.