How caesaryangs/prometheus_mcp_server works
Project type and purpose
• This is a backend-only Python microservice (“MCP Server for Prometheus”) that exposes a Model Context Protocol (MCP) interface, enabling LLMs (e.g., Claude Desktop) to invoke tool-style endpoints for querying and analyzing Prometheus time-series metric data.
File structure
Top-level:
• Dockerfile, docker/ (compose + Prometheus scrape config) → containerized deployment
• config.json, smithery.yaml → client integration metadata
• docs/ → usage screenshots and architecture notes
• requirements.txt, pytest.ini → dependencies + test config
• src/prometheus_mcp_server/
– server.py & __main__.py: entrypoint for UVicorn/CLI server
– prometheus_api.py: wrappers over the Prometheus HTTP API
– db_connector.py: data-transformation and caching layer
– pyproject.toml: module metadata
• test/ → unit tests for server and connectors
README for additional insights
• Stack: Python, Prometheus API Client (modified), UVicorn (implied), MCP protocol via Smithery integration.
• Deployment options: standalone Python, UV CLI, Docker+Docker-Compose.
• External clients: LLM front-ends (Claude Desktop, Cursor), configured via smithery.