Prometheus MCP Server
Provides tools for querying real-time and historical metrics data, discovering available metrics, retrieving metric metadata, and monitoring scrape targets from Prometheus monitoring systems.
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 show me the current CPU usage across all servers"
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 that provides seamless integration with Prometheus, enabling AI assistants to query metrics, discover available data, and analyze system performance through natural language interactions.
Features
Real-time Metrics Access - Query current and historical metrics data
Metrics Discovery - Find available metrics and monitoring targets
Multiple Auth Methods - Basic auth, bearer tokens, and TLS support
Type-safe - Full TypeScript implementation
Related MCP server: Prometheus MCP Server
MCP Configuration
Using npx (Recommended)
Add to your MCP client settings:
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": ["prometheus-mcp-server"],
"env": {
"PROMETHEUS_URL": "http://localhost:9090"
}
}
}
}Using global installation
First install the package globally:
npm install -g prometheus-mcp-serverThen configure your MCP client:
{
"mcpServers": {
"prometheus": {
"command": "prometheus-mcp-server",
"env": {
"PROMETHEUS_URL": "http://localhost:9090"
}
}
}
}Environment Variables
# Required
PROMETHEUS_URL=http://localhost:9090
# Optional Authentication
PROMETHEUS_USERNAME=admin
PROMETHEUS_PASSWORD=password
PROMETHEUS_TOKEN=bearer-token
# Optional Connection
PROMETHEUS_TIMEOUT=10000
PROMETHEUS_INSECURE=falseAvailable Tools
Tool | Description | Use Case |
| Execute PromQL instant query | Get current metric values, alerts status |
| Execute PromQL range query | Analyze trends, create graphs, historical data |
| Discover available metrics | Explore what metrics are available in your system |
| Get metric metadata | Understand metric types, descriptions, and units |
| Get scrape targets info | Monitor scraping health and service discovery |
Example Usage
Ask your AI assistant natural language questions:
"What's the current CPU usage across all servers?"
"Show me HTTP request rates for the last 6 hours"
"Which services have the highest memory consumption?"
"Are there any failing health checks?"
"What metrics are available for monitoring my database?"
Development
# Run with inspector
npm run inspector
# Run directly
npm run devConnection Methods
1. No Authentication
export PROMETHEUS_URL=http://localhost:90902. Basic Authentication
export PROMETHEUS_URL=http://localhost:9090
export PROMETHEUS_USERNAME=admin
export PROMETHEUS_PASSWORD=secret3. Bearer Token
export PROMETHEUS_URL=https://prometheus.example.com:9090
export PROMETHEUS_TOKEN=your-bearer-tokenAdditional Options
For self-signed certificates or development:
export PROMETHEUS_INSECURE=trueLicense
MIT
Available Tools
5 toolsprom_discoverC
Discover all available metrics
Inputs: no named parameters.
prom_metadataC
Get metric metadata
Inputs: metric.
prom_queryC
Execute a PromQL instant query
Inputs: query (required), time, includes.
prom_rangeC
Execute a PromQL range query
Inputs: query (required), start (required), end (required), step (required), +1 more.
prom_targetsD
Get scrape target information
Inputs: state.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: discovery, metadata retrieval, instant queries, range queries, and target monitoring. There is no overlap in functionality, making it easy for an agent to select the right tool for each task without confusion.
All tools follow a consistent 'prom_' prefix with descriptive suffixes (discover, metadata, query, range, targets). This uniform naming pattern enhances readability and predictability across the tool set.
With 5 tools, this server is well-scoped for Prometheus monitoring tasks. Each tool serves a specific, essential function in the domain, and the count is neither too sparse nor overwhelming for the intended purpose.
The tool set covers core Prometheus operations well, including querying, metadata, and target discovery. A minor gap exists in lacking explicit alert or rule management tools, but agents can still perform most monitoring workflows effectively with the provided tools.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
The Polar Signals MCP server enables AI assistants to connect directly with performance profiling data, allowing users to analyze application performance through natural language queries. Key capabilities include querying CPU performance and memory usage, exploring profiling metadata like profile types and labels, and providing AI-driven code optimization suggestions directly within development environments like Claude Code or Cursor.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables Large Language Models to retrieve, analyze, and query metric data from Prometheus databases through pre-defined routes.33MIT
- AlicenseAqualityBmaintenanceProvides access to Prometheus metrics and queries through standardized Model Context Protocol interfaces, allowing AI assistants to execute PromQL queries and analyze metrics data.6526MIT
- AlicenseNot gradedqualityDmaintenanceA tool that enables access to Prometheus metrics data through a Model Context Protocol server, allowing interaction with monitoring data using natural language.MIT
- 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