Cover image
Try Now
2024-12-09

Espejo de https: //github.com/caesaryangs/prometheus_mcp_server

3 years

Works with Finder

0

Github Watches

1

Github Forks

0

Github Stars

MCP Server for Prometheus

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.

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

  • Andris Teikmanis
  • Latvian GPT assistant for developing GPT applications

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

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

  • https://cantaspinar.com
  • Summarizes videos and answers related questions.

  • Jan Meindl
  • Builds new GPTs

  • https://hashrateventures.xyz
  • Crafts custom instructions for new GPTs

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_ADIwGBbe
    2025-04-15

    I've been using the Model Context Protocol Server by big-mon, and it's been a game-changer for my projects. The seamless integration and robust performance have exceeded my expectations. It's incredibly user-friendly and has enhanced my workflow significantly. Highly recommend!