Repository navigation
studio: show MCP "Import config" on the add-server form - #6030
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to bulk-import MCP servers from standard JSON configuration files (such as those from Claude Desktop, Cursor, Cline, or VS Code). It adds backend utilities to parse and join stdio commands across different platforms, exposes a new /import endpoint that handles duplicates and per-entry errors gracefully, and updates the frontend UI to support file uploads. The review feedback highlights three valuable improvements: filtering out None values in environment variables to prevent them from being coerced into the string "None", dynamically referencing the correct configuration key (mcpServers vs servers) in error messages, and wrapping the frontend toast error descriptions in a container with whitespace-pre-line to preserve newline formatting.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b92230bf5c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 737426635e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 869400ee0d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 546c5657dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d5bd8c667
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac7f6b5455
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1196dedb3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6b5463f23
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78efe957d8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| url = join_stdio_command([command, *(str(a) for a in args)]) | ||
| headers = _coerce_str_dict(env) if env else None | ||
| return ParsedMcpEntry(label, url, headers, True, is_enabled = is_enabled), None |
There was a problem hiding this comment.
Reject stdio timeouts before dropping them
For Cline stdio entries that include timeout, timeoutMs, or timeoutSeconds, this branch never checks _UNSUPPORTED_TIMEOUT_FIELDS, so the import creates the row and silently drops the configured timeout. The remote branch now rejects these fields, but slow stdio servers still fall back to the fixed 60s probe timeout and can fail here despite working in the source client; reject these stdio entries too unless the timeout can be preserved.
Useful? React with 👍 / 👎.
| if url in seen_urls: | ||
| skipped.append(entry.display_name) | ||
| continue |
There was a problem hiding this comment.
Preserve same-URL entries with different credentials
When an imported config contains two enabled entries with the same command or remote URL but different env/headers (for example two accounts or tenants on the same MCP endpoint), this URL-only duplicate check imports the first and silently skips the second. The storage layer and manual create path allow multiple rows for the same URL, so the import loses a distinct server from a valid config; include the normalized headers/env in the duplicate identity or only skip exact existing rows.
Useful? React with 👍 / 👎.
| url = join_stdio_command([command, *(str(a) for a in args)]) | ||
| headers = _coerce_str_dict(env) if env else None | ||
| return ParsedMcpEntry(label, url, headers, True, is_enabled = is_enabled), None |
There was a problem hiding this comment.
Reject unpreserved Cline auto-approval policies
When a Cline stdio entry includes autoApprove (including the common [] meaning no tools should run without confirmation), this import still creates a normal enabled server and drops that policy. Enabled MCP rows are later exposed by get_enabled_mcp_tools() and execute_tool() runs requested MCP tools without a per-tool approval check, so importing a config that relied on Cline's confirmation policy can make all of that server's tools callable here; reject these entries unless the approval policy can be represented.
Useful? React with 👍 / 👎.

Summary
Follow-up to #5943, fixing the UX bug reported on #5936. The "Import config" button only rendered in the MCP server list view, but the composer opens the dialog straight into the add-server form (
openToCreate={true}). So users land on a screen with no import option and assume the feature is missing, it only appeared after manually adding a server first.This surfaces the import on the add-server form too, so it's visible the moment the dialog opens.
What's changed
chat-mcp-servers-dialog.tsx: moved the single hidden file input to the dialog root so both views share it, and added an "Import servers from a config file" banner + Import config button to the create form.Testing
mcpServers.jsonfrom the form → all servers added; list updates.