Skip to content

feat(server): add MCP server for telemetry analysis#236

Draft
mbrobbel wants to merge 2 commits into
rapidsai:mainfrom
mbrobbel:mcp
Draft

feat(server): add MCP server for telemetry analysis#236
mbrobbel wants to merge 2 commits into
rapidsai:mainfrom
mbrobbel:mcp

Conversation

@mbrobbel

Copy link
Copy Markdown
Member

Expose the query-engine analyzer surface over the Model Context Protocol so agents can connect to a running quent server and explore telemetry.

The MCP server is generic over UiAnalyzer and reuses the existing ServiceState (analyzer + timeline caches), so out-of-repo analyzers get it for free. It is gated behind a new mcp feature on quent-query-engine-server, alongside the existing swagger/ui features.

Two transports:

  • HTTP: a streamable-HTTP service mounted at /mcp on the Axum analyzer router. rmcp's loopback-only Host allowlist (a DNS-rebinding guard) is kept by default; non-local deployments opt in via QUENT_MCP_ALLOWED_HOSTS (comma-separated hosts, or * to disable). When CORS is enabled the layer also allows the MCP session/protocol and SSE-resume headers.
  • stdio: serve_stdio plus a quent-simulator-mcp example binary.

Tools mirror the REST endpoints (list_engines, get_engine, list_query_groups, list_queries, get_query, single_timeline) and add agent-friendly summaries (engine_overview, plan_tree, slowest_operators).

The simulator example shares importer/lister setup between its HTTP and stdio binaries via a new lib.rs; default-run keeps cargo run on the HTTP server when the mcp feature adds a second binary.

Expose the query-engine analyzer surface over the Model Context Protocol
so agents can connect to a running quent server and explore telemetry.

The MCP server is generic over `UiAnalyzer` and reuses the existing
`ServiceState` (analyzer + timeline caches), so out-of-repo analyzers get
it for free. It is gated behind a new `mcp` feature on
`quent-query-engine-server`, alongside the existing `swagger`/`ui` features.

Two transports:
- HTTP: a streamable-HTTP service mounted at `/mcp` on the Axum analyzer
  router. rmcp's loopback-only Host allowlist (a DNS-rebinding guard) is
  kept by default; non-local deployments opt in via
  `QUENT_MCP_ALLOWED_HOSTS` (comma-separated hosts, or `*` to disable). When
  CORS is enabled the layer also allows the MCP session/protocol and
  SSE-resume headers.
- stdio: `serve_stdio` plus a `quent-simulator-mcp` example binary.

Tools mirror the REST endpoints (list_engines, get_engine,
list_query_groups, list_queries, get_query, single_timeline) and add
agent-friendly summaries (engine_overview, plan_tree, slowest_operators).

The simulator example shares importer/lister setup between its HTTP and
stdio binaries via a new `lib.rs`; `default-run` keeps `cargo run` on the
HTTP server when the `mcp` feature adds a second binary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mbrobbel mbrobbel added feature request New feature or request non-breaking Introduces a non-breaking change labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant