Skip to content

studio: show MCP "Import config" on the add-server form - #6030

Merged
Imagineer99 merged 16 commits into
unslothai:mainfrom
NilayYadav:studio-mcp-import-button-fix
Jun 11, 2026
Merged

Imagineer99 merged 16 commits into
unslothai:mainfrom
NilayYadav:studio-mcp-import-button-fix

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

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

  • Opened MCP → "Add custom MCP" → the Import config button now shows immediately on the form (previously hidden until a server was added).
  • Imported a mcpServers.json from the form → all servers added; list updates.

@NilayYadav
NilayYadav requested a review from danielhanchen as a code owner June 5, 2026 15:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread studio/backend/routes/mcp_servers.py Resolved
Comment thread studio/backend/routes/mcp_servers.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@Imagineer99

Copy link
Copy Markdown
Member
image

Addressed some minor issues and bot comments, tested and works as expected, nice work.

@Imagineer99
Imagineer99 merged commit 004577c into unslothai:main Jun 11, 2026
1 of 28 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +108 to +110
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +267 to +269
if url in seen_urls:
skipped.append(entry.display_name)
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +108 to +110
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants