Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The sidebar can use external MCP servers ("connectors") the reader switches on in a plug menu:
OpenEvidence and cBioPortal MCP by default, or what CHAT_CONNECTORS names. Issue #128.
How it holds to the project's rules (docs/ARCHITECTURE.md now states the one exception to "the route
holds no tool"): a request names a connector by id and the address always comes from the deployment's
registry; every connector tool is namespaced <id>__<tool> and waits for the reader's approval, shown with
the server and the exact arguments (no "always allow"); approval requests are signed
(CHAT_APPROVAL_SECRET) so a browser cannot forge one; the model is told never to put an identifier in a
call. A reader's credentials live in their browser (localStorage) and are sent per request; the server
stores, logs and returns none. A connector that cannot be reached is reported in a header and left out of
the turn, never failing the chat.
Three kinds of sign-in, because the real servers needed them: "oauth" (standard MCP OAuth with dynamic
client registration and PKCE, finished on /api/chat/connectors/oauth/callback; the flow's state rides in
a ten-minute httpOnly cookie, the token goes to the browser and is forgotten), "token" (a pasted API
token in a named header: OpenEvidence's tools/list is open but its calls need x-api-token), and "none".
Registration follows what each server advertises: mcp.cbioportal.org only takes confidential clients and
both grants.
The MCP client declines the server-push GET stream: OpenEvidence held it open and answered nothing else,
so listing its tools timed out. Connector use is one request and one answer per turn, so none is needed.
Verified: tsc, eslint, knip and 42 new unit tests pass (registry, browser state, a stub MCP server for the
tools, a stub authorization server for the whole OAuth flow including a confidential-client server). In
Chrome with the real model: connectors are off by default; the OAuth one cannot be switched on until
signed in; the approval card shows the server and exact arguments; Deny stops the call and the model does
not retry; Approve runs it; a fake token reached OpenEvidence's server (its reply changed to "Invalid
token"). The OAuth start endpoint against mcp.cbioportal.org registered a client and built the
authorization URL. Not done: a successful OpenEvidence answer (needs a real token), the full cBioPortal
sign-in (needs the reader in the browser), and an e2e test. 6 view-snapshot tests fail with and without
this change.
Refs #128
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XdQQNTxj4XzvBoLxynDRu
…or status A connector stored as "on" that had no token (OpenEvidence was on from before it needed one) showed as off in the Connectors panel but was still named in every chat request, so each message came back "no API token: add yours". After the reader added the token, that last-message error stayed on screen, including across closing and reopening the sidebar. requestEntries now names only connectors that are on AND may be (the same rule the panel uses), and any change to a connector's switch or token clears its remembered status. Verified: tsc, eslint and the 18 connector-state tests pass. In Chrome, from a leftover "on" with no token: a message names no connectors and shows no error; after pasting a token, closing and reopening, and switching on, the request names the connector with its token, the server reports it reached with 1 tool, and the approval card appears. Refs #128 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XdQQNTxj4XzvBoLxynDRu
jjgao
force-pushed
the
chat-connectors
branch
from
November 19, 2026 18:46
cc42bb8 to
eaae356
Compare
Check the parsed URL origin before accepting a return path so browser tab normalization cannot redirect outside the app. Preserve valid local paths, queries and fragments. Regression coverage checks the sanitizer, flow cookie and success and failure callback pages. All 49 connector tests, targeted ESLint and TypeScript checks pass.
Collect every tools/list page before applying the connector allow-list and tool limit. Tools on later pages are now available and the limit covers the complete offered tool set. Regression coverage uses a paginated MCP server and checks later-page execution, allow-list selection and the cross-page limit. All 49 connector tests, targeted ESLint and TypeScript checks pass.
This branch was successfully 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.
Stacked on #127 (which is on #125, on #123). Merge in that order; GitHub retargets each in turn.
Summary
The sidebar can use external MCP servers ("connectors") the reader switches on from a plug menu. Defaults: OpenEvidence and cBioPortal MCP; a deployment sets its own with
CHAT_CONNECTORS([]offers none). Everything is off until the reader switches it on. Issue #128.<id>__<tool>and wait for the reader. The card shows the server and the exact arguments, with Approve and Deny. There is no "always allow". Approval requests are signed (CHAT_APPROVAL_SECRET), so a browser cannot forge one. A denied call is not retried; the model is told so, and told never to put an identifier in a call.CHAT_CONNECTORSis an error, not a quiet omission.localStorage) and are sent per request. The server stores, logs, caches and returns none.x-chat-connectorsheader and leaves it out of that turn. The panel shows why.oauth(cBioPortal MCP): standard MCP OAuth with dynamic client registration and PKCE. The flow's state rides in a 10-minutehttpOnlycookie, the token goes to the browser, and the server forgets it.token(OpenEvidence): a pasted API token in a named header. Its tool list is open, but a call returns "send yours in the x-api-token header".none.docs/ARCHITECTURE.mdandCLAUDE.mdstate the one exception to "the route holds no tool", andDATA-BOUNDARY.mdsays what a connector sends and that the app cannot check it.Found along the way
mcp.cbioportal.orgonly takes confidential clients and requires bothauthorization_codeandrefresh_tokenin registration. Registration now follows what each server advertises. It accepted alocalhostredirect.Verification
tsc,eslint,knipand 42 new unit tests pass: the registry, the browser state, a stub MCP server for the tools, and a stub authorization server for the whole OAuth flow, including a confidential-client server.GET /api/chat/connectors/oauth/start?id=cbioportalagainst the real server registered a client and built the authorization URL with PKCE and state.Not done, and needs a person
mcp.cbioportal.org(open the plug menu, click Connect).🤖 Generated with Claude Code