Add deep link support for MCP server creation via /mcps/add#11876
Open
DocX wants to merge 5 commits intodanny-avila:mainfrom
Open
Add deep link support for MCP server creation via /mcps/add#11876DocX wants to merge 5 commits intodanny-avila:mainfrom
DocX wants to merge 5 commits intodanny-avila:mainfrom
Conversation
- Introduce MCPAddRedirect route to parse MCP params from query string and forward them to /c/new via route state - Add useMCPDeepLink hook to open MCP server dialog with initial values from route state - Render MCPDeepLinkDialog in ChatView to trigger dialog on deep link - Update MCPServerDialog and useMCPServerForm to accept initialValues for pre-filling form - Add tests for MCPAddRedirect and useMCPDeepLink behavior
DocX
commented
Feb 20, 2026
| const onOpenChange = useCallback((open: boolean) => { | ||
| setIsOpen(open); | ||
| if (!open) { | ||
| setInitialValues(undefined); |
Author
There was a problem hiding this comment.
Once opened, clear the initial values to allow user to close and open dialog with empty state
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds deep link support for MCP server creation, allowing users to prefill the MCP server dialog via a URL route. The implementation introduces a new /mcps/add route that accepts query parameters for server name, URL, and transport type, then redirects to /c/new with these values passed via route state to automatically open and prefill the MCP server creation dialog.
Changes:
- Added
/mcps/addroute that extracts query parameters and redirects to the chat page with state - Created
useMCPDeepLinkhook to detect deep link state and manage dialog opening - Created
MCPDeepLinkDialogcomponent to render the dialog when deep link parameters are present - Extended
MCPServerDialoganduseMCPServerFormto accept and useinitialValuesfor prefilling - Added comprehensive test coverage for both the redirect component and the hook
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/routes/index.tsx | Adds /mcps/add route to routing configuration |
| client/src/routes/MCPAddRedirect.tsx | Redirect component that extracts query parameters and navigates to /c/new with state |
| client/src/routes/tests/MCPAddRedirect.spec.tsx | Tests for the redirect component |
| client/src/hooks/MCP/useMCPDeepLink.ts | Hook to detect deep link state and manage dialog lifecycle |
| client/src/hooks/MCP/index.ts | Exports the new hook |
| client/src/hooks/MCP/tests/useMCPDeepLink.spec.tsx | Tests for the deep link hook |
| client/src/components/SidePanel/MCPBuilder/MCPDeepLinkDialog.tsx | Wrapper component that conditionally renders dialog based on deep link state |
| client/src/components/Chat/ChatView.tsx | Integrates MCPDeepLinkDialog into the chat view |
| client/src/components/SidePanel/MCPBuilder/MCPServerDialog/index.tsx | Accepts initialValues prop for prefilling |
| client/src/components/SidePanel/MCPBuilder/MCPServerDialog/hooks/useMCPServerForm.ts | Uses initialValues to set form defaults |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/components/SidePanel/MCPBuilder/MCPDeepLinkDialog.tsx
Outdated
Show resolved
Hide resolved
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.
Summary
Fixes #11727
Adds new UI route for prefilling new MCP server dialog:
Change Type
Please delete any irrelevant options.
Testing
Open
This will redirect to
/c/newwith the MCP dialog opened and the name, URL and transport type preselected.Test Configuration:
NA
Checklist
Please delete any irrelevant options.