Skip to content

Reach a server added by its address as the person the host app signed in - #2797

Merged
mxmzb merged 13 commits into
mainfrom
mcp-host-token-spec
Dec 2, 2026
Merged

mxmzb merged 13 commits into
mainfrom
mcp-host-token-spec

Conversation

@mxmzb

@mxmzb mxmzb commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Adds a way for a deployment with embedded sign-in to reach an MCP server added by its address as the person the host app signed in. OpenBot signs a short assertion about the person (RFC 7523 JWT bearer grant) and swaps it at the host's own token endpoint for an access token, which it sends to the server as Authorization: Bearer. No consent screen, no shared key.

  • replaceApp takes an optional hostToken ({ tokenEndpoint, scope? } or null). Absent keeps what the server has; null takes it away, exactly as entraScope. It can't go with credentialId, entraScope, tokenHeader or a sign-in of the server's own (400, VALIDATION_ERROR). tokenEndpoint is at most 2048 characters and scope at most 1024, the limits the server enforces.
  • App answers hostTokenEndpoint and hostTokenScope, null on every server not reached this way.
  • Only additions: oasdiff reports no breaking change; api:generate output committed with the sources (web app client; the mobile and Recorder clients are unchanged).
  • The web app shows such a server as reached as the person asking ("How this is reached", the token endpoint, no token to paste) rather than as a shared-token server, and counts it as needing no account of the person's own.
  • docs/configuration.md documents the assertion (header and claims), where OpenBot publishes its key (/.well-known/jwks.json), what the token endpoint must answer, caching, re-checks and requirements.

Checks: api:lint, oasdiff breaking (no breaking changes), api:live:diff, bun test api/ (145 pass), the app tests touching apps and generated models (1338 pass), typecheck, lint and format clean.

Changelog

Apps.

  • Added: an MCP server reached as the person the host app signed in. On a deployment with embedded sign-in, an administrator can set hostToken on a server added by its address (replaceApp). OpenBot then swaps a signed assertion about the person at the host's token endpoint for an access token, and calls the server as them. Apps now answer hostTokenEndpoint and hostTokenScope. See "Calling an MCP server as the person" in docs/configuration.md.

🤖 Generated with Claude Code

mxmzb added 3 commits December 2, 2026 16:41
…igned in

replaceApp takes an optional hostToken, { tokenEndpoint, scope }: on a
deployment with embedded sign-in, OpenBot swaps a short assertion about the
signed-in person at the host app's token endpoint (RFC 7523 JWT bearer grant)
and sends the access token it gets to the server. Absent keeps what the
server has, and null takes it away, as entraScope does. An app answers
hostTokenEndpoint and hostTokenScope, null on every server not reached this
way. The bundle and the web app's generated client are regenerated.
A subsection of Embedded sign-in: the assertion OpenBot signs and where its key is published, the JWT bearer request it sends to the host's token endpoint, what it needs back, caching and re-checks, how an administrator sets it on a server with hostToken, and what refuses it.
…sking, and say what the assertion's header and iat carry

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API side is clean and additive. hostToken on replaceApp is optional, and leaving it out keeps what the server has. hostTokenEndpoint and hostTokenScope are new response fields. No enum changes, nothing removed or made stricter, and oasdiff and the API spec job pass.

One change before merge

  1. The new "How this is reached / Host app" row hasn't been seen in a browser (app/src/components/manage/plugin-page.tsx:1147-1170).
    • The only test of the row is a pure connectionKindFor test.
    • The addition to moved-apps.test.ts passes without any code change, so it isn't a regression test.
    • Please add a browser test of that row, and put a screenshot of a person-host server's page next to the Entra one in the PR (Chrome and Safari).

Non-blocking: copy

  • One thing has three names:

    • the web app: "the app that signs them in to OpenBot" and "Host app" (plugin-page.tsx:1039, ~1167)
    • the backend's refusals to a person: "the app OpenBot is part of"
    • the admin refusals: "the app that embeds OpenBot"

    Pick one and use it everywhere (openbot-copy glossary: one word for one thing).

  • The person-host description at plugin-page.tsx:1039 runs to 30 words with a nested clause. Splitting it into two sentences would read better.

mxmzb added 2 commits December 2, 2026 23:37
… everywhere

Admin's page of a server reached through the app OpenBot is part of is now drawn in Chromium and
WebKit (reached-as-the-person-browser.test.tsx, in the WebKit job's list, which runs both engines).
It checks the Connection card's description, the "How this is reached" row's text, the token
endpoint under it and its badge, beside the Entra server's page for comparison, light and dark, wide
and on a phone. It fails against the previous copy and on main, where the row does not exist.

The row's badge is now the token endpoint's host (auth.example.com) instead of "Host app", and the
web app and the person-facing sentences in docs/configuration.md say "the app OpenBot is part of",
the name the backend's refusals already use. The embedded sign-in section says once that the docs
call it the host app. The card's description is split into two short sentences.

The moved-apps.test.ts addition is dropped. needsNoAccountOfYours never reads hostTokenEndpoint, so
the assertion restated the default for a server added by its address and passed with or without
this change. There is no code here for it to guard; the browser test covers what changed.
@mxmzb

mxmzb commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks Dave. Done in 28bf0c3, after merging main in 32e28ff:

  • Browser test: app/tests/reached-as-the-person-browser.test.tsx, with its fixture. It renders Admin's page for a server reached through the host's token endpoint and one reached through Entra. It checks the Connection description, the "How this is reached" row, the endpoint or scope under it, and the badge, and that nothing offers a token to paste or scrolls sideways. It runs in light and dark, at 1440 and 390, in Chromium and WebKit: 16/16 pass, and it fails against the old copy. It's listed in ci.yml's WebKit job, which runs both browsers.
  • The moved-apps.test.ts addition is dropped. needsNoAccountOfYours never reads hostTokenEndpoint, so that check couldn't fail.
  • One name: what a person reads now says "the app OpenBot is part of" everywhere. The backend's refusals in openbot-backend PR 1058 say the same. The badge shows the token endpoint's host (auth.example.com) instead of "Host app". The description is two short sentences. In docs/configuration.md, sentences written for the admin keep "host app", which the embedded sign-in section already defines; it now says what a person sees instead.
  • Screenshots of the two servers' pages in Chrome and Safari: coming in the description shortly.
  • Also noted: only an admin calling the API sets hostToken. No screen sets it yet.

@mxmzb

mxmzb commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

On the screenshots: rather than attaching images, the new browser test is the evidence. reached-as-the-person-browser.test.tsx renders both servers' pages in Chromium and WebKit, light and dark, at 1440 and 390, and checks the row's text, the endpoint and the badge. It runs in the WebKit CI job on every PR, and it fails against the old copy.

davidmckayv
davidmckayv previously approved these changes Dec 2, 2026

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 28bf0c3. The browser test now covers the row in Chromium and WebKit, light and dark, at 1440 and 390, and it fails on the old copy. One name runs through all the copy, and the dead moved-apps addition is gone. CI was cancelled by an unrelated WebKit timeout (artifacts-screens, Share audience), so rerun the failed jobs and queue it once it's green.

@mxmzb
mxmzb enabled auto-merge December 2, 2026 23:18

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at cbd85f8. It's a merge of the approved 28bf0c3 with main (99df719). The PR's own files are unchanged, and ci.yml keeps both the Report a bug comment and this PR's line and test entry.

@mxmzb
mxmzb added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit baadd3b Dec 2, 2026
39 checks passed
@mxmzb
mxmzb deleted the mcp-host-token-spec branch December 2, 2026 23:49
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.

2 participants