chat-ui
73d0aefa - Open HuggingChat with an MCP server from a link (?mcp=) (#2705)

Commit
27 days ago
Open HuggingChat with an MCP server from a link (?mcp=) (#2705) * Open HuggingChat with an MCP server from a link (?mcp=) A link like /?mcp=<url>&mcp_name=<name> opens the add-server form pre-filled. Nothing is contacted until the user clicks Add; the server is then enabled. A URL the user already has is enabled instead of duplicated, and the params are stripped from the URL so a reload cannot replay them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Mock the MCP store in the link prompt test; cover ?mcp= links The home page now imports the MCP store, whose module-level $env read breaks in browser tests, so mock it as AskQuestion.svelte.test.ts does. Add tests that an ?mcp= link opens the filled-in add form and strips the params, and that an already-enabled server opens nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Enable an existing server from a link without probing it again A link to a server the user already has now offers an "Enable Server" step instead of the add form. Running discovery for it opened a second OAuth connection and enabled the server without authorizing it; now a server whose OAuth still needs authorization goes through the authorize step first. Server URL matching ignores fragments, which are never sent to the server, and moves to mcpValidation so tests do not need the store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix MCP link cancellation and stale OAuth state * Trim MCP link comments and heavily mocked tests --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Author
Parents
Loading