Skip to content

proposal: adopt MCP server into prometheus org - #81

Merged
bwplotka merged 2 commits into
prometheus:mainfrom
tjhop:mcp-server
Jun 8, 2026
Merged

proposal: adopt MCP server into prometheus org#81
bwplotka merged 2 commits into
prometheus:mainfrom
tjhop:mcp-server

Conversation

@tjhop

@tjhop tjhop commented May 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

tjhop added 2 commits May 2, 2026 00:04
Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

@roidelapluie roidelapluie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, We can have rules support as a feature flag.

* **Configurable tool registration:** a small "core" toolset is always loaded; everything else can be allow-listed via `--mcp.tools`, so operators can tune what gets exposed to smaller-context LLMs.
* **Transports:** stdio, SSE, and streamable HTTP.
* **HTTP client configuration:** standard Prometheus HTTP config file, including bearer tokens, basic auth, mTLS, custom headers, etc. — i.e. it works with multi-tenant setups (Mimir/Cortex/GrafanaCloud) and TLS-protected Prometheus servers without bespoke flags.
* **Backend awareness:** `--prometheus.backend` selects per-backend behavior. Today that means a `thanos` backend that hides endpoints Thanos doesn't implement and adds a `list_stores` tool. The same mechanism is the path forward for Mimir/Cortex support.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the plan of supporting projects in the ecosystem... I imagine there will be nuances among those projects even for common tools.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would that be different from supporting multiple service discoveries in prometheus?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeya24 agreed, and tools are currently registered from a map, which allows for easy overriding. For instance, the thanos toolset right now just takes the tools from the prometheus toolset, skips the ones thanos doesn't support, and adds the list_stores tool:

https://github.com/tjhop/prometheus-mcp-server/blob/main/pkg/mcp/registration.go#L251-L266

And we hold onto the http.RoundTripper that is used to create the prometheus API client and provide wrapper functions so that implementations of custom endpoints are automatically instrumented with metrics + logging, etc.

Similar patterns can be used to override endpoints to pair a tool name with a backend-specific implementation. Cortex/Mimir support are on my radar as well, but they have a much larger API surface.

@roidelapluie functionality wise, I don't think it would be dramatically different. IMO, the bigger difference would be in operating patterns and the precedents that would set. Service discovery provides periodic updates from an external service in a read-only form, whereas adding this type of "backend" like service to Prometheus would move it closer to a proxy type solution. This is especially relevant when talking about supporting services like cortex/mimir which have endpoints to manage rules, and opens the pathway for Prometheus to be effecting change in other systems. Something that I think deserves a lot of weight if/when we consider integrating directly into Prometheus.

@bwplotka

Copy link
Copy Markdown
Member

This is on my radar, looks positive, but I need to dive into details

@bwplotka bwplotka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's value in having a high quality MCP tooling for people to contribute to and use.

My only worry is that the project is generally maintained by one person, so we have some bus factor here. But it's not so different than some other projects in our group, and @tjhop shown huge activity here.

@metalmatze

Copy link
Copy Markdown
Member

Given I'm maintaining the Polar Signals MCP (so I know quite a lot about the protocol), and I've contributed to this repository, I'm happy to help as a maintainer for this MCP if it helps with the bus factor. Obviously, if @tjhop and others are fine with that. I'd mostly be there for backup, support and having the option to get another review if wanted.

@bwplotka
bwplotka merged commit d4ad870 into prometheus:main Jun 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants