Skip to the content

Capsid menu

capsid_change_repo

Change a repo, on Capsid. Needs the write grant.

Can change or removeReaches GitHub or Cloudflare

What it does

Change a namespace's GitHub repo: write or delete a file (on a branch, as a pull request, or directly where the caller may), or create a branch. Every change goes through guardedWrite and its flags. Needs the write grant; a direct write needs the can_direct_write flag, a workflow file the can_write_workflows flag, and a protected or money path its flag.

What a client is told

The MCP hints it carries, so a client can ask before it acts (src/tool-annotations.ts).

Its 3 actions

Chosen by the action argument.

write_file Write a file.

Write a file to a namespace's GitHub repo. mode 'pr' (default) commits to a new branch, or to branch if given, and opens a PR; mode 'direct' commits straight to the default branch. Mode 'pr' REFUSES branch set to the default branch, and a branch that already has an open PR unless pr names that PR's number. REFUSES any path under .github/workflows/ unless allow_workflow_write: true is passed. mode 'direct' needs the can_direct_write flag, allow_workflow_write the can_write_workflows flag, a protected path can_touch_protected and a money path money_paths. Needs the write grant.

Takes namespace, path, content, message, mode, branch, repo, allow_workflow_write, pr.

delete_file Delete a file.

Delete a file from a namespace's GitHub repo. mode 'pr' (default) commits the deletion to a new branch, or to branch if given, and opens a PR; mode 'direct' deletes on the default branch. Mode 'pr' REFUSES branch set to the default branch, and a branch that already has an open PR unless pr names that PR's number. The file must exist. REFUSES any path under .github/workflows/ unless allow_workflow_write: true is passed. mode 'direct' needs the can_direct_write flag, allow_workflow_write the can_write_workflows flag, a protected path can_touch_protected and a money path money_paths. Needs the write grant.

Takes namespace, path, message, mode, branch, repo, allow_workflow_write, pr.

create_branch Create a branch.

Create a branch in a namespace's GitHub repo. Branches off the default branch unless 'from' is given. Needs the write grant.

Takes namespace, branch, from, repo.

Arguments

The arguments of capsid_change_repo
ArgumentTypeNeededWhat it is
actionone of: write_file, delete_file, create_branchalwayswrite_file | delete_file | create_branch.
namespacestringalways
pathstringno
contentstringno
messagestringno
modeone of: pr, directno
branchstringno
repostringnoA repo label or mapped "owner/name". Defaults to the primary repo.
allow_workflow_writebooleannoOpt in to writing under .github/workflows/, which is refused without it. Needs the can_write_workflows flag; audit-logged.
prwhole numbernoThe number of branch's open pull request, required when branch has one; the commit then lands on it. Refused if it is not that branch's open pull request.
fromstringno