Skip to main content
Glama

PMCP - Prometheus Model Context Protocol Server

🚀 A Model Context Protocol (MCP) server implementation for Prometheus that enables natural language interactions with Prometheus metrics and queries.


Table of Contents

  1. Features
  2. Requirements
  3. Installation
  4. Usage
  5. Binding Blocks
  6. Contributing
  7. License
  8. Acknowledgments

Features

  • Instant Query: Execute Prometheus queries at a specific point in time.
  • Range Query: Retrieve historical metric data over defined time ranges.
  • Metadata Query: Discover time series, label names, and label values.
  • Transport Options: Support for HTTP, Server-Sent Events (SSE), and stdio.
  • MCP Integration: Seamless communication with MCP-compatible clients.

Requirements

  • Go 1.23.5 or higher
  • A running Prometheus server (v2.x)

Installation

Install the pmcp binary via go install:

go install github.com/yshngg/pmcp@latest

Ensure $GOPATH/bin is in your $PATH.


Usage

Run the server by specifying your Prometheus address and preferred transport:

# Default (stdio transport) pmcp --prom-addr="http://localhost:9090" # HTTP transport pmcp --prom-addr="http://localhost:9090" --transport=http --mcp-addr="localhost:8080" # SSE transport pmcp --prom-addr="http://localhost:9090" --transport=sse --mcp-addr="localhost:8080"

Command Line Flags

FlagDescriptionDefault
-helpShow help information.N/A
-mcp-addrAddress for the MCP server to listen on.localhost:8080
-prom-addrPrometheus server URL.http://localhost:9090
-transportCommunication transport (stdio, http, sse).stdio
-versionPrint version and exit.N/A

Binding Blocks

Tools

  • Instant Query: Evaluate an instant query at a single point in time.
  • Range Query: Evaluate an expression query over a range of time.
  • Find Series by Labels: Return the list of time series that match a certain label set.
  • List Label Names: Return a list of label names.
  • List Label Values: Return a list of label values for a provided label name.
  • Target Metadata Query: Return metadata about metrics currently scraped from targets.
  • Metric Metadata Query: Return metadata about metrics currently scraped from targets. However, it does not provide any target information.
  • Target Discovery: Return an overview of the current state of the Prometheus target discovery.
  • Alert Query: Return a list of all active alerts.
  • Rule Query: Return a list of alerting and recording rules that are currently loaded. In addition it returns the currently active alerts fired by the Prometheus instance of each alerting rule.
  • Alertmanager Discovery: Return an overview of the current state of the Prometheus alertmanager discovery.
  • Config: Return currently loaded configuration file.
  • Flags: Return flag values that Prometheus was configured with.
  • Runtime Information: Return various runtime information properties about the Prometheus server.
  • Build Information: Return various build information properties about the Prometheus server.
  • TSDB Stats: Return various cardinality statistics about the Prometheus TSDB.
  • WAL Replay Stats: Return information about the WAL replay.
  • TSDB Snapshot: Create a snapshot of all current data into snapshots/-.
  • Delete Series: Delete data for a selection of series in a time range.
  • Clean Tombstones: Remove the deleted data from disk and cleans up the existing tombstones.
  • Health Check: Check Prometheus health.
  • Readiness Check: Check if Prometheus is ready to serve traffic (i.e. respond to queries).
  • Reload: Trigger a reload of the Prometheus configuration and rule files.
  • Quit: Trigger a graceful shutdown of Prometheus.

Prompts

  • All Available Metrics: Return a list of every metric exposed by the Prometheus instance.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss improvements.


License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.


Acknowledgments

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

🚀 A Prometheus Model Context Protocol Server.

  1. Table of Contents
    1. Features
      1. Requirements
        1. Installation
          1. Usage
            1. Command Line Flags
          2. Binding Blocks
            1. Tools
            2. Prompts
          3. Contributing
            1. License
              1. Acknowledgments

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  MCP server for interacting with Prometheus metrics and data.
                  Last updated -
                  16
                  JavaScript
                  MIT License
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that provides web content fetching and conversion capabilities.
                  Last updated -
                  4
                  704
                  2
                  JavaScript
                  MIT License
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that provides a scalable backend solution for efficient interaction with Medusa's data models through the JavaScript SDK.
                  Last updated -
                  246
                  37
                  TypeScript
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A tool that enables access to Prometheus metrics data through a Model Context Protocol server, allowing interaction with monitoring data using natural language.
                  Last updated -
                  Python

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/yshngg/pmcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server