Cover image
Try Now
2025-04-05

模型上下文协议(MCP)服务器,使LLM可以通过预定义的路由查询,分析和与Prometheus数据库进行互动。

3 years

Works with Finder

1

Github Watches

4

Github Forks

24

Github Stars

MCP Server for Prometheus

smithery badge

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:

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

Manual Installation

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

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

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

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

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:

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    4 (1)
    Avatar
    user_IAtTnawg
    2025-04-15

    Awslabs.bedrock Kb Retrieval Mcp Server by src is an exceptional tool that has significantly boosted my productivity. Its seamless integration and user-friendly interface make retrieving knowledge base content incredibly easy. The server's robust functionality and reliable performance have been impressive. Highly recommend for anyone seeking efficient MCP solutions. Check it out at: https://mcp.so/server/awslabs.bedrock-kb-retrieval-mcp-server/src.