prometheus-mcp-server
Provides tools for querying Prometheus metrics, including instant and range queries, series discovery, label exploration, metadata access, target information, alerts, rules, and server status.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@prometheus-mcp-server what alerts are firing right now?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
prometheus-mcp-server

A Model Context Protocol (MCP) server for interacting with Prometheus metrics and data.
This is a TypeScript-based MCP server that implements a Prometheus API interface. It provides a bridge between Claude and your Prometheus server through the Model Context Protocol (MCP).
Features
Instant Queries: Execute PromQL queries at a specific time
Range Queries: Execute PromQL queries over a time period
Series Discovery: Find series by label matchers
Label Exploration: Get label names and values
Metadata Access: Get metadata for metrics
Target Information: Get information about scrape targets
Alerts & Rules: Get information about alerts and recording rules
Status Information: Get Prometheus server status information
Related MCP server: prometheus-mcp
Installation
# Install globally
npm install -g prometheus-mcp-server
# Or install locally
npm install prometheus-mcp-server
# Or use npx to run without installation
npx prometheus-mcp-serverUsage with Claude
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"prometheus-mcp-server": {
"command": "/path/to/prometheus-mcp-server/build/index.js",
"env": {
"PROMETHEUS_BASE_URL": "http://your-prometheus-instance:9090"
}
}
}
}Using with npx
You can also use npx in your Claude Desktop configuration:
{
"mcpServers": {
"prometheus-mcp-server": {
"command": "npx prometheus-mcp-server",
"env": {
"PROMETHEUS_BASE_URL": "http://your-prometheus-instance:9090"
}
}
}
}Configuration
By default, the client connects to a Prometheus server running at http://localhost:9090. You can configure the Prometheus server URL by setting the PROMETHEUS_BASE_URL environment variable:
# Example: Connect to a different Prometheus server
PROMETHEUS_BASE_URL=http://my-prometheus-server:9090 prometheus-mcp-serverThis allows you to point the client to any Prometheus instance without modifying the source code.
Available Functions
The server provides the following functions:
mcp__instant_query: Execute an instant PromQL querymcp__range_query: Execute a range PromQL query over a time periodmcp__get_series: Find series by label matchersmcp__get_label_values: Get values for a specific labelmcp__get_metadata: Get metadata for metricsmcp__get_targets: Get information about scrape targetsmcp__get_alerts: Get information about alertsmcp__get_rules: Get information about recording and alerting rulesmcp__get_status: Get status information about the Prometheus server
Development
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
# Debug
npm run dev:debugDebugging
Since MCP servers communicate over stdio, debugging can be challenging. You can use the following npm scripts for debugging:
# Inspect mode
npm run inspect
# Inspect with breakpoints
npm run inspect-debugLicense
ISC
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Available Tools
9 toolsget-alertsC
Get information about alerts
Inputs: no named parameters.
get-label-valuesC
Get label values for a label name
Inputs: labelName (required).
get-metadataC
Get metadata for metrics
Inputs: limit, metric.
get-rulesB
Get information about alerting and recording rules
Inputs: no named parameters.
get-seriesC
Find series by label matchers
Inputs: match (required), end, start.
get-statusB
Get status information about the Prometheus server
Inputs: statusType (required).
get-targetsC
Get information about targets
Inputs: state.
instant-queryC
Execute an instant Prometheus query
Inputs: query (required), time, timeout.
range-queryC
Execute a range Prometheus query
Inputs: end (required), step (required), query (required), start (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a distinct, clearly defined purpose. The instant-query and range-query are differentiated by query type, while the other tools retrieve specific Prometheus resources (series, labels, metadata, targets, alerts, rules, status) without overlap.
Most tool names follow a verb_noun pattern (get-series, get-label-values, get-metadata, etc.), but the query tools break the pattern with 'instant-query' and 'range-query' where 'query' comes after the adjective. This is a minor deviation but still readable and predictable.
Nine tools is well-scoped for a Prometheus server, covering the core read operations without redundancy. Each tool earns its place by providing a unique capability.
The surface covers the main read operations (query, series, labels, metadata, targets, alerts, rules, status), which is appropriate for a read-only Prometheus server. However, it lacks write operations (e.g., creating or modifying rules/alerts) and advanced query features (e.g., query for multiple time points or metric discovery).
Maintenance
Related MCP Connectors
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Uptime, SSL, DNS and domain monitoring you can talk to from Claude or any MCP client.
Manage uptime monitors, incidents and status pages from any MCP client.
Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for interacting with Prometheus metrics and data.17MIT
- AlicenseBqualityFmaintenanceProvides seamless integration between AI assistants and Prometheus, enabling natural language interactions with your monitoring infrastructure. This server allows for effortless querying, discovery, and analysis of metrics.10655 npm27MIT
- AlicenseAqualityBmaintenanceMCP server for Prometheus metrics and observability. Give Claude (or any MCP-capable agent) read access to your Prometheus instance — query metrics with PromQL, inspect active alerts, and explore scrape targets without leaving the conversation. Tools: prometheus_list_metrics, prometheus_query, prometheus_query_range, prometheus_list_alerts, prometheus_list_targets.2133 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceProvides access to Prometheus metrics and queries, allowing AI assistants to execute PromQL queries and analyze metrics data through standardized MCP interfaces.MIT