prometheus-mcp-server
3
The Prometheus MCP Server allows large language models to interface with a Prometheus instance using APIs to execute queries and analyze data. It provides tools for metrics management and alert handling.
Prometheus MCP Server
About
This is an MCP server to allow LLMs to interact with a running Prometheus instance via the API to do things like generate and execute promql queries, list and analyze metrics, etc.
Tools
Tool Name | Description |
---|---|
alertmanagers | Get overview of Prometheus Alertmanager discovery |
build_info | Get Prometheus build information |
execute_query | Execute an instant query against the Prometheus datasource |
flags | Get runtime flags |
list_alerts | List all active alerts |
list_rules | List all alerting and recording rules that are loaded |
list_targets | Get overview of Prometheus target discovery |
runtime_info | Get Prometheus runtime information |
tsdb_stats | Get usage and cardinality statistics from the TSDB |
wal_replay_status | Get current WAL replay status |
Resources
Not implemented yet
Prompts
Not implemented yet
Usage
Local LLM with Ollama
See for an example MCP config for use with tooling.
Requires ollama
to be installed.
Using MCP Inspector and a local ollama instance:
Requires MCP Inpsector to be installed:
make inspector
Development
Required software:
- Working Go environment
- Podman for local tests/linting/etc
- GNU Make
- ollama
- mcp inspector
- mcphost
~/go/src/github.com/tjhop/prometheus-mcp-server (main [ ]) -> make
# autogenerate help messages for comment lines with 2 `#`
help: print this help message
tidy: tidy modules
fmt: apply go code style formatter
lint: run linters
binary: build a binary
build: alias for `binary`
test: run tests
container: build container image with binary
image: alias for `container`
podman: alias for `container`
docker: alias for `container`
mcphost: use mcphost to run the prometheus-mcp-server against a local ollama model
inspector: use inspector to run the prometheus-mcp-server