Skip to content

fix(mcp): require workspace admin to change workflow MCP server visibility - #9576

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/workflow-mcp-public-admin-gate
Nov 2, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/workflow-mcp-public-admin-gate

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Internal POST /api/mcp/workflow-servers and PATCH /api/mcp/workflow-servers/[id] accepted isPublic at workspace write, while the v2 operations for the same writes require admin because a public server answers /api/mcp/serve/{serverId} with no credential. A write member could therefore turn a private server into an unauthenticated execution endpoint
  • performCreateWorkflowMcpServer / performUpdateWorkflowMcpServer now take a required allowVisibilityChange, mirroring allowDestinationChange on external MCP servers. Internal routes pass permission === 'admin'; the v2 use cases pass true (their operations are already admin)
  • Without that authority: creating a public server returns 403; on update, isPublic is never written and the UPDATE only matches when the submitted value equals the stored one, so a write member can still rename/re-describe a server (the edit form always sends isPublic), any visibility change returns 403, and a concurrent admin flip is never reverted. Missing / other-workspace servers still return 404
  • Settings edit form, create modal, and deploy-modal create modal disable the Private/Public toggle for non-admins
  • Scope deliberately kept to visibility: write members keep managing servers and tools as the settings section grants them today

Type of Change

  • Bug fix (security)

Testing

  • New workflow-mcp-visibility.integration.ts against real Postgres (7 tests); red→green verified: 4 refusal tests fail on the pre-fix lifecycle, 3 controls pass on both
  • workflow-mcp-lifecycle.test.ts, workflow-deployments.test.ts, app/api/v2/workflow-mcp-servers/**, capability-declarations.test.ts, operations.test.ts (48 passing)
  • bun run lint; type-check and check:audits in CI

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)

@vercel

vercel Bot commented Nov 2, 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 2, 2026 8:20pm 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 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; visibility changes require admin authority while writer edits remain supported.

Summary

Requires workspace admin authority to change workflow MCP server visibility.

  • Only workspace admins can change a workflow MCP server’s visibility.

No actionable issues found. Tests were inspected, not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Create or update request] --> B{Workspace admin?}
  B -->|Yes| C[Allow requested visibility]
  B -->|No: create| D[Allow private server only]
  B -->|No: update| E[Leave visibility out of saved fields]
  E --> F{Submitted visibility omitted or matches?}
  F -->|Yes| G[Save other fields]
  F -->|No| H[Reject change]
Loading

Reviews (1) · Last reviewed commit: "fix(mcp): require workspace admin to cha..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 3b6be5c into staging Nov 2, 2026
72 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/workflow-mcp-public-admin-gate branch November 2, 2026 20:30

This branch was previously deployed

1 inactive deployment
Preview — a41e2428 Deployed Nov 2, 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