Studio: enable stdio MCP servers on a loopback bind#6295
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Code Review
This pull request introduces a host trust policy utility (host_policy.py) for the Studio backend to automatically enable local stdio MCP servers by default when bound to a loopback address. This aligns local installations with the security model of the desktop app. The changes also update the startup banner to use this new utility, adjust the frontend dialog text to reflect support for local installs, and add comprehensive unit tests to verify the loopback detection and environment variable preservation logic. I have no feedback to provide.
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.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bc37fcd47
ℹ️ 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: 22e70ab7d5
ℹ️ 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: b7fe5d53f4
ℹ️ 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: 5078ebc9a5
ℹ️ 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".

stdio MCP servers (local commands like
npx -y @modelcontextprotocol/server-filesystem /tmp) only worked in the desktop app. Everywhere else they were off unless you setUNSLOTH_STUDIO_ALLOW_STDIO_MCP=1before launch, which a lot of users can't reasonably do (see #5863 (comment)).The gate treated a localhost webui the same as a
0.0.0.0network bind, but those aren't the same risk. A loopback bind is the user's own machine, which is why the desktop app enables stdio there already.Fix
run_servernow setsUNSLOTH_STUDIO_ALLOW_STDIO_MCP=1on a loopback host (127.0.0.1,localhost,::1) viasetdefault, the same thingmain.pydoes for the desktop app.0.0.0.0and Colab are unchanged, still off unless you opt in, and an explicit=0still force-disables. The loopback check lives in a newstudio/backend/utils/host_policy.pymirroring the CLI'sunsloth_cli/_tool_policy.py.