
Prometheus MCP Server
io.github.prometheus由 GitHub 账号 prometheus 发布v0.19.0-rc.0更新于 Nov 3, 2026
一个API完整的MCP服务器,用于管理兼容Prometheus的后端。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
An API-complete MCP server to manage Prometheus-compatible backends.
发布方自己的服务:Prometheus MCP
概览
Prometheus 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 Prometheus MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Prometheus MCP Server
[license] [golangci-lint] [Latest Release] [GitHub Downloads (all assets, all releases)]
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.
Demos and Examples
Asking Claude to Investigate Slow Queries
The prompt used was:
querying my metrics is slow, can you help me figure out why?
[Demo prompt to ask claude to investigate slow queries]
Investigate metrics produced by the MCP server itself and suggest recording rules for SLOs
The prompt used was:
use the tools from the prometheus mcp server to investigate the metrics from the mcp server and suggest prometheus recording rules for SLOs
[Demo prompt to investigate metrics produced by the MCP server and create rules for SLOs]
Summarize Prometheus metric/label naming best practices
The prompt used was:
summarize prometheus metric/label name best practices
[Demo prompt to summarize prometheus metric and label name best practies]
Report on the health of the Prometheus instance that powers prometheus.demo.prometheus.io
The prompt used was:
please provide a comprehensive review and summary of the prometheus server. review it's configuration, flags, runtime/build info, and anything else that you feel may provide insight into the status of the prometheus instance, including analyzing metrics and executing queries
[Demo prompt to review the health of the demo.prometheus.io prometheus instance]
Tools
The Prometheus HTTP API outputs JSON data, and the tools in this MCP server return that JSON to the LLM for processing as it's structured and well understood by LLMs.
LLMs and Token/Context Efficiency
This MCP server supports the following options which have the potential to reduce token/context usage:
TOON Encoding
If token/context usage is a concern, this MCP server also supports converting the API's JSON data to the Token-Oriented Object Notation (TOON) format. While it is not guaranteed to reduce token usage, it is designed with token efficiency in mind. As noted on TOON's documentation, it excels at uniform arrays of objects; non-uniform/complex objects may still be more token-efficient in JSON. Real world token usage will depend on usage patterns, please review common workflows to determine if TOON output may be beneficial. Please see Flags for more information on the available flags and their corresponding environment variables.
API Response Truncation
This feature allows you to set a maximum limit on the number of lines or entries returned from the Prometheus API for, which can help in reducing the amount of data sent to the LLM.
Setting the limit to 0 disables truncation.
Truncation is disabled by default.
Note that LLMs capable of handling tool request arguments can override this global truncation limit on a per-tool-call basis for supported tools.
Please see Flags for more information on the available flags and their corresponding environment variables.
Full Tool List
NOTE:
Because the TSDB Admin API endpoints allow for potentially destructive operations like deleting data, they are not enabled by default. In order to enable the TSDB Admin API endpoints, the MCP server must be started with the flag
--dangerous.enable-tsdb-admin-toolsto acknowledge the associated risk these endpoints carry.
Tool Sets
The server exposes many tools to interact with Prometheus. There are tools to interact with Prometheus via the API, as well as additional tools to do things like read documentation, etc. By default, they are all registered and available for use (TSDB Admin API tools need an extra flag).
To be considerate to LLMs with smaller context windows, it's possible to pass in a whitelist of specific tools to register with the server.
The following 'core' tools are always loaded: [docs_list, docs_read, docs_search, runbooks_list, runbooks_read, query, range_query, metric_metadata, label_names, label_values, series].
Additional tools can be specified with the --mcp.tools flag.
For example, the command line:
Would result in the following tools being loaded:
build_infodocs_listdocs_readdocs_searchflagslabel_nameslabel_valuesmetric_metadataqueryrange_queryrunbooks_listrunbooks_readruntime_infoseries
Runbooks (Agent Skills) and Prompts
The server embeds a set of runbooks: guided workflows for common Prometheus tasks, expressed in terms of the server's tools. Each runbook orients the model on the relevant tools, then suggests topics to explore with example queries rather than prescribing a fixed sequence of steps. Runbooks cover tasks like system health checks, missing-data triage, error-rate investigation, high-cardinality optimization, recording/alerting rule review, and configuration/performance tuning.
Each runbook is packaged as a full Agent Skill: a directory containing a SKILL.md with name/description frontmatter.
Runbooks are exposed three ways:
- Tools: the model can discover and read them itself via the
runbooks_list/runbooks_readtools when a request matches a runbook's purpose. Tools are the most portable path and work in every MCP client. - Skill resources: per the SEP-2640 skills extension draft, each runbook is a
skill://<name>/SKILL.mdresource, enumerated by the well-knownskill://index.jsondiscovery index, and the server declares theio.modelcontextprotocol/skillsextension capability. Skill-aware hosts can consume these like local filesystem skills; other clients can still read them as ordinary MCP resources. - MCP prompts: each runbook is also registered as an MCP prompt under its skill name (e.g.
check-system-health,optimize-high-cardinality), so clients with prompt support can invoke a guided workflow directly (often surfaced as slash commands).
Prometheus Compatible Backends
There are many Prometheus compatible backends that can be used to extend prometheus in a variety of ways, often with the goals of offering long term storage or query aggregation from multiple prometheus instances. Some examples can be found in the Remote Storage of prometheus' docs.
Many of those services also offer a "prometheus compatible" API that can be used to query/interact with the data using native promQL. In general, this MCP server should at a minimum work for other prometheus API compatible services to execute queries and interact with the series/labels/metadata endpoints for metric and label discovery. Beyond that, there may be API differences as the different systems implement different parts/extensions of the API for their needs.
Examples:
- Thanos does not use a centralized config, so the config endpoint is not implemented and thus the config tool is removed.
- Mimir and Cortex implement extra endpoints to manage/add/remove rules
To workaround this and provide a better experience on some of the commonly used Prometheus compatible systems, this project may add direct support for select systems to provide different/more tools.
Choosing a specific prometheus backend implementation can be done with the --prometheus.backend flag.
The list of available backend implementations on a given release of the MCP server can be found in the output of the --help flag.
Qualifications and support criteria are still under consideration, please open an issue to request support/features for a specific backend for further discussion.
Prometheus Backend Implementation Differences
Resources
Installation and Usage
This MCP server is most useful when fully integrated with tooling and/or installed as a tool server with another system. Installation procedures and integration support will vary depending on the tools being used. For example:
- some systems can only interact with MCP tools and not resources/prompts
- some systems use mcp.json config file format to manage MCP servers and some require custom formats
- some systems don't speak MCP directly and require tools like mcp-to-openapi to proxy
Please check the documentation for the tool being used/integrated for specific instructions and level of support.
Transports
The server speaks MCP over stdio (the default) or HTTP (--mcp.transport=http, served at /mcp on the web listen address).
MCP protocol revisions 2024-11-05 through 2026-07-28 are supported, and the client chooses which one to use.
Over HTTP, only the Streamable HTTP transport is served; the older HTTP+SSE transport is not.
The HTTP transport is stateless: each request is handled on its own and no session is tracked, so replicas can sit behind any load balancer without session affinity. What follows from that:
- Only
POSTis served. The standaloneGETstream some clients open answers405 Method Not Allowed, which is harmless: everything the server sends rides the response to a request. - Keepalive pings (
--mcp.keepalive-interval) are only sent onstdio; there is no session to ping over HTTP. - A client that disconnects mid-call cancels the in-flight Prometheus query on current MCP revisions; older clients' calls run to completion.
--mcp.session-timeoutis deprecated and ignored.
--mcp.enable-client-logging forwards the log lines tool handlers emit to the client as MCP log notifications, in addition to the normal log output.
MCP has deprecated this feature. It keeps working during the deprecation window, but what a client receives is up to the client: newer clients must ask for a log level, and older clients over HTTP get info and above.
Binary
Download a release appropriate for your system from the Releases page. The commands below are for v0.19.0 and later; see the upgrade note below for earlier releases. Please see Flags for more information on the available flags and their corresponding environment variables.
Upgrading from v0.18.0 or earlier: as of v0.19.0 the binary is named prometheus-mcp (previously prometheus-mcp-server), and its environment variables use the PROMETHEUS_MCP_ prefix instead of PROMETHEUS_MCP_SERVER_.
The old variable names are ignored without an error, so rename them when you upgrade.
Docker
Please see Flags for more information on the available flags and their corresponding environment variables.
Helm Chart (Kubernetes)
A Helm chart is available for deploying to Kubernetes. The chart is published as an OCI artifact on each release.
See the chart README for the full list of configuration values and examples.
Kubernetes (Raw Manifests)
If you prefer deploying without Helm, example Kubernetes manifests are available:
Tarball with Systemd
Download the latest release tarball for your system from the Releases page. Tarballs include the binary and a Systemd service file.
The unit runs the HTTP transport on :8080 against the default --prometheus.url (http://127.0.0.1:9090); set other flags through their environment variables in the override, for example Environment=PROMETHEUS_MCP_PROMETHEUS_URL=https://prometheus.example.com:9090.
Note: As of v0.19.0, releases no longer include system packages (deb, rpm, or Arch Linux .pkg.tar.zst); use the tarball instead.
Packages for v0.18.0 and earlier remain available on their release pages.
Security and Authentication
Connecting to Secure Prometheus Instances
The MCP server supports Prometheus HTTP config files to connect to secured Prometheus instances.
An example config can be found in the examples folder here.
Use the --http.config command-line flag to provide an HTTP configuration file.
If the file cannot be read or is invalid, the server exits at startup instead of falling back to an unauthenticated client.
Please see Flags for more information.
Forwarding Client Credentials
When using the HTTP transport, the MCP server forwards the Authorization header on each MCP request to Prometheus for that request's API calls.
Requests that carry no Authorization header, and all requests over the stdio transport, use the default client built from flags (see Connecting to Secure Prometheus Instances).
The server forwards client credentials to Prometheus as-is and does not validate them.
A credential that does not include an auth scheme is sent as a Bearer token.
Anyone who can reach the MCP endpoint can query Prometheus with at least the default client's credentials, so restrict access to the endpoint with a web configuration file or network-level controls.
Note that basic authentication in the web configuration file (basic_auth_users) conflicts with credential forwarding: the same Authorization header a client uses to authenticate to the MCP server is then forwarded to Prometheus in place of the default client's credentials.
TLS-only web configurations do not use the Authorization header and are unaffected.
Securing the MCP Server Endpoints
The MCP server supports Prometheus Web Configuration files files to expose it's endpoints behind optional basic auth and custom TLS configs.
Use the --web.config.file command-line flag to provide an HTTP configuration file.
Please see Flags for more information.
Telemetry
Health Endpoints
The web server exposes health endpoints on the configured listen address, following the /-/healthy and /-/ready convention used across the Prometheus ecosystem:
These map directly onto Kubernetes liveness/readiness probes. The prom_mcp_server_ready metric reports the same readiness state.
Metrics
Once running, the server exposes Prometheus metrics on the configured listen address and telemetry path (:8080/metrics, by default).
Please see Flags for more information on how to change the listening interface, port, or telemetry path.
Prometheus MCP Server Metrics
Grafana Dashboard
A pre-built Grafana dashboard is included in the grafana/ directory for visualizing the metrics exposed by the MCP server. Import the dashboard json into grafana and it should be ready to go.
Logs
This project makes heavy use of structured, leveled logging. Please see Flags for more information on how to set the log format, level, and optional file.
The MCP go-sdk logs through a logger of its own: its warnings and errors show at the default level, and its per-request session bookkeeping only with --log.level=debug.
Development
Development Environment with Devbox + Direnv
If you use Devbox and Direnv, then simply entering the directory for the repo should set up the needed software.
Local LLM with Ollama
See mcp.json for an example MCP config for use with tooling.
Requires ollama to be installed.
NOTE:
To override the default LLM (
ollama:gpt-oss:20b), runexport OLLAMA_MODEL="ollama:your_model"to override it before runningmake.
Using MCP Inspector and a local ollama instance:
Requires MCP Inpsector to be installed:
Using mcphost and a local ollama instance:
Requires mcphost to be installed:
Gemini with gemini-cli
See settings.json for an example config file to run gemini-cli with prometheus-mcp.
Requires gemini-cli to be installed.
Using `gemini-cli` and hosted models:
Manual Setup
Required software:
- Working Go environment
- Docker for local tests/linting/image building/etc
- GNU Make
- ollama
- mcp inspector
- mcphost
Building
This project uses the standard Prometheus build tooling: promu
driven through Makefile / Makefile.common. The binary embeds a pinned
snapshot of prometheus/docs, which the build targets download and extract
automatically (the pin lives in DOCS_VERSION in the Makefile).
Project-specific helper targets (helm packaging and the local LLM client
integrations) are listed by make help:
Command Line Flags
The available command line flags are documented in the help flag:
来源:README.md,提交 b34d04d
工具
0版本历史
1- v0.19.0-rc.0最新Nov 3, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Prometheus 集成
Prometheus MCP
sv.prometheus官方发布者
Prometheus 提供的远程 MCP 端点,让 AI 助手在面向智能体与创作者的知识网络中搜索、评分和评论编程指南。

Prometheus MCP Server
由 GitHub 账号 tjhop 发布
让助手查询和检查 Prometheus 兼容后端的 MCP 服务器:PromQL 查询、标签、序列、规则、告警、目标与文档。

Prometheus MCP Server
由 GitHub 账号 pab1it0 发布
把 AI 助手连接到 Prometheus 服务器,使其能执行 PromQL 即时与范围查询,并浏览指标和抓取目标。

Prometheus Mcp
由 GitHub 账号 mshegolev 发布
只读 MCP 服务器,让助手用 PromQL 查询 Prometheus 指标、列出指标名、查看活动告警和抓取目标。

Mcp Prometheus
由 GitHub 账号 jeanlopezxyz 发布
一个本地 MCP 服务器,将助手连接到 Prometheus,使其能执行 PromQL 查询并诊断 Kubernetes/OpenShift 集群健康状况。