Get the FREE Ultimate OpenClaw Setup Guide →

mcp -prometheus

MCP server for interacting with Prometheus

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio loglmhq-mcp-server-prometheus node build/index.js \
  --env PROMETHEUS_URL="http://your-prometheus-instance:9090" \
  --env PROMETHEUS_PASSWORD="optional" \
  --env PROMETHEUS_USERNAME="optional"

How to use

This MCP server exposes a Prometheus-compatible API through the MCP interface, acting as a bridge between Claude and your Prometheus instance. It lets you discover available Prometheus metrics, inspect each metric's metadata (such as help text and type), and retrieve current statistical data (counts, min, max) for those metrics. Basic authentication support can be enabled if your Prometheus instance requires credentials. You can interact with the server via the MCP-enabled tooling in Claude to explore metrics and fetch detailed metric information in a structured JSON format.

How to install

Prerequisites:

  • Node.js and npm installed on your machine (Node 14+ recommended)
  • Access to a Prometheus instance you want to query

Installation steps:

  1. Clone the repository or download the source code
  2. Install dependencies
npm install
  1. Build the server
npm run build
  1. (Optional) Run in watch/development mode for auto-rebuilds
npm run watch
  1. Configure environment variables for your Prometheus access (see next step)
  2. Run the server via the MCP config you will place in Claude configuration

Environment configuration (example):

PROMETHEUS_URL=http://your-prometheus-instance:9090
PROMETHEUS_USERNAME=optional
PROMETHEUS_PASSWORD=optional

Additional notes

Tips and considerations:

  • Ensure your PROMETHEUS_URL is reachable from the environment where the MCP server runs.
  • If your Prometheus instance uses basic auth, provide PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD.
  • When debugging, you can use the MCP Inspector tool to inspect requests/responses and trace MCP interactions.
  • If you see metric data not updating, verify Prometheus is reachable and the metric names are correct; the server exposes a list-and-fetch interface for metrics including metadata and statistics.
  • In Claude, reference metrics by their Prometheus name as exposed by the MCP server.

Related MCP Servers

Sponsor this space

Reach thousands of developers