- Home
- MCP servers
- Prometheus
Prometheus
- go
26
GitHub Stars
go
Language
6 months ago
First Indexed
2 months 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": {
"tjhop-prometheus-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"ghcr.io/tjhop/prometheus-mcp-server:latest",
"--prometheus.url",
"https://$yourPrometheus:9090"
],
"env": {
"PROMETHEUS_MCP_SERVER_MCP_TRANSPORT": "stdio",
"PROMETHEUS_MCP_SERVER_PROMETHEUS_URL": "https://$yourPrometheus:9090",
"PROMETHEUS_MCP_SERVER_WEB_LISTEN_ADDRESS": ":8080"
}
}
}
}You run a Prometheus MCP Server to enable large language models to interact with a Prometheus instance through the API. It lets you generate and execute promql queries, inspect metrics, and leverage Prometheus capabilities directly from your MCP-enabled workflows.
How to use
You start the MCP server and connect an MCP client to issue Prometheus API calls. The server exposes tools that let you query metrics, inspect targets and rules, read documentation, and more. You can run the server in different transports (stdio or HTTP) and pass Prometheus connection details via flags or environment variables. Use core tools by default for efficient metric discovery, and add more tools as needed.
How to install
Prerequisites: you need a working Go environment for building from source, Docker for container-based runs, and access to a Prometheus instance you want to query.
Option A: Run with Docker (stdio transport) using a container image.
Option B: Run with Docker (streamable HTTP transport) to expose HTTP endpoints.
Follow the exact commands below to start the MCP server with a Prometheus URL. Replace the placeholder with your Prometheus URL.
Additional notes and configuration
The MCP server supports a broad set of tools to interact with Prometheus. By default, a core set of tools is loaded to provide essential capabilities. You can enable additional tools as needed. You can also pass in environment variables to control the Prometheus connection and server behavior.
Telemetry and security options are available. The server exposes metrics at the configured listen address and path, and you can secure access using TLS or authentication by providing a web configuration file.
Troubleshooting
If you encounter connection issues to Prometheus, verify the Prometheus URL is reachable from the MCP host and that any required TLS or authentication settings are provided via config options or environment variables.
If the MCP server reports missing tools or endpoints, confirm you loaded the desired tool set (core tools are loaded by default) and that you are using a Prometheus-compatible backend that exposes the expected API endpoints.
Available tools
alertmanagers
Get overview of Prometheus Alertmanager discovery
build_info
Get Prometheus build information
config
Get Prometheus configuration
docs_list
List of Official Prometheus Documentation Files
docs_read
Read a named markdown file from the official Prometheus docs
docs_search
Search Prometheus documentation files
exemplars_query
Query exemplars for a given time range
flags
Get runtime flags of the Prometheus server
healthy
Health check endpoint for Prometheus API
label_names
Return unique label names for a time range and matchers
label_values
Query values for a specific label over a time range
list_alerts
List all active alerts
list_rules
List all loaded alerting and recording rules
list_targets
Overview of target discovery
metric_metadata
Return metadata about metrics being scraped
query
Execute an instant query against Prometheus
quit
Graceful shutdown of Prometheus
range_query
Execute a range query against Prometheus
ready
Check if Prometheus is ready to serve traffic
reload
Reload Prometheus configuration and rules
runtime_info
Get Prometheus runtime information
series
Find series by label matchers
targets_metadata
Metadata about metrics scraped by targets
tsdb_stats
TSDB usage and cardinality statistics
wal_replay_status
Current WAL replay status
clean_tombstones
Remove deleted data and tombstones from disk
delete_series
Delete data for a selection of series in a time range
snapshot
Create a snapshot of current data in the TSDB