Skip to content

Conversation

@pab1it0
Copy link
Contributor

@pab1it0 pab1it0 commented Mar 19, 2025

PR: Add Prometheus MCP Server

Description

Add a new Prometheus MCP Server to enable AI assistants to query and analyze Prometheus metrics through standardized Model Context Protocol interfaces.

Server Details

  • Server: prometheus-mcp-server
  • Type: New server

Motivation and Context

Prometheus is a widely used open-source monitoring and alerting system with a powerful query language (PromQL). This MCP server enables AI assistants to directly interact with Prometheus, allowing them to:

  1. Execute instant and range PromQL queries
  2. Discover available metrics
  3. Retrieve metadata about specific metrics
  4. Check monitoring target health

This integration empowers users to leverage AI assistants for infrastructure monitoring, performance analysis, and troubleshooting without requiring specialized knowledge of PromQL or the Prometheus API structure.

How Has This Been Tested?

The server has been tested with Claude Desktop against a Prometheus instance monitoring a Kubernetes cluster. Testing scenarios included:

  1. Basic metric retrieval (uptime, CPU, memory)
  2. Complex range queries with various step intervals
  3. Metric discovery and exploration
  4. Authentication using both basic auth and token methods
  5. Error handling for invalid queries and connectivity issues

A comprehensive test suite has been implemented to ensure functionality across all components.

Breaking Changes

None. This is a new server and does not modify any existing functionality.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the [MCP Protocol Documentation](https://modelcontextprotocol.io)
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

The server is designed to be lightweight and focused on the core Prometheus functionality. Key implementation details:

  1. Authentication support includes both basic auth and bearer token methods, following Prometheus security standards
  2. Error handling is robust, with clear error messages that guide users to solutions
  3. The modular design makes it easy to extend with additional Prometheus features
  4. Documentation covers installation, configuration, and usage with specific examples for better user experience
  5. Docker support enables easy deployment in various environments

The server follows the same patterns and architecture as other MCP servers in the repository to maintain consistency, but adapts specifically to Prometheus' API structure and query language.

@tadasant tadasant merged commit 917674c into modelcontextprotocol:main Mar 19, 2025
20 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants