🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

MCP Update tool - #5952

Merged
ChrisPenner merged 15 commits into
trunkfrom
mcp/update
Nov 5, 2025
Merged

MCP Update tool#5952
ChrisPenner merged 15 commits into
trunkfrom
mcp/update

Conversation

@ChrisPenner

@ChrisPenner ChrisPenner commented Oct 20, 2025

Copy link
Copy Markdown
Member

Overview

  • Allows agents to call "update" via the MCP server
  • This requires the user to explicitly mark a branch as editable by the mcp by passing the --mcp-editable-branches=<project/branch regex> flag in their MCP config. We can continue to explore other options for this. Now we just rely on the agent respecting the 'destructive updates' flag, caveat emptor.
  • I haven't yet had time to fully explore how this flow works in cases where update requires user interaction; I'd love to hear reports from dogfooding before we merge; I think Arya has tested it more.

Implementation notes

  • Adds the new global --mcp-editable-branches=<project/branch regex> flag
  • Adds a new update tool
    • accepts literal code or a filepath to a scratch file.
  • Updates the error handling for the CLI to MCP runner so we can short-circuit if code doesn't typecheck.

Test coverage

Added an API transcript test
Could use some dogfooding and testing in the wile before merging/releasing

Loose ends

May want to explore other methods of allowing mcp edits on certain branches, editing your config file and restarting your agent every time is a pain.

@ChrisPenner
ChrisPenner marked this pull request as draft October 20, 2025 22:23
@ChrisPenner
ChrisPenner marked this pull request as ready for review October 21, 2025 03:10
@aryairani

Copy link
Copy Markdown
Contributor

Let's do the thing where we mark it as destructive but otherwise don't block.
And maybe later we do the thing where you manually whitelist branches with ucm commands.
As long as we don't have delete brach we should be okay with undo and change comments, though the agent can also just delete files from the disk if you let it...

@ChrisPenner

Copy link
Copy Markdown
Member Author

Even if it did delete a branch I think you could still get it back with the global reflog, but obviously not ideal.

Okay sounds like a plan 👍🏼

@ChrisPenner

Copy link
Copy Markdown
Member Author

@aryairani Okay I removed the branch-protection stuff.

@ChrisPenner
ChrisPenner requested a review from aryairani October 24, 2025 18:42
@aryairani

Copy link
Copy Markdown
Contributor

I'm dogfooding it now 👍

@aryairani aryairani added this to the 1.0.0 milestone Oct 29, 2025

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

Sorry for the delay and ensuing conflicts; this is great. Could you update the PR description to confirm --mcp-editable-branches= isn't a thing anymore; can just strikeout it if desired

@ChrisPenner
ChrisPenner requested a review from a team as a code owner November 5, 2025 20:28
@ChrisPenner
ChrisPenner changed the base branch from trunk to cp/change-comments-sync November 5, 2025 20:31
@ChrisPenner
ChrisPenner changed the base branch from cp/change-comments-sync to trunk November 5, 2025 20:31
@ChrisPenner
ChrisPenner removed the request for review from a team November 5, 2025 20:31
@ChrisPenner
ChrisPenner merged commit ae8ceda into trunk Nov 5, 2025
45 of 46 checks passed
@ChrisPenner
ChrisPenner deleted the mcp/update branch November 5, 2025 22:28
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