Cover image
Try Now
2025-03-16

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

prometheus-mcp-server

Prometheus MCP Server

A Model Context Protocol (MCP) server for interacting with Prometheus metrics and data.

This is a TypeScript-based MCP server that implements a Prometheus API interface. It provides a bridge between Claude and your Prometheus server through the Model Context Protocol (MCP).

Features

  • Instant Queries: Execute PromQL queries at a specific time
  • Range Queries: Execute PromQL queries over a time period
  • Series Discovery: Find series by label matchers
  • Label Exploration: Get label names and values
  • Metadata Access: Get metadata for metrics
  • Target Information: Get information about scrape targets
  • Alerts & Rules: Get information about alerts and recording rules
  • Status Information: Get Prometheus server status information

Installation

# Install globally
npm install -g prometheus-mcp-server

# Or install locally
npm install prometheus-mcp-server

# Or use npx to run without installation
npx prometheus-mcp-server

Usage with Claude

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "prometheus-mcp-server": {
      "command": "/path/to/prometheus-mcp-server/build/index.js",
      "env": {
        "PROMETHEUS_HOST": "http://your-prometheus-instance:9090"
      }
    }
  }
}

Using with npx

You can also use npx in your Claude Desktop configuration:

{
  "mcpServers": {
    "prometheus-mcp-server": {
      "command": "npx prometheus-mcp-server",
      "env": {
        "PROMETHEUS_HOST": "http://your-prometheus-instance:9090"
      }
    }
  }
}

Configuration

The server requires the following environment variable:

  • PROMETHEUS_HOST: The base URL of your Prometheus instance (default: http://localhost:9090)

Available Functions

The server provides the following functions:

  • mcp__instant_query: Execute an instant PromQL query
  • mcp__range_query: Execute a range PromQL query over a time period
  • mcp__get_series: Find series by label matchers
  • mcp__get_label_values: Get values for a specific label
  • mcp__get_metadata: Get metadata for metrics
  • mcp__get_targets: Get information about scrape targets
  • mcp__get_alerts: Get information about alerts
  • mcp__get_rules: Get information about recording and alerting rules
  • mcp__get_status: Get status information about the Prometheus server

Development

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

# Debug
npm run dev:debug

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. You can use the following npm scripts for debugging:

# Inspect mode
npm run inspect

# Inspect with breakpoints
npm run inspect-debug

License

ISC

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

相关推荐

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

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • 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

    3 (1)
    Avatar
    user_LtMGbYpH
    2025-04-17

    As a dedicated user of prometheus-mcp-server, I am thoroughly impressed by its robustness and efficiency in managing metrics collection and monitoring tasks. Created by weetime, this open-source tool available at https://github.com/weetime/prometheus-mcp-server is essential for any development environment. Its seamless integration and user-friendly interface make it a top choice for professionals in the field. Highly recommended!