prometheus mcp

Local 2025-09-01 00:22:54 0

A proof-of-concept Prometheus MCP server, which likely enables Claude AI to interact with Prometheus monitoring systems through the Model Context Protocol.


Proof-of-concept Prometheus MCP server.

Prerequisites

Install uv: https://docs.astral.sh/uv/getting-started/installation/

Using uv, you can also install python.

How to run

Clone this repo.

Update the .env file

uv add "mcp[cli]" pillow google-auth matplotlib requests python-dotenv

Integrating with Claude

You can run the server with

uv --directory "/directory/to/prometheus-mcp" run server.py

So you may add this MCP server to your Claude MCP server configuration

{
  "mcpServers": {
      "Prometheus MCP": {
          "command": "/path/to/uv",
          "args": [
              "--directory",
              "/directory/to/prometheus-mcp",
              "run",
              "server.py"
          ]
      }
  }
}

See MCP Quickstart for more details for Claude specific instructions.

Demo

Demo gif

Link to shared Claude chat in demo

[
  {
    "description": "     Query Prometheus /query_range API endpoint and return     an image of a plot of the time series monitoring data.     Use this tool whenever the user asks about the status     of their compute infrastructure.     ",
    "inputSchema": {
      "properties": {
        "end_time": {
          "title": "End Time",
          "type": "string"
        },
        "query": {
          "title": "Query",
          "type": "string"
        },
        "start_time": {
          "title": "Start Time",
          "type": "string"
        },
        "step": {
          "title": "Step",
          "type": "string"
        }
      },
      "required": [
        "query",
        "start_time",
        "end_time",
        "step"
      ],
      "title": "prometheus_query_rangeArguments",
      "type": "object"
    },
    "name": "prometheus_query_range"
  },
  {
    "description": "     Query the Prometheus /rules API.     Returns 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.     ",
    "inputSchema": {
      "properties": {},
      "title": "prometheus_alert_rulesArguments",
      "type": "object"
    },
    "name": "prometheus_alert_rules"
  }
]