Repository navigation
Conversation
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 07:05
d6d9c83 to
d48911f
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 07:05
38eb4d6 to
9a5978a
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 08:19
d48911f to
9374b2e
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
2 times, most recently
from
November 16, 2026 09:24
47cf9ff to
a4ce37f
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 10:42
209f536 to
9ed55c6
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
2 times, most recently
from
November 16, 2026 11:28
7154839 to
afd5c4c
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 11:28
9ed55c6 to
91b08e6
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 11:43
afd5c4c to
706ffcb
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 11:43
91b08e6 to
180211b
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 11:56
706ffcb to
b0c434d
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 11:56
180211b to
30d4ec9
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 12:07
b0c434d to
1a7e565
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
2 times, most recently
from
November 16, 2026 12:13
08a82f3 to
d59ef64
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
2 times, most recently
from
November 16, 2026 12:17
21d49bd to
67fb6a4
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
2 times, most recently
from
November 16, 2026 13:09
462e309 to
1a410e7
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
2 times, most recently
from
November 16, 2026 13:44
150c7ab to
76f1ec2
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
2 times, most recently
from
November 16, 2026 13:52
342f684 to
a613dc3
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 13:52
76f1ec2 to
867ee0b
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 16:12
867ee0b to
fe02f27
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 16, 2026 16:50
aed2e4b to
ee4438f
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 16, 2026 16:50
fe02f27 to
b850b3a
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 10:31
45af8e6 to
635b508
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 11:16
7ba55eb to
8cee71a
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 11:16
635b508 to
3624aaa
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 11:20
8cee71a to
337b305
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 11:20
3624aaa to
05c0255
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 12:27
337b305 to
dbe13ff
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 12:27
05c0255 to
67a568e
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 12:44
dbe13ff to
7ccbcc7
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 12:44
67a568e to
3c20741
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 13:05
7ccbcc7 to
ccd91a9
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 13:05
3c20741 to
39456ac
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 13:13
ccd91a9 to
d802e84
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
3 times, most recently
from
November 17, 2026 13:44
c937d8a to
feecd08
Compare
allozaur
added a commit
that referenced
this pull request
Nov 17, 2026
The tree is the integration's: develop is the stack's top plus the side branches.
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 15:28
feecd08 to
9fdf685
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 15:28
2274890 to
4646d3a
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 16:26
9fdf685 to
8420216
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 16:42
681d0a0 to
60bc00e
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 16:45
8420216 to
bf7520e
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 17:16
60bc00e to
bdf5041
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 17:16
bf7520e to
66e3372
Compare
allozaur
force-pushed
the
allozaur/feat/mcp-oauth-login
branch
from
November 17, 2026 17:20
66e3372 to
9fbcfb6
Compare
allozaur
force-pushed
the
allozaur/refactor/mcp-extension
branch
from
November 17, 2026 17:20
bdf5041 to
8b0405e
Compare
An MCP server that answers 401 and publishes an OAuth authorization server can now be signed in to, in the browser, with no server of our own: the MCP SDK's auth() runs discovery, dynamic client registration, PKCE, the code exchange and refresh, and an OAuthClientProvider here keeps the client, the tokens, the verifier and the discovery state per server in localStorage, apart from the settings so tokens never travel with a settings export. A connection in the background never opens a page or registers a client: it stops with "sign in to use this server", and a server whose 401 offers no sign-in says to add a token instead. A sign-in the user starts opens the authorization page in a popup (or this tab when it is blocked); the page comes back to the app's root, which exchanges the code, checks the state, and tells every tab on a BroadcastChannel, since the cross-origin isolated UI cuts the popup off from its opener. The server then connects again. Sign-out revokes the token where the authorization server allows it. An Authorization header the user set wins: such a server is never offered a sign-in. Through llama-server's CORS proxy the transport now keeps the real server URL and the fetch sends every request through the proxy, so the resource a token is asked for and the discovery URLs are the server's own. Mirrors Hugging Face chat-ui's MCP OAuth where a static app can, and builds on the earlier attempt on the fork by LPFchan. Assisted-by: Claude (Opus 5.5 Medium)
A server that needs a sign-in shows "Sign in with <authorization server>" on its card instead of the error its connection ended with. While the authorization page is open the card waits, with a way to give up; a server whose authorization server registers no apps asks for the client ID (and secret, if any) of an app the user registered there, with the redirect URL to register it under; a signed-in server says so and offers Sign out. Signing out, and deleting a server, revoke its tokens where the authorization server allows it, close its connection and take its tools out, so the card is back to the sign-in at once. The MCP server card story has a Sign-in state for each of these. Assisted-by: Claude (Opus 5.5 Medium)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
MCP servers that support OAuth can be signed in to from Llama Chat with the browser, as on Notion, Linear or Hugging Face, while a token in the server's Authorization field keeps working as before.
Additional information
Beside the work-in-progress stack on the fork, based on
allozaur/refactor/mcp-extension(#61), the MCP extension; like Model configuration beside the prompt library, it is not part of stack ggml-org#62. Its diff is only this layer. All of it is MCP extension code, insrc/lib/extensions/mcp/.It mirrors Hugging Face chat-ui's MCP OAuth where a static app can, and takes the browser-side approach of the earlier attempt on the fork by LPFchan (
allozaur/feat/mcp-oauth), rebuilt on the MCP SDK v2 and the extension.Known gaps:
localhostor a LAN address cannot offer. Servers that advertise one fall back to dynamic client registration.403 insufficient_scopeis left to the SDK's defaults, and a sign-in in one tab does not refresh what other tabs show until they hear the broadcast.How it works
auth()runs discovery, dynamic client registration, PKCE (S256), the code exchange and refresh. AnOAuthClientProviderkeeps the client, tokens, verifier, discovery state and a randomstateper server and URL in one localStorage entry, apart from the settings, so a settings export never carries tokens. Theresourceasked for is the server's URL.?mcp_oauth=1. That page load checks thestate, clears the code from the address bar, exchanges it and tells every tab on a BroadcastChannel; the UI is served cross-origin isolated, so a popup cannot reach its opener. A sign-in in this tab returns to the route it started from. The server then connects again with its token./cors-proxy. Before, the transport was given the proxy URL, from which the SDK would have derived the resource and the discovery URLs.error_descriptioncomes from the address bar and is not shown; the card says the sign-in was cancelled or refused, with the error code.Testing
npm run check,prettier --checkandeslintpass. 852 unit tests and 301 client tests pass. 295 of 296 story tests pass;ChatAttachmentsPreview › PdfConversionErrortimes out in the full run and passes on its own, as on the layers below. The production build completes.tests/unit/mcp-oauth.test.tsruns the whole flow against an in-process MCP server behind OAuth (protected resource and authorization server metadata, registration, an authorize step, a token endpoint that checks PKCE, revocation): a background connection stops without registering; sign-in registers and sends the popup to the authorization page with PKCE,stateandresource; the callback signs in and the server connects with the token; refresh; a refused refresh; a denied sign-in; a forgedstate; a sign-in in this tab returning to its route; sign-out with revocation; a server URL change; the Authorization header winning; a 401 with no sign-in; the client ID fallback with a secret; and the whole flow through the CORS proxy, keeping the realresource.Requirements
Claude (Opus 5.5 Medium)