Skip to content

vMCP: keep a delegated session and route calls when the user has not connected a backend's provider #7189

Open

Description

@ChrisJBurns

Part of #6406. Depends on #6407; pairs with #7188.

Mecatl phase 2.

Problem: vMCP discovers a backend's capabilities with the caller's own outbound credential. For a delegated token whose user hasn't connected that backend's provider, discovery fails and the backend's tools disappear from the session. If no backend returns capabilities, aggregation fails with "no backends returned capabilities". On a 2025-11-25 session, vMCP ends the session during initialize: the client gets a session ID, and its next request gets 404. A 2026-07-28 client gets an internal error. With other backends present, a call for the missing tool gets an unknown-tool error. Either way the call never reaches the credential read, so the user is never told to connect.

Change: A "needs authorization" result during discovery for a delegated token neither removes the backend from routing nor ends the session. A tools/call for that backend's tool reaches the credential read and gets the connect answer. This issue settles how vMCP learns the tool names of a backend the user hasn't connected (for example, a capability view not tied to one user's credential, or tools the operator declares); whatever the choice, it must not expose another user's backend state. Other discovery failures behave as today.

Acceptance:

  • Delegated user, no connection, one backend: initialize succeeds, the session stays valid, and tools/call for that backend's tool gets the connect answer, not 404, an internal error, or an unknown-tool error.
  • Same, with a second, reachable backend: its tools work, and the unconnected backend's tool gets the connect answer.
  • After the user connects, the backend's tools work in the same session without re-initializing.
  • Session-mode behaviour is unchanged.

Activity

  1. added
    needs-triage
    on Nov 18, 2026
  2. removed
    needs-triage
    on Nov 24, 2026
  3. jhrozek commented on Nov 26, 2026

    @jhrozek
    Contributor

    Related: "vMCP: graceful degradation when one upstream IdP fails in
    multi-upstream auth" (#5162). With "Make secondary chain legs optionally
    non-fatal" (#7311), an interactive sign-in can also complete without a
    provider, and then hits the same discovery problem this issue fixes for
    delegated sessions. The fix here now covers interactive sessions as well
    (see the update on #5162).

  4. jhrozek commented on Nov 27, 2026

    @jhrozek
    Contributor

    Recording an open question for this issue that came up while reviewing the delegated credential error work (the branch that adds DelegatedAuthRequiredError / ErrDelegatedCredentialUnavailable to vMCP). We looked at it from the storage side and from the Mecatl side, and the two views don't agree yet on where the tool names come from.

    Where both views agree:

    • Phase 1 keeps today's behaviour as a documented limit: a backend whose delegated credential read fails during discovery is dropped from the view, so its tools come back as not found. The named delegated errors only show up when listing worked and the later call's read failed. The error-handling docs on that branch say so.
    • In this issue, a "needs authorization" during discovery should not drop the backend from routing or end the session, and the partial view should not be cached per identity. The call should reach the credential read.
    • The connect answer for the call should be the URL elicitation from "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 #7188). The isError "provider X requires upstream authorization" stays only as the fallback when there's no link. On that branch a URL elicitation already outranks it, so vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link #7188 doesn't need to rework the precedence.

    Where they differ: how vMCP learns the tool names of a backend the user hasn't connected.

    • Storage view: use a capability view that isn't tied to the user's credential, or tools the operator declares. A "last known" per-user view doesn't help a user who never connected the provider, and a view cached from another user breaks the "must not expose another user's backend state" rule. Any per-user view also has to stay inside the capability cache key (route, session binding, platform user).
    • Mecatl view: listing runs under the user's authority. The broker issues a V for the tools/list after the same session, workload and actor checks (the "Tool discovery" paragraph in mcp-authorization.md). Listing under a service credential would go against the rule there that missing connection or authorization evidence fails closed "without fallback to a service credential, another user, or a more privileged agent". So this view prefers keeping the backend advertised over discovering it with a different identity.

    The two may be closer than they look. Discovering with a service credential conflicts with the Mecatl rule. Operator-declared tool names don't use any credential, so that rule doesn't obviously apply to them, and they give the storage view an identity-free source. What this issue needs to decide:

    1. Is operator-declared (static) tool metadata an acceptable source for an unconnected backend, or does the design want listing to reflect only what the user's own credential can see?
    2. If the user's credential is the only source, an unconnected backend has no tool names to advertise, so the acceptance criteria above (call gets the connect answer rather than unknown-tool) can't be met for a user who never connected. Should the criteria change, or should the client be told about the backend some other way?
    3. From the Mecatl side: the -32042 data should carry the provider ID as a structured field, so the broker doesn't parse text. The design doesn't say that yet. It probably belongs with vMCP: answer a call for an unconnected provider with a URL elicitation carrying the connect link #7188, but it affects what this issue routes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions