Repository navigation
Description
Order: slice 3's real-AS-1 ticket (#2607) blocks only the tickets that need it, not the whole slice. #2534 has no open dependency and no ToolHive dependency; #2535 after #2534, against the real AS-1 and the real ToolHive AS-2; #2738 (AS-2 startup wiring) has no open dependency; #2533 after #2738, #2535, and its ToolHive issues; #2654 after #2534 and #2607; #2536 after #2738 and #2535 (its slice test also needs #2533); #2537 has no open dependency; #3019 after a ToolHive release with stacklok/toolhive#7347. Operator configuration and keys (#2538) moved to slice 7 (#2815).
Sequence, one person per stream:
- identity broker: Mecatl's actor-token validator #2534 (PR feat(identitybroker): verify an agent credential for a grant's owner #2733) → Test session open against the real AS-1, not the harness's #2677 → Per-call grant and gateway token #2535. Mecatl's actor-token validator #2534 doesn't touch the test harness; Test session open against the real AS-1, not the harness's #2677 and Per-call grant and gateway token #2535 both change it, so Test session open against the real AS-1, not the harness's #2677 lands first;
- MCP broker client: MCP broker authorizes gateway calls and sends them to the configured gateway #2536 → Carry the vMCP resource on the gateway, and list gateway tools over HTTP #2728 → List gateway tools with a broker-issued token #2729 (slice 5). They change the same sending code; MCP broker authorizes gateway calls and sends them to the configured gateway #2536 starts the
Gatewayinterface and Carry the vMCP resource on the gateway, and list gateway tools over HTTP #2728 completes it. The ToolHive track (Phase 1, Track: ToolHive — The authorization server and gateway changes the phase 1 flow needs #2543) is done: Mecatl pins v0.70.1.
Who the user is: see credentials-and-lifecycle.md: Identifying claim (sub_id for ownership, upstream_subject at the gateway) and mcp-gateway-modes.md: How AS-2 resolves the user. Embedded approval is implicit by configuration (the subject mode in stacklok/toolhive#6887); external approval is #2539.
Problem
MCP calls reach the gateway with the MCP broker's own per-session OAuth grants, unchecked by the identity broker and naming no agent, and the gateway has no way to obtain a user's provider credentials without its own sign-in.
Design
- credentials-and-lifecycle.md: (6) Per-operation authorization
- credentials-and-lifecycle.md: (7) ID-JAG from AS-1
- credentials-and-lifecycle.md: (8) AS-2 access token
- credentials-and-lifecycle.md: Identifying claim
- mcp-gateway-modes.md: Embedded mode
Delivers
Every gateway call is authorized by the identity broker and carries a gateway token from a per-call grant naming the user and the agent; without one, the call is refused. mecak8s's MCP client sends the call; the identity broker returns a new gateway token for each call and never sends calls itself. The token is not yet bound to the call; binding it is phase 2 (mcp-authorization.md, "Authorization, credentials, and dispatch"). Users connect provider accounts at the embedded gateway. Running on operator configuration and keys is slice 7 (#2815).
One config-driven gateway path. A gateway is a configuration entry: its authorization server (AS-2), its vMCP resource, and the servers routed to it. The embedded gateway, the ToolHive gateway that runs inside mecak8s while the broker does (its own deployment once the broker is separate; mcp-gateway-modes.md, "Embedded mode"), is one entry. Phase 1 supports only the embedded gateway; a gateway Mecatl does not run is another entry, needing no new dispatch code, and is phase 3 (#2810).
Tickets
- Test session open against the real AS-1, not the harness's #2677 Test session open against the real AS-1, not the harness's (identity broker tests; limits the harness to what ToolHive cannot do yet)
- Wire the embedded gateway's authorization server into startup as AS-2 #2738 Wire the embedded gateway's authorization server into startup as AS-2 (Mecatl: MCP broker's embedded gateway and startup wiring; no ToolHive dependency)
- Configure the embedded gateway's authorization server as AS-2 #2533 Configure the embedded gateway's authorization server as AS-2 (Mecatl: MCP broker's embedded gateway)
- Mecatl's actor-token validator #2534 Mecatl's actor-token validator (identity broker; its tests use no AS-1)
- Register Mecatl's actor-token validator at hosted AS-1 #2654 Register Mecatl's actor-token validator at hosted AS-1 (identity broker's AS-1 adapter)
- Retire the harness's fake AS-1: identity tests use the real AS-1 #2858 Retire the harness's fake AS-1: identity tests use the real AS-1 (identity broker tests)
- Per-call grant and gateway token #2535 Per-call grant and gateway token (identity broker)
- MCP broker authorizes gateway calls and sends them to the configured gateway #2536 MCP broker authorizes gateway calls and sends them to the configured gateway (Mecatl: MCP broker dispatch)
- Connect provider accounts at the embedded gateway #2537 Connect provider accounts at the embedded gateway (Mecatl: MCP broker's embedded gateway and authorization flow)
- MCP client re-sends a tool call after a connection drop #2734 MCP client re-sends a tool call after a connection drop (Mecatl: shared MCP client; no dependency)
- Bind AS-2's stored company identities to their IdP and claim #3019 Bind AS-2's stored company identities to their IdP and claim (Mecatl: ToolHive bump, after Bind provider-identity rows to their issuer and claim toolhive#7347 is released)
Conflicts: #2738, #2533, #2536, and #2537 all change the MCP broker; one person takes them, in order. #2534 and #2535 are identity broker code, but #2535 also changes internal/app/identitybroker.go (the parts struct, the late-bound AS-2 port, shutdown order), as do #2536 (buildMCPBroker), #2538 (the interim configuration) and #2654 (a late-bound validator): #2535's parts struct lands first, and #2654 reuses its late-binding pattern; #2654 registers #2534's validator where mecak8s hosts AS-1. #2538 changes configuration and the Helm chart.
Testable result
Against the real AS-1 with the offline IdP, a real Mecatl session's MCP call gets a grant and a gateway token and reaches the gateway with it; a call for a closed or unowned session, or from an unregistered agent, is refused before dispatch; a reused grant is refused at AS-2; a user with a connected provider gets their own credential, a user who has never signed in at the gateway is parked at tool listing with the connect link, and after signing in their call uses their own credential ("Connect provider accounts at the embedded gateway" (#2537)). The link for a missing connection is phase 2; asking before the call is phase 3 ("Ask users to connect a provider before the call (authorization pending)" (#2592)).
Done when
All the tickets above are merged, the slice test passes, and gateway calls fail closed without a gateway token.
Activity