Prometheus MCP Server logo

Prometheus MCP Server

Community
brenoepics

Prometheus MCP Server

Publisherbrenoepics
Repositoryprometheus-mcp
LanguageRust
Forks
2
Stars
13
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Prometheus MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    13 stars and 2 forks from the linked repository.


Install

CursorVS Code

A minimal Model Context Protocol (MCP) server focused on reading from Prometheus. It exposes Prometheus discovery and query tools to MCP-compatible apps and includes a convenient CLI for local queries.

Highlights

  • Instant and range queries via Prometheus HTTP API
  • Discovery helpers: list metrics, get metadata, series selectors, label values
  • Optional internal metrics exporter at /metrics (disabled by default)
  • Works as a stdio MCP server or a one-off CLI

Container images

Images are published to both Docker Hub and GHCR:

  • Docker Hub: brenoepics/prometheus-mcp
  • GHCR: ghcr.io/brenoepics/prometheus-mcp

Quickstart

Pick your preferred install method.

  • From crates.io (installs the prometheus-mcp binary):
bash
cargo install prometheus-mcp
prometheus-mcp --help
bash
# Docker Hub
docker pull brenoepics/prometheus-mcp:latest
# or GHCR
docker pull ghcr.io/brenoepics/prometheus-mcp:latest

# Run the MCP server against a local Prometheus (pick one image)
docker run --rm -it brenoepics/prometheus-mcp:latest --mcp \
  --prometheus-url http://host.docker.internal:9090

Installation

Build from source (Rust):

bash
cargo build --release
# binary at ./target/release/prometheus-mcp

Or build a Docker image locally:

bash
docker build -t prometheus-mcp:latest .

Usage (CLI)

The CLI mirrors the tools exposed over MCP.

  • Instant query
bash
prometheus-mcp query --query 'up' --prometheus-url http://localhost:9090
# optionally set an evaluation time
prometheus-mcp query --query 'up' --time '2025-09-27T12:00:00Z'
  • Range query
bash
prometheus-mcp range --query 'rate(http_requests_total[5m])' \
  --start '2025-09-27T12:00:00Z' --end '2025-09-27T13:00:00Z' --step '30s'
  • List metric names
bash
prometheus-mcp list-metrics
  • Metric metadata
bash
prometheus-mcp metadata --metric 'up'
  • Series selectors (repeat --selector)
bash
prometheus-mcp series --selector 'up' --selector 'node_cpu_seconds_total{mode="idle"}'
  • Label values
bash
prometheus-mcp label-values --label 'job'

MCP server (stdio)

Start the MCP server over stdio:

bash
prometheus-mcp --mcp --prometheus-url http://localhost:9090

Optional: enable internal metrics at /metrics (default off):

bash
prometheus-mcp --mcp --metrics-exporter --metrics-port 9091

Running in Docker

Use the published image from Docker Hub (or GHCR alternative shown):

bash
# Start the MCP server (macOS/Windows: host.docker.internal works; Linux see alternatives below)
docker run --rm -it brenoepics/prometheus-mcp:latest --mcp \
  --prometheus-url http://host.docker.internal:9090

Linux alternatives when Prometheus runs on the host:

bash
# Use host networking (Linux only)
docker run --rm -it --network host brenoepics/prometheus-mcp:latest --mcp \
  --prometheus-url http://localhost:9090

# Without host network: map host gateway and use host.docker.internal
docker run --rm -it --add-host=host.docker.internal:host-gateway \
  brenoepics/prometheus-mcp:latest --mcp \
  --prometheus-url http://host.docker.internal:9090

One-off CLI in the container:

bash
# Instant query
docker run --rm brenoepics/prometheus-mcp:latest query --query 'up' \
  --prometheus-url http://host.docker.internal:9090

# Range query
docker run --rm brenoepics/prometheus-mcp:latest range --query 'rate(http_requests_total[5m])' \
  --start '2025-09-27T12:00:00Z' --end '2025-09-27T13:00:00Z' --step '30s' \
  --prometheus-url http://host.docker.internal:9090

Basic Auth

Pass credentials via environment variables or CLI flags.

  • Environment variables:
bash
export PROMETHEUS_URL=https://prom.example.com
export PROMETHEUS_USERNAME=api
export PROMETHEUS_PASSWORD=secret
prometheus-mcp --mcp
  • CLI flags:
bash
prometheus-mcp --mcp \
  --prometheus-url https://prom.example.com \
  --prometheus-username api \
  --prometheus-password secret
  • Docker with env vars:
bash
docker run --rm -it \
  -e PROMETHEUS_URL=https://prom.example.com \
  -e PROMETHEUS_USERNAME=api \
  -e PROMETHEUS_PASSWORD=secret \
  brenoepics/prometheus-mcp:latest --mcp

Configuration

All settings can be provided via environment variables; some also via flags.

NameTypeDefaultCLI flagDescription
PROMETHEUS_URLstring (URL)http://localhost:9090--prometheus-urlBase URL of your Prometheus server
PROMETHEUS_TIMEOUTinteger (seconds)10—HTTP request timeout
PROMETHEUS_RETRIESinteger3—Number of retries for Prometheus API calls
PROMETHEUS_RETRY_BACKOFF_MSinteger (ms)500—Time to wait between retries
PROMETHEUS_MIN_INTERVAL_MSinteger (ms)——Minimum interval between query requests (basic rate limit)
PROMETHEUS_CACHE_TTL_SECSinteger (seconds)——TTL for simple in-process caches (list metrics and label values)
PROMETHEUS_USERNAMEstring—--prometheus-usernameBasic auth username
PROMETHEUS_PASSWORDstring—--prometheus-passwordBasic auth password
—booleanfalse--mcpStart MCP server over stdio
—booleanfalse--metrics-exporterEnable internal Prometheus metrics at /metrics
—integer (port)9091--metrics-portPort for /metrics when exporter is enabled

See docs/configuration.md for notes and examples.

Accessing from Claude Desktop

Follow the official guide to locate claude_desktop_config.json: https://modelcontextprotocol.io/quickstart/user#for-claude-desktop-users

Minimal Docker-based entry:

json
{
  "mcpServers": {
    "prometheus": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "brenoepics/prometheus-mcp:latest"]
    }
  }
}

With host Prometheus and exporter (macOS/Windows):

json
{
  "mcpServers": {
    "prometheus": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-p", "9091:9091",
        "brenoepics/prometheus-mcp:latest",
        "--mcp",
        "--prometheus-url", "http://host.docker.internal:9090",
        "--metrics-exporter",
        "--metrics-port", "9091"
      ]
    }
  }
}

With Basic Auth via environment variables:

json
{
  "mcpServers": {
    "prometheus": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "PROMETHEUS_URL=https://prom.example.com",
        "-e", "PROMETHEUS_USERNAME=api",
        "-e", "PROMETHEUS_PASSWORD=secret",
        "brenoepics/prometheus-mcp:latest", "--mcp"
      ]
    }
  }
}

More examples: see docs/claude-desktop.md.

Debugging

Use the MCP Inspector to exercise the server interactively:

bash
npx @modelcontextprotocol/inspector

Connect with transport "STDIO", command prometheus-mcp, and optional args --mcp --prometheus-url http://localhost:9090.

Logs are appended to /tmp/mcp.jsonl; tail it with:

bash
tail -f /tmp/mcp.jsonl

Security Considerations

  • The server does not provide authentication itself; when running outside stdio, keep it on localhost.
  • Handle credentials via environment variables or your secret manager. Avoid committing secrets.

License

Apache-2.0

Installation

TypingMind
{
  "mcpServers": {
    "prometheus-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-it",
        "prometheus-mcp:latest",
        "--mcp",
        "--prometheus-url",
        "{{config.PROMETHEUS_URL}}"
      ],
      "env": {
        "PROMETHEUS_URL": "<PROMETHEUS_URL>"
      }
    }
  }
}

Use Prometheus MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Prometheus MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Prometheus MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Prometheus MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "prometheus-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Prometheus MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Prometheus MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Prometheus MCP Server to help me with this task?
Prometheus MCP Server
Sure. I read it.
Here is what I found using Prometheus MCP Server.

Frequently asked questions

What is the Prometheus MCP Server MCP server used for?

Prometheus MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Prometheus MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Prometheus MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Prometheus MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Prometheus MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Prometheus MCP Server MCP to TypingMind?

Prometheus MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Prometheus MCP Server MCP provide in TypingMind?

Prometheus MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Prometheus MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Prometheus MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇