Sponsored by Deepsite.site

Prometheus MCP Server

Created By
CaesarYangs9 months ago
A Model Context Protocol (MCP) server for retrieving data from Prometheus databases.
Content

# MCP Server for Prometheus [![smithery badge](https://smithery.ai/badge/@CaesarYangs/prometheus\_mcp\_server)\](https://smithery.ai/server/@CaesarYangs/prometheus\_mcp\_server)

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.

  • Data Retrieval: Fetch specific metrics or ranges of data from Prometheus.
  • Metric Analysis: Perform statistical analysis on retrieved metrics.
  • Usage Search: Find and explore metric usage patterns.
  • Complex Querying: Execute advanced PromQL queries for in-depth data exploration.

Capibilites

✅ 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...

Getting Started

MCP runing requires a python virtual environment(venv), all packages should be installed into this venv so the MCP server can be automically started.

Installing via Smithery

To install Prometheus MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@CaesarYangs/prometheus\_mcp\_server):

```bash npx -y @smithery/cli install @CaesarYangs/prometheus_mcp_server --client claude ```

Manual Installation

**Prepare python env**

```sh cd ./src/prometheus_mcp_server python3 -m venv .venv ```

```sh

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: ```sh wget https://bootstrap.pypa.io/get-pip.py python3 get-pip.py ```

Then install all required packages: ```sh pip install -r requirements.txt ```

Usage

With Cursor Env

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 ```

![](./docs/imgs/cursor_screenshot.png)

With MCP Client(include Claude Desktop)

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" } } } } ```

Standalone MCP Server

Started this MCP server alone:

**uv method**

```sh 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**

```sh python3 server.py ```

Contributing

Contributions are welcome! Here's a quick guide:

  1. Fork the repo
  2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
  3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
  4. Push to the branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request

For major changes, please open an issue first to discuss what you would like to change.

Thank you for your contributions!

License

MIT License

References & Acknowledgments

This project was inspired by or uses code from the following open-source projects:

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
ChatWiseThe second fastest AI chatbot™
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.