Prometheus MCP Server
Provides read-only tools for interacting with Prometheus: checking target and scrape health, running instant and range PromQL queries, discovering metrics and label values, viewing active alerts and alerting/recording rules, and retrieving Prometheus and TSDB status. It also includes prebuilt queries for Windows, Linux node, and blackbox exporter metrics.
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 Are any Prometheus alerts 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 READ-ONLY MCP (Model Context Protocol) server that connects AI assistants to Prometheus. Works with Claude Code CLI, VS Code AI extensions (Continue, Cline), Cursor, Amazon Q Developer, and any MCP-compatible client.
Features
Health Monitoring: Check target status, scrape health
PromQL Queries: Execute instant and range queries
Metrics Discovery: List and search available metrics
Alerting: View active alerts and alerting rules
Exporter Helpers: Pre-built queries for windows_exporter and blackbox_exporter
Related MCP server: Prometheus MCP Server
Prerequisites
Node.js 18 or higher
Prometheus server (accessible via HTTP API)
Installation
Option 1: npm (Recommended)
npx @elad-nofy/prometheus-mcp@latestOption 2: Clone and Build
git clone https://github.com/elad-nofy/prometheus-mcp.git
cd prometheus-mcp
npm install
npm run buildConfiguration
Configure MCP Client
Claude Code CLI
Add to your global settings (~/.claude.json on macOS/Linux, %USERPROFILE%\.claude.json on Windows):
Windows:
{
"mcpServers": {
"prometheus": {
"command": "cmd",
"args": ["/c", "npx", "@elad-nofy/prometheus-mcp"],
"env": {
"PROMETHEUS_URL": "http://your-prometheus-server:9090"
}
}
}
}macOS / Linux:
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": ["@elad-nofy/prometheus-mcp"],
"env": {
"PROMETHEUS_URL": "http://your-prometheus-server:9090"
}
}
}
}Amazon Q Developer
Add to %USERPROFILE%\.aws\amazonq\agents\mcp.json:
{
"mcpServers": {
"prometheus": {
"command": "cmd",
"args": ["/c", "npx", "@elad-nofy/prometheus-mcp"],
"env": {
"PROMETHEUS_URL": "http://your-prometheus-server:9090"
}
}
}
}Environment Variables
Variable | Required | Description |
| Yes | Prometheus server URL (e.g., |
| No | Basic auth username |
| No | Basic auth password |
Available Tools
Health & Targets
Tool | Description |
| Test connection to Prometheus |
| List all scrape targets and health status |
| Get health of specific target by job/instance |
Queries
Tool | Description |
| Execute PromQL instant query (current value) |
| Execute PromQL range query (time series) |
| Query Windows server metrics (CPU, memory, disk, network, services) |
| Query Linux server metrics (CPU, memory, disk, network, load, filesystem) |
| Query endpoint probe results |
Metrics
Tool | Description |
| List all available metric names |
| Get metric type and help text |
| Get all values for a label |
| Find time series matching a selector |
Alerts & Rules
Tool | Description |
| List firing/pending alerts |
| Get alerting rules and states |
| Query alert state changes over time |
| Get recording rules (pre-computed queries) |
Status & Info
Tool | Description |
| Get Prometheus version, runtime info, config, and flags |
| Get TSDB statistics (cardinality, memory usage, top metrics) |
Usage Examples
Once configured, you can ask your AI assistant questions like:
"Are all Prometheus targets healthy?"
"Show me the CPU usage of server1 over the last hour"
"What alerts are currently firing?"
"List all metrics containing 'http'"
"Check the memory usage on my Windows servers"
"What's the load average on my Linux servers?"
"Is the website responding? Check blackbox_exporter"
"What version of Prometheus is running?"
"Show me the top metrics by cardinality"
"What recording rules are configured?"
Example Queries
Check target health:
What's the health status of all Prometheus targets?Query CPU usage:
Show me the CPU usage on instance "server1:9182" for the last 30 minutesFind metrics:
List all metrics related to HTTP requestsCheck alerts:
Are there any firing alerts? Show me the detailsDevelopment
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run devTroubleshooting
Connection errors
Verify
PROMETHEUS_URLis correct and accessibleCheck if basic auth is required and credentials are correct
Ensure your network allows connection to the Prometheus server
Query errors
Verify the PromQL syntax is correct
Check if the metric exists using
list_metricsEnsure the time range is valid
No data returned
Verify the target is being scraped
Check if the metric has data for the requested time range
Use
list_targetsto verify scrape status
License
MIT
Available Tools
18 toolsfind_seriesC
Find time series matching a label selector
Inputs: match (required), end, start.
get_alert_historyC
Query alert state changes over time using ALERTS metric
Inputs: alertname, timeRange.
get_alert_rulesC
Get all alerting rules and their current states
Inputs: group, state.
get_label_valuesA
Get all values for a specific label (e.g., all job names, all instances)
Inputs: label (required).
get_metric_metadataA
Get metadata (type, help text) for a specific metric or all metrics
Inputs: metric.
get_prometheus_statusB
Get Prometheus server status including version, runtime info, and configuration
Inputs: include.
get_recording_rulesB
Get all recording rules (pre-computed queries) and their current states
Inputs: group.
get_target_healthB
Get health status of a specific target by job name and/or instance
Inputs: job, instance.
get_tsdb_statusB
Get Prometheus TSDB (Time Series Database) statistics including cardinality and memory usage
Inputs: limit.
list_alertsC
List all currently firing or pending alerts
Inputs: state.
list_metricsC
List all available metric names in Prometheus
Inputs: limit, search.
list_targetsC
List all scrape targets and their health status (up/down)
Inputs: health.
query_blackbox_exporterC
Query probe results from blackbox_exporter for endpoint monitoring
Inputs: module, target.
query_instantA
Execute a PromQL instant query to get the current value of metrics
Inputs: query (required), time.
query_node_exporterC
Query common Linux metrics from node_exporter (CPU, memory, disk, network, load)
Inputs: metric (required), instance (required), timeRange.
query_rangeB
Execute a PromQL range query to get time series data over a time range
Inputs: query (required), start (required), end, step.
query_windows_exporterB
Query common Windows metrics from windows_exporter (CPU, memory, disk, etc.)
Inputs: metric (required), instance (required), timeRange.
test_connectionB
Test connection to Prometheus and verify it is accessible
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools target a distinct resource/action (targets, alerts, rules, TSDB, queries), and the exporter-specific helpers (node/windows/blackbox) are clearly labeled by domain. Minor overlap exists between list_targets and get_target_health, and between list_metrics, get_metric_metadata, find_series, and get_label_values, but descriptions clarify boundaries.
All snake_case with predictable verb_noun form (list_targets, get_alert_rules, query_range). The verb set varies (test/list/get/query/find) but each verb is used sensibly; query_instant and query_range are a slight outlier pairing versus the get_* family but remain readable and consistent with each other.
18 tools is on the heavier side but each maps to a concrete Prometheus concept (targets, alerts, rules, TSDB, status, query types, exporter shortcuts). The three exporter convenience wrappers duplicate what query_instant could do, which is slightly redundant, but overall the set is well scoped.
Covers the core lifecycle: connectivity, target/health discovery, instant and range PromQL queries, metric/label/series exploration, alerts and rule inspection, and server/TSDB status. Minor gaps exist (e.g., no label-name listing distinct from label values, no config reload or admin/series-deletion operations), but agents can work around them.
Maintenance
Related MCP Connectors
Read-only Google Analytics 4 MCP server for AI assistants.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Read-only MCP for AI usage profiles, leaderboards, stats, and docs; no writes or private data.
Read-only Google Search Console MCP server for AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to execute PromQL queries and discover metrics across multiple Prometheus tenants using the Model Context Protocol. It supports single and multi-tenant configurations with secure authentication for instant and range query analysis.MIT
- AlicenseNot gradedqualityDmaintenanceProvides access to Prometheus metrics and queries, allowing AI assistants to execute PromQL queries and analyze metrics data through standardized MCP interfaces.MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to inspect FOSSA organizations and answer software composition analysis questions through a read-only MCP server.1001Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server that enables AI assistants to query and analyze Prometheus metrics through PromQL, with support for metric discovery and authentication.MIT