Get the FREE Ultimate OpenClaw Setup Guide →

prometheus

MCP server from weetime/prometheus-mcp-server

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

How to use

The prometheus-mcp-server provides a bridge between Claude and a Prometheus instance using the Model Context Protocol (MCP). It exposes MCP functions that let you run instant PromQL queries, fetch range queries over time ranges, discover series by label matchers, explore label values, retrieve metric metadata, inspect scrape targets, and access information about alerts, rules, and the Prometheus server status. This makes it possible for Claude to generate metrics data, dashboards, and insights directly from Prometheus without manual query work. You can run the server locally or point it at a remote Prometheus instance by configuring the PROMETHEUS_BASE_URL environment variable and then referencing the server in Claude’s MCP config.

Typical usage involves starting the server with a configured Prometheus URL and then using Claude to issue MCP function calls such as mcp__instant_query, mcp__range_query, mcp__get_series, mcp__get_label_values, mcp__get_metadata, mcp__get_targets, mcp__get_alerts, mcp__get_rules, and mcp__get_status. The server translates these MCP calls into Prometheus HTTP API requests and returns structured results suitable for Claude to consume in natural language tasks or dashboards.

How to install

Prerequisites:

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

Install the MCP server globally or locally:

# Install globally (recommended for CLI usage)
npm install -g prometheus-mcp-server

# Or install locally in a project
npm install prometheus-mcp-server

Run the server locally (from the project root after a local install or from the built distribution):

# Build (if using TypeScript source)
npm install
npm run build

# Start the server
npm start

Alternative: use npx to run without installation:

npx prometheus-mcp-server

Configuration (via environment variables or Claude config):


Note: Ensure the Prometheus server is reachable from where you run the MCP server. If Prometheus requires authentication, you may need to adjust headers or authentication in the server config as needed by the project.

Additional notes

Tips and notes:

  • Default Prometheus target URL is http://localhost:9090; override with PROMETHEUS_BASE_URL.
  • When debugging, use Claude's MCP inspect/debug scripts if available to step through MCP calls.
  • If you move the MCP server to a different host or port, update the Claude configuration accordingly.
  • The server exposes a variety of functions; refer to the Available Functions list in the README to know the exact MCP method names.
  • Ensure Node.js version compatibility with the server build. If you encounter build errors, run npm ci or delete node_modules and reinstall.
  • For production deployments, consider running behind a reverse proxy and enabling TLS and proper authentication for Claude access.

Related MCP Servers

Sponsor this space

Reach thousands of developers