Skip to content

feat(mcp): enable code mode for every caller and remove the mcp-code-mode flag - #10223

Merged
waleedlatif1 merged 2 commits into
stagingfrom
waleed/mcp-code-mode-ungate
Nov 20, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
waleed/mcp-code-mode-ungate

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Remove the mcp-code-mode flag: every Sim MCP caller gets execute_read_code and execute_write_code, with the code-mode instructions always in initialize
  • Sandbox fairness key comes straight from the principal: the person, or the workspace for a workspace API key
  • Default program timeout 60s → 45s, so a default run answers before the 60s request timeout MCP clients default to
  • query accepts null and leaves it out, so cursor: page.nextCursor ends paging instead of failing the call
  • The OAuth scope pre-check trims the operation name the same way the call tools do
  • Docs: drop the beta note, list six tools, state the 256 KB per-call input limit and the new default

Type of Change

  • New feature

Testing

  • code-mode.integration.ts (real Postgres + isolate pool): 12/12. New: a workspace API key lists and runs programs; a misplaced input key fails with INVALID_CALL instead of being dropped; paging passes the null cursor straight through
  • Red proofs: dropping the workspace-key branch fails the workspace-key test; removing null from the query schema fails the paging test; removing .strict() from the request schema fails the misplaced-key test
  • MCP unit tests 47/47, lint, check:comment-hygiene, check:test-patterns, check:utils, docs content:verify-compatibility
  • Live QA on staging with the flag on: 22 programs across reads, writes, refusals, errors, sandbox escape probes, timeout, call cap, concurrency, result/log caps, and the queued-write abort

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…mode flag

- Every Sim MCP caller gets execute_read_code and execute_write_code; the sandbox owner key comes from the principal (person, or workspace for workspace keys)
- Default program timeout is 45s, under the 60s MCP client request default
- A null query value is left out, so the last page's null cursor ends paging
- The scope pre-check trims the operation name like the call tools do
- Docs state the 256 KB per-call input limit and drop the beta note
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 20, 2026 3:54am UTC

Request Review

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 9 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge, with no new actionable issues found.

Summary

Makes MCP code mode available to every authenticated caller and removes the feature flag.

  • Every Sim MCP caller can run multi-call code programs.
  • Code programs default to a 45-second run deadline.
  • Paged API calls can pass a null cursor to end the list.
  • OAuth scope checks trim operation names before lookup.

No new actionable issues were found. Checks were based on source review; no tests were run during this review.

Reviews (2) · Last reviewed commit: "fix(mcp): bound a code-mode run by one d..." · Reviewed by Greptile

Comment thread apps/sim/lib/api/mcp/code-mode.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 9 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 86db551 into staging Nov 20, 2026
86 checks passed
@waleedlatif1
waleedlatif1 deleted the waleed/mcp-code-mode-ungate branch November 20, 2026 04:12

This branch was previously deployed

1 inactive deployment
Preview — 709e5409 Deployed Nov 20, 2026 by vercel[bot]
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.

1 participant