Skip to content

docs(design): propose a separate MCP broker service for mecak8s - #1905

Closed
jhrozek wants to merge 1 commit into
mainfrom
design/mcp-broker-service
Closed

jhrozek wants to merge 1 commit into
mainfrom
design/mcp-broker-service

Conversation

@jhrozek

@jhrozek jhrozek commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a design proposal, docs/design/mcp-broker-service.md, for moving the MCP broker (ToolHive plus mecatl's session wrapper) out of mecak8s agent pods into a separate singleton mecabroker service.
  • Why: today every connected user's upstream OAuth tokens are reachable from the agent process and from the session-store Redis every agent pod can read, and broker state forces the whole mecak8s deployment to one replica with a Recreate rollout.
  • The doc covers who authenticates to whom, the four bindings that connect a tool call to its state (deployment, session, call, user), restarts with encrypted retained tokens, owners and grant holders, what the change protects against, alternatives, and costs. A separate section covers future iterations: per-call user checks through RFC 8693 delegated tokens, grants for schedules and long runs, broker-side user login, agent-definition identity, external vMCP, and a shell in mecak8s.
  • Indexed from docs/design/README.md.

Development stage

  • Plan / Interface
  • Implementation
  • Combined
  • Spike / Routine / Cleanup — acceptance-plan spine exempt

Contract linkage

  • Work classification: Routine
  • Classification rationale: documentation-only design proposal; no code, interface, or behavior change. The implementation is Architectural and will get its own acceptance plan and ADR after this design is reviewed.
  • Decision record: None — this records a proposal for discussion; decisions will be recorded as ADRs with the acceptance plan.
  • Human waiver of spine: No
  • Acceptance plan: N/A (follows this design)
  • Human decisions resolved and recorded: N/A — design review is the purpose of this PR
  • Plan / Interface PR: N/A
  • Approved commit baseline: N/A
  • Combined/exemption rationale: Routine docs change.

Interface conformance

  • None; no interface change.

Issue relationship

None.

Type of change

  • Documentation/process

Test plan

Baseline checks

  • Markdown changed: doc link checks (matlatl check . --strict: 0 broken links, 0 orphans) and go test ./docs/lint/ (citation and ADR checks) pass.

Runtime gates (task lint, task test, demo) are not applicable to a docs-only change.

User-facing change

None.

Special notes for reviewers

  • This describes the target design, not the current state of the implementation branch. Parts of it already exist on that branch; some existing code will need reshaping to match (for example, retained-token custody keyed to the grant holder with the guard held in the broker).
  • The security claim is deliberately narrow for the first release: no upstream token or client secret is ever in an agent pod, but a compromised agent pod can still use broker tools for any session. Narrowing that to active users is the first future iteration.
  • Open items called out in the doc: an approval step for schedule grants that a compromised pod can't fake, and keeping retained tokens alive after the session that created a schedule is gone.

@jhrozek
jhrozek force-pushed the design/mcp-broker-service branch from 18e7e29 to 672916d Compare October 5, 2026 12:10
Design for moving the MCP broker (ToolHive plus mecatl's session wrapper)
out of mecak8s agent pods into a separate singleton mecabroker service.

It explains the two problems this solves: upstream OAuth tokens reachable
from agent pods and the session-store Redis, and broker state pinning the
whole agent fleet to one replica. It then describes who authenticates to
whom, the four bindings that connect a tool call to its state (deployment,
session, call, user), restart behaviour with encrypted retained tokens,
owners and grant holders, what the change protects against, alternatives,
and costs.

A separate future-iterations section covers per-call user checks through
RFC 8693 delegated tokens, grants for schedules and long runs, broker-side
user login, agent-definition identity, external vMCP, and a shell in
mecak8s.

Co-Authored-By: mecatl <noreply@mecatl.dev>

docs(design): simplify broker session and enrollment ownership

Define opaque session references, broker-owned credential lifecycle, restart recovery boundaries, all-or-nothing enrollment, and enrollment-wide disconnect semantics.

Co-Authored-By: mecatl <noreply@mecatl.dev>
@jhrozek
jhrozek force-pushed the design/mcp-broker-service branch from 672916d to 1a85af2 Compare October 5, 2026 14:48
@jhrozek

jhrozek commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

This was superseded by PR #2121

@jhrozek jhrozek closed this Oct 13, 2026
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.

1 participant