Repository navigation
Description
Depends on: "Connect provider accounts at the embedded gateway" (#2537); "vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link" (stacklok/toolhive#7188) (URL elicitation with the
connect link for a missing connection, and the connect entry point);
"vMCP: keep a delegated session and route calls when the user has not connected a backend's provider" (stacklok/toolhive#7189) (the session kept and the call routed when the user
hasn't connected a backend's provider); "Embedded runner: an option to set NonFatalSecondaryLegs" (stacklok/toolhive#7370) (skipping a failed provider leg).
Removes shortcut: a backend the user has not connected is dropped from
the session (gateway_session_not_found with one backend, an unknown-tool
error with several), with no link, and a dead connection failing that
gateway's listing ("Connect provider accounts at the embedded gateway"
(#2537), "List gateway tools with a broker-issued token" (#2729)). The
call-time tool error counted as sent is removed separately, by "Tell a
gateway failure after the backend call from one before it" (#2822).
Also removes: a cancelled or failed provider leg fails a user's whole first
sign-in at the embedded gateway ("Configure the embedded gateway's
authorization server as AS-2" (#2533), "Connect provider accounts at the
embedded gateway" (#2537)).
Adds shortcut: the link arrives as connection_required after the
call fails, not as mcp_authorization_pending before it; removed by "Ask
users to connect a provider before the call (authorization pending)"
(#2592).
Problem. In phase 1 a user without a connection gets an error and has
to find the gateway's login themselves, and a user with no connection to
any of a gateway's backends cannot open a session at all.
Requirements.
- Signal (decided): MCP URL-mode elicitation from ToolHive's vMCP; Mecatl
adds no decorator. Mecatl's MCP client declares URL-mode elicitation
("MCP broker authorizes gateway calls and sends them to the configured gateway" (MCP broker authorizes gateway calls and sends them to the configured gateway #2536)). - The connect link is on AS-2's issuer origin (the entry point "vMCP:
answer a call for an unconnected provider with a URL elicitation carrying
the connect link" (vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link toolhive#7188) adds); Mecatl accepts a link
only from that origin, so a backend's own -32042 cannot plant one. - The link reaches the model as text, as the URL-mode answer from "MCP
broker authorizes gateway calls and sends them to the configured
gateway" (MCP broker authorizes gateway calls and sends them to the configured gateway #2536) already does. - Decide with "vMCP: keep a delegated session and route calls when the user has not connected a backend's provider" (vMCP: keep a delegated session and route calls when the user has not connected a backend's provider toolhive#7189): what the tool list shows for a
backend the user hasn't connected; record it in step (9). - Mecatl's catalogue accepts the tool view "vMCP: keep a delegated session and route calls when the user has not connected a backend's provider" (vMCP: keep a delegated session and route calls when the user has not connected a backend's provider toolhive#7189) chooses for an
unconnected backend: today it publishes only if every gateway lists, and
an empty listing raiseserrGatewayListedNoTools
(workspace_catalogue.go:193), so the catalogue code changes with it. - A user with no connection reaches the credential check and gets the
elicitation, whatever other backends the gateway has. - At a user's first sign-in at the embedded gateway, a provider whose
consent they cancel, or whose leg fails, is skipped: the sign-in still
completes and creates the user and the identity link, and that provider
stays unconnected until the user connects it through the link.
Done when. At the ToolHive release containing "vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link" (stacklok/toolhive#7188) and "vMCP: keep a delegated session and route calls when the user has not connected a backend's provider" (stacklok/toolhive#7189): a user
without a connection gets the URL elicitation with the gateway's link,
connects, and the next call uses their credential; a user with no
connection to a single-backend gateway still gets the elicitation instead
of gateway_session_not_found; a user who cancels one provider's consent
at their first sign-in still gets an account, and that provider's calls
get the link; the "Connect provider accounts at the embedded gateway" (#2537) shortcut row is removed.
Activity