Skip to content

fix(mcp): apply the workspace personal API key setting to MCP serve auth - #6429

Merged
waleedlatif1 merged 1 commit into
stagingfrom
worktree-mcp-serve-personal-api-key-policy
Aug 8, 2026
Merged

fix(mcp): apply the workspace personal API key setting to MCP serve auth#6429
waleedlatif1 merged 1 commit into
stagingfrom
worktree-mcp-serve-personal-api-key-policy

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • MCP serve auth now honors the workspace's "Allow personal API keys" setting, matching the workflow execute route and the v1 API
  • The setting is read from the workspace join getServer already performs, so there is no extra query

Type of Change

  • Bug fix

Testing

Unit tests added; full MCP + workflow execute + api-key suites pass

Checklist

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

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 8, 2026 7:21pm

Request Review

@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes authentication policy on the MCP serve boundary; incorrect logic could wrongly block or allow API key access, but scope is small and covered by new unit tests.

Overview
MCP serve auth now enforces the workspace Allow personal API keys setting, aligning with workflow execute and the v1 API.

getServer selects workspace.allowPersonalApiKeys from the existing workspace join (no extra query). In authorizeMcpServeRequest, personal API keys get 403 when that flag is off; workspace keys still work. This check stays on the serve route because tool calls bridge to workflow execute with an internal JWT, so execute never sees the original API key.

Tests cover rejection of personal keys, allowance of workspace keys when personal keys are disabled, and updated mocks with workspaceAllowsPersonalApiKeys.

Reviewed by Cursor Bugbot for commit e636d8f. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes MCP serve authorization honor each workspace’s personal API-key setting using data already loaded by the server query.

  • Adds the workspace setting to the MCP server query result.
  • Rejects personal API keys when the workspace disables them while preserving workspace-key access.
  • Adds focused tests for both denied personal keys and allowed workspace keys.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The joined workspace setting is a non-nullable boolean, the new check targets only authenticated personal API keys, and the tests cover both the rejection and workspace-key exemption paths.

Important Files Changed

Filename Overview
apps/sim/app/api/mcp/serve/[serverId]/route.ts Correctly adds workspace-level personal API-key enforcement to the authenticated MCP serve path without changing workspace-key behavior.
apps/sim/app/api/mcp/serve/[serverId]/route.test.ts Adds focused regression coverage for rejecting disallowed personal keys and continuing to accept workspace keys.

Reviews (1): Last reviewed commit: "fix(mcp): apply the workspace personal A..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit 05aabc3 into staging Aug 8, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the worktree-mcp-serve-personal-api-key-policy branch August 8, 2026 19:25
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