Skip to content

Studio: turn on agent access (MCP) from Settings > API - #13167

Merged
mahiatlinux merged 4 commits into
unslothai:mainfrom
Etherll:fix/studio-mcp-settings-section
Oct 10, 2026
Merged

mahiatlinux merged 4 commits into
unslothai:mainfrom
Etherll:fix/studio-mcp-settings-section

Conversation

@Etherll

@Etherll Etherll commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Owners can turn on agent access (MCP) from Settings > API instead of setting UNSLOTH_STUDIO_ENABLE_MCP=1. The new Agent access (MCP) section has a switch for the /mcp/ server and a copyable setup command for Claude Code, OpenAI Codex, OpenCode, Hermes Agent, OpenClaw, Mistral Vibe and DeepSeek Harness, filled in with a key made on the same page.

This is the Settings half of the MCP work. It uses the /api/settings/mcp-access route from #13118, so it should merge after #13118. Until then the section shows the route's error.

Details

  • Only the owner sees the section, and only from a signed-in session; the route refuses API keys.
  • When UNSLOTH_STUDIO_ENABLE_MCP=1 is set, the switch shows as on and locked, with "Set by UNSLOTH_STUDIO_ENABLE_MCP."
  • The command reads the key from UNSLOTH_API_KEY. The page builds Linux/macOS and Windows variants for each agent and remembers the chosen agent and OS.
  • The settings search finds the section, and its two strings are translated in all 14 languages.

The studio/MCP.md steps for the Settings switch will follow once #13118 is merged, since that pull request rewrites the file.

Testing

From studio/frontend:

npm run typecheck
npm test
npm run i18n:check:strict

Typecheck is clean, npm test gives 11176 passed and 0 failed, and i18n:check:strict reports no missing MCP keys (the browser.* keys it flags are already missing on main).

The screenshot runs this branch's frontend against the #13118 backend on CPU. A report-only design check of the section against the Unsloth Studio design system found 0 violations.

Adds an owner-only Agent access (MCP) section to Settings > API: a switch for the /mcp server and a copyable setup command for Claude Code, Codex, OpenCode, Hermes Agent, OpenClaw, Mistral Vibe and DeepSeek Harness, filled with a key made on the same page. It uses the /api/settings/mcp-access route from the MCP server pull request.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-09T21:23:33.303630Z b9b82c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…toggle

The agent access section read the tunnel preference only when it rendered, so switching Secure HTTPS in the usage examples left the MCP command on the old address until something else re-rendered it. The section now subscribes to the preference.
@Etherll

Etherll commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

The owner can now turn on agent access (MCP) from Settings > API and copy a ready setup command for their coding agent. The section needs the /api/settings/mcp-access route from #13118, so it should merge after #13118.

What changed

  • The setup command's address follows the API tab's Secure HTTPS toggle. Before, switching it left the MCP command on the old address until the page redrew. The section now picks up the change right away.

Typecheck is clean and npm test passes in full at d1fc0c6. The section was also checked against the Unsloth Studio design system with no violations.

Settings > API, base 6c723f747 vs head b9b82c1f1
Base 6c723f7 (left) has no agent access section. Head b9b82c1, served by the #13118 backend at f9adc9b, adds it with the Claude Code command, and shows the locked state when UNSLOTH_STUDIO_ENABLE_MCP=1 is set. The later commit d1fc0c6 does not change these screens.

@mahiatlinux mahiatlinux 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.

LGTM! Ready to merge, all manually checked.

@mahiatlinux

Copy link
Copy Markdown
Contributor

Review and verification evidence

Reviewed mirror base d825aaf57d6e36fc77215c9557f8dc5ea938c0aa through repaired mirror head d58476167cacf0e3ad6b723411ea212c54960236. The two repair commits were landed patch-equivalently on source head 5460c68f3a577f2cab69cdcbe58e3bc70b5c0ba0.

Codex review confirmed one functional defect: if localStorage.setItem threw, the Usage Examples toggle updated locally while the MCP section reread stale storage and could generate a command for the wrong endpoint. Commit d58476167cacf0e3ad6b723411ea212c54960236 fixes this with a shared in-memory source of truth and adds a regression test. Comment-only cleanup is in be92bdb80c206db363ed0f8c0ee4611569a37ddf; the PR-scoped TypeScript printer gate verified no code or string changes.

UI A/B

The live MCP settings endpoint is supplied by dependency PR #13118, so this evidence intentionally overrides the PR merge base. BEFORE is #13118 at f9adc9b0c975d01d3281ae35a1735e79afa7c395; AFTER is #13118 plus this PR at composite head a57017a034402e9a375d27cee0be957c2a8b201b. The later repair changes only failed-storage synchronization, which is covered by the dedicated regression test and does not change the default rendered state.

Expected: BEFORE has no Agent access card. AFTER shows the owner-only Agent access (MCP) card with the switch enabled, Claude Code selected, and an MCP setup command.

Observed facts:

  • section_count: 0 -> 1
  • snippet_visible: false -> true
  • switch_checked: false -> true
  • claude_code_visible: false -> true
  • mcp_endpoint_visible: false -> true
  • The API reported enabled: true on both sides.

PR 13167 before and after MCP settings

Full UI artifact

Environment: Ubuntu 26.04.1 LTS x86_64, Google Chrome for Testing 153.0.8010.12, 1440x1000 viewport.

Executed checks

  • npm test at repaired head: 11,194 passed, 0 failed.
  • Focused MCP/settings suite at repaired head: 62 passed, 0 failed.
  • New storage-failure regression test: passed.
  • check_comment_only.py: passed for all 11 cleanup files against pre-cleanup head 507c5995fb093b8c698cbbc3686c11b6b27e2b4e.
  • Second comment-cleanup scan of the repair sites: no changes required.
  • npm run typecheck: passed.
  • npm run build: passed.
  • npm run i18n:check:strict: passed with zero missing locale keys.
  • Sandboxed pr_ui_diff.py A/B: passed with the fact changes above; the composite was manually inspected.
  • GitGuardian: passed on the repaired mirror head.
  • Renewed Codex review: completed at d584761 with no findings and a 👍 reaction; the earlier finding was fixed, replied to, and resolved.
  • Source approval was submitted at the landed source head.

@mahiatlinux
mahiatlinux merged commit 26de92c into unslothai:main Oct 10, 2026
danielhanchen added a commit that referenced this pull request Oct 10, 2026
#13167 added settings.apiKeys.mcp.description and enableDescription saying "Unsloth Studio" in every locale. The desktop app displays itself as Unsloth, and test_tauri_branding_contract sweeps the locale catalogs by key, sparing only the keys that name a remote Unsloth Studio server. These two describe this app's own MCP endpoint and token, so they now say Unsloth, as the existing "Unsloth API key" copy does.
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.

2 participants