Skip to content

feat(plasmic-mcp): branch and comment tools for collaboration workflows#200

Merged
field123 merged 1 commit intomasterfrom
feat/mcp-branching
Mar 27, 2026
Merged

feat(plasmic-mcp): branch and comment tools for collaboration workflows#200
field123 merged 1 commit intomasterfrom
feat/mcp-branching

Conversation

@field123
Copy link
Copy Markdown
Collaborator

@field123 field123 commented Mar 27, 2026

Summary

Add two new MCP tool domains for collaboration workflows (14 actions total):

Branch tool (7 actions)

Action Description
list List all branches for current project
create Create branch (requires published project — validates with clear error)
update Rename or change status (active/merged/abandoned)
delete Delete a branch
merge Merge branches (supports pretend: true for dry-run preview)
protect Enable/disable main branch protection
revision-info Get project revision metadata

Comment tool (7 actions)

Action Description
list List all comment threads with replies
add Create new comment thread (requires componentUuid, resolves bundler address)
reply Reply to existing thread
edit Edit a comment body
delete Delete a comment
resolve Resolve/reopen a thread
react Add/remove emoji reactions

Infrastructure

  • put() and del() transport helpers in api-client (matching get/post pattern)
  • CSRF auto-fetched in req() for all write methods (POST/PUT/DELETE)
  • Removed explicit ensureCsrfToken() from saveRevision() — centralized in req()
  • Comment add resolves componentUuid + nodeRef to a real bundler ModelAddr
  • Branch create validates project is published before calling server

Known limitation

Branch management (create/list/merge/delete) works, but project.set doesn't support loading a specific branch yet. All edits still target main. Branch session support (threading branchId through load → save → live sync) is a follow-up.

Test plan

  • 2296 tests pass, build succeeds, type check passes
  • Manual: branch.create on unpublished project → clear error
  • Manual: branch.create after publish → branch created
  • Manual: branch.list → shows branch
  • Manual: branch.update (rename) → success
  • Manual: branch.merge pretend:true → "can be merged"
  • Manual: branch.delete → branch removed
  • Manual: comment.add with componentUuid → valid bundler address, Studio loads OK
  • Manual: comment.reply → reply added
  • Manual: comment.resolve → thread resolved
  • Manual: comment.delete → cleanup
  • Manual: Studio bidirectional — MCP comments visible in Studio, Studio replies visible in MCP

@field123 field123 force-pushed the feat/mcp-branching branch 3 times, most recently from fd2f1f5 to 6261b85 Compare March 27, 2026 19:07
…ion workflows

Add two new MCP tool domains (14 actions total):

Branch tool (7 actions):
- list: List all branches for current project
- create: Create branch with optional source branch
- update: Rename branch or change status (active/merged/abandoned)
- delete: Delete a branch
- merge: Merge branches with pretend mode for dry-run preview
- protect: Enable/disable main branch protection
- revision-info: Get project revision metadata

Comment tool (7 actions):
- list: List all comment threads with replies
- add: Create new comment thread on project/element
- reply: Reply to existing thread
- edit: Edit a comment body
- delete: Delete a comment
- resolve: Resolve/reopen a thread
- react: Add/remove emoji reactions

Also adds put() and del() transport helpers to api-client
(matching existing get()/post() SharedApi pattern from PR #195).

All operations are API-only (no model mutations) — they use the
same HTTP transport as all other api-client methods.
@field123 field123 force-pushed the feat/mcp-branching branch from 6261b85 to 4588cfb Compare March 27, 2026 19:11
@field123 field123 merged commit 6da399a into master Mar 27, 2026
9 checks passed
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