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 "Install 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 Servershow 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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yanmxa/prometheus-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server