- Home
- MCP servers
- Prometheus
Prometheus
- typescript
5
GitHub Stars
typescript
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"weetime-prometheus-mcp-server": {
"command": "/path/to/prometheus-mcp-server/build/index.js",
"args": [],
"env": {
"PROMETHEUS_BASE_URL": "http://your-prometheus-instance:9090"
}
}
}
}You run a specialized MCP server that connects Claude to your Prometheus instance, enabling you to run instant and range queries, discover series, explore labels, and access status and metadata from Prometheus through a unified MCP interface.
How to use
Start the MCP server locally and point it at your Prometheus instance using the PROMETHEUS_BASE_URL environment variable. Then configure Claude to connect to the MCP server so you can invoke a consistent set of Prometheus-related functions from your assistant.
How to install
Prerequisites you need before installation:
- Node.js installed (recommended version depends on your environment).
- npm installed (comes with Node.js).
Install the MCP server globally or locally, or run it via npx.
npm install -g prometheus-mcp-server
# or install locally
npm install prometheus-mcp-server
# or run without installation
npx prometheus-mcp-server
Configuration and runtime
Configure the MCP server to point to your Prometheus instance by setting the PROMETHEUS_BASE_URL environment variable. You can run the server with a direct command or via an absolute path to the built index file, and you provide the Prometheus URL via the environment.
PROMETHEUS_BASE_URL=http://your-prometheus-instance:9090 prometheus-mcp-server
Using with Claude
In Claude, add an MCP server entry that points to how you run the MCP server and supply the Prometheus URL. The example below demonstrates a local path to the built MCP server with the Prometheus URL configured via environment variables.
{
"mcpServers": {
"prometheus-mcp-server": {
"command": "/path/to/prometheus-mcp-server/build/index.js",
"env": {
"PROMETHEUS_BASE_URL": "http://your-prometheus-instance:9090"
}
}
}
}
How to use the available functions
Once running, you can call the MCP functions to interact with Prometheus. The server exposes a set of methods to perform instant and range queries, discover series by label matchers, fetch label values, retrieve metric metadata, obtain target information, and view alerts, rules, and status.
Additional configuration for Claude (npx usage)
If you prefer using npx to run the MCP server from Claude, configure Claude with an npx command and the same environment variable for Prometheus.
{
"mcpServers": {
"prometheus-mcp-server": {
"command": "npx prometheus-mcp-server",
"env": {
"PROMETHEUS_BASE_URL": "http://your-prometheus-instance:9090"
}
}
}
}
Troubleshooting and notes
If you encounter connection issues, verify that PROMETHEUS_BASE_URL is reachable from the MCP server host, and confirm there are no network policies blocking access to Prometheus. Check that the MCP server process has started and is listening for stdio or HTTP connections as configured.
Security and access
Limit access to the MCP server by restricting Claude’s configuration to trusted environments and applying network security controls to the Prometheus endpoint. Do not expose the MCP server to untrusted networks without proper authentication and access controls.
Notes on development and testing
You can build and start the server in development mode for debugging. Typical workflows involve installing dependencies, building, and starting, with debugging options available for inspecting the MCP interface.
Tooling and endpoints
The MCP server provides a set of functions to access Prometheus data programmatically. These include instant and range queries, series discovery, label exploration, metadata access, target information, and status and rule information.
Available tools
mcp__instant_query
Execute an instant PromQL query at a specific time and returns the result.
mcp__range_query
Execute a range PromQL query over a time interval and returns series data.
mcp__get_series
Find Prometheus series by label matchers.
mcp__get_label_values
Retrieve possible values for a given label across metrics.
mcp__get_metadata
Fetch metadata for metrics, including help text and type.
mcp__get_targets
Get information about scrape targets and their statuses.
mcp__get_alerts
Get information about alerts and recording rules.
mcp__get_rules
Query recording and alerting rules available in Prometheus.
mcp__get_status
Obtain current status information from the Prometheus server.