MCP

Query Prometheus Metrics with AI

Connect AI to Prometheus metrics and PromQL queries for monitoring data analysis. Execute queries and explore metrics.

Works with prometheus

90
Spark score
out of 100
Updated 4 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Enable AI assistants to directly query and analyze your Prometheus monitoring data. Execute PromQL queries, explore metrics, and gain insights into system health and performance.

Outcomes

What it gets done

01

Execute instant and range PromQL queries.

02

List and retrieve metadata for Prometheus metrics.

03

Access data collection target information.

04

Authenticate with Prometheus using basic auth or bearer tokens.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-prometheus | bash

Capabilities

Tools your agent gets

health_check

Health check for container monitoring and status verification

execute_query

Execute an instant PromQL query against Prometheus

execute_range_query

Execute a range PromQL query with start time, end time, and step interval

list_metrics

List all available metrics in Prometheus with pagination and filtering support

get_metric_metadata

Get metadata for a specific metric

get_targets

Get information about all data collection targets

Overview

Prometheus MCP Server

What it does

This MCP server provides AI assistants with access to Prometheus metrics and the ability to execute PromQL queries. It allows for metric discovery, exploration, and retrieval of both instant and range query results. The connector supports authentication and is containerized with Docker for easy deployment.

How it connects

Use this connector when you need to integrate AI assistants with your Prometheus monitoring infrastructure. It is ideal for automating analysis of system performance, troubleshooting, and gaining insights from time-series data.

Source README

An MCP server that provides access to Prometheus metrics and queries, enabling AI assistants to execute PromQL queries and analyze monitoring data.

Installation

Docker

docker run -i --rm \
  -e PROMETHEUS_URL="http://your-prometheus:9090" \
  ghcr.io/pab1it0/prometheus-mcp-server:latest

Docker with Authentication

docker run -i --rm \
  -e PROMETHEUS_URL="http://your-prometheus:9090" \
  -e PROMETHEUS_USERNAME="admin" \
  -e PROMETHEUS_PASSWORD="password" \
  ghcr.io/pab1it0/prometheus-mcp-server:latest

From Source

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install -e .

Configuration

Claude Desktop

{
  "mcpServers": {
    "prometheus": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PROMETHEUS_URL",
        "ghcr.io/pab1it0/prometheus-mcp-server:latest"
      ],
      "env": {
        "PROMETHEUS_URL": "<your-prometheus-url>"
      }
    }
  }
}

VS Code / Cursor / Windsurf

{
  "prometheus": {
    "command": "docker",
    "args": [
      "run",
      "-i",
      "--rm",
      "-e",
      "PROMETHEUS_URL",
      "ghcr.io/pab1it0/prometheus-mcp-server:latest"
    ],
    "env": {
      "PROMETHEUS_URL": "<your-prometheus-url>"
    }
  }
}

Available Tools

Tool Description
health_check Health check for container monitoring and status verification
execute_query Execute an instant PromQL query against Prometheus
execute_range_query Execute a range PromQL query with start time, end time, and step interval
list_metrics List all available metrics in Prometheus with pagination and filtering support
get_metric_metadata Get metadata for a specific metric
get_targets Get information about all data collection targets

Features

  • Execution of PromQL queries against Prometheus
  • Metric discovery and exploration
  • Viewing available metrics
  • Getting metadata for specific metrics
  • Viewing instant query results
  • Viewing range query results with various step intervals
  • Authentication support (Basic auth and Bearer token)
  • Docker containerization support
  • Interactive tools for AI assistants
  • Customizable tool list

Environment Variables

Required

  • PROMETHEUS_URL - URL of your Prometheus server

Optional

  • PROMETHEUS_URL_SSL_VERIFY - Set to False to disable SSL verification
  • PROMETHEUS_DISABLE_LINKS - Set to True to disable links to Prometheus UI in query results (saves context tokens)
  • PROMETHEUS_USERNAME - Username for basic authentication
  • PROMETHEUS_PASSWORD - Password for basic authentication
  • PROMETHEUS_TOKEN - Bearer token for authentication
  • ORG_ID - Organization ID for multi-tenant setups
  • PROMETHEUS_MCP_SERVER_TRANSPORT - Transport mode (stdio, http, sse)
  • PROMETHEUS_MCP_BIND_HOST - Host for HTTP transport

Notes

Requires a Prometheus server accessible from your environment and an MCP-compatible client. Available through Docker Desktop MCP Catalog for easy installation.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.