unsloth/studio/backend/routes
Daniel Han 4b6a733fc3
Studio: harden stdio MCP gating and fix transport edge cases (#5892)
* Studio: harden stdio MCP gating and fix transport edge cases

- Gate the Data Recipe stdio path behind UNSLOTH_STUDIO_ALLOW_STDIO_MCP so a hosted deployment cannot spawn local processes through recipes
- Enforce the gate inside _client() so the transport sink cannot spawn when disabled
- keep_alive=False so stdio probes/calls do not leave orphan subprocesses
- Force OAuth off for stdio servers on create and update
- Drop stored headers when a server switches transport type
- Reject a command whose first token is a URL scheme
- Add MCP gate and improvement tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests: skip Data Recipe stdio tests when data_designer is absent

The data_designer plugin is only installed in the Studio test job, so guard
the two build_mcp_providers tests with importorskip so the core matrix skips
them instead of failing on ModuleNotFoundError.

---------

Co-authored-by: Daniel Han <michaelhan2050@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-05-31 04:38:52 -07:00
..
data_recipe Studio: harden stdio MCP gating and fix transport edge cases (#5892) 2026-05-31 04:38:52 -07:00
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Studio: add remote MCP server support (#5750) 2026-05-27 07:01:11 -07:00
auth.py studio: proxy-aware login rate-limit; allow google favicons in CSP (#5489) 2026-05-18 00:02:15 -07:00
chat_history.py Studio: persist chat history in backend storage (#5272) 2026-05-22 06:18:05 -07:00
datasets.py studio: show HF model download progress in training start overlay (#4894) 2026-04-14 08:54:01 -07:00
export.py studio: security and hardening pass (auth rate-limit, sandbox, path containment, schema validation, headers) (#5375) 2026-05-13 06:12:18 -07:00
inference.py Fix non-streaming GGUF chat completion usage (#5781) 2026-05-28 13:28:52 +04:00
mcp_servers.py Studio: harden stdio MCP gating and fix transport edge cases (#5892) 2026-05-31 04:38:52 -07:00
models.py Fix /recommended-folders 500 on unreadable model directories (Python 3.12+) (#5523) 2026-05-18 00:16:14 +04:00
providers.py Studio: add Gemini provider with web_search, code_execution, prompt caching, and Nano Banana image generation (#5720) 2026-05-27 06:01:24 -07:00
training.py Studio: expose image size setting in training UI (#5743) 2026-05-27 05:01:24 -07:00
training_history.py Studio: Dark theme refactor, right sidebar redesign, and chat UI polish (#5150) 2026-05-07 14:33:31 +04:00