Prometheus MCP Server
概览
作者提供的说明(英文原文)
An API-complete MCP server to manage Prometheus-compatible backends.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i2 项中通过 2 项依据公开信息检查;尚未扫描代码
- 使用情况i起步阶段★ 138
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:2 项中通过 2 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
- Docker已安装 Docker
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/prom/prometheus-mcp:v0.19.0-rc.0"
]
}
}
}在终端中运行这条命令
claude mcp add prometheus -- docker run -i --rm docker.io/prom/prometheus-mcp:v0.19.0-rc.0或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/prom/prometheus-mcp:v0.19.0-rc.0"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"prometheus": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/prom/prometheus-mcp:v0.19.0-rc.0"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
哪些应用可以使用它
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月11日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 prometheus 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于前天
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5741 个服务器的 97%
- 发布到注册中心的时间比此分类中其他 5741 个服务器的 71% 更新
- 基础检查结果等于或优于此分类中其他 5741 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Prometheus MCP Server 安全吗?
它在 2 项适用的基础检查中通过了 2 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于前天,最新版本(0.19.0-rc.0)于8天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Docker。
有什么可以替代它?
同一分类中有:REA, Netdata, Front-End Checklist
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
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.
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?
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
Summarize Prometheus metric/label naming best practices
The prompt used was:
summarize prometheus metric/label name best practices
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
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
| Tool Name | Description |
|---|---|
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 the named markdown file containing official Prometheus documentation from the prometheus/docs repo |
docs_search | Search the markdown files containing official Prometheus documentation from the prometheus/docs repo |
exemplar_query | Performs a query for exemplars by the given query and time range |
flags | Get runtime flags |
healthy | Management API endpoint that can be used to check Prometheus health |
label_names | Returns the unique label names present in the block in sorted order by given time range and matchers |
label_values | Performs a query for the values of the given label, time range and matchers |
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 |
metric_metadata | Returns metadata about metrics currently scraped by the metric name |
query | Execute an instant query against the Prometheus datasource, returning one value per series at a single point in time |
quit | Management API endpoint that can be used to trigger a graceful shutdown of Prometheus |
range_query | Execute a range query against the Prometheus datasource, returning values over a time window |
ready | Management API endpoint that can be used to check Prometheus is ready to serve traffic (i.e. respond to queries |
reload | Management API endpoint that can be used to trigger a reload of the Prometheus configuration and rule files |
runbooks_list | List the runbooks embedded in this server: guided workflows (Agent Skills) for common Prometheus tasks |
runbooks_read | Read the named runbook by skill name (e.g. check-system-health) |
runtime_info | Get Prometheus runtime information |
series | Finds series by label matchers |
targets_metadata | Returns metadata about metrics currently scraped by the target |
tsdb_stats | Get usage and cardinality statistics from the TSDB |
wal_replay_status | Get current WAL replay status |
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 Name | Description |
|---|---|
clean_tombstones | Removes the deleted data from disk and cleans up the existing tombstones |
delete_series | deletes data for a selection of series in a time range |
snapshot | creates a snapshot of all current data into snapshots/ - under the TSDB's data directory and returns the directory as response |
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:
prometheus-mcp --mcp.tools=build_info --mcp.tools=flags --mcp.tools=runtime_info
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:// /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
| Backend |