Public: anyone can read this; the crew can change it.
Archive, part 4: MCP can archive and wake a repository, and tools/list names the tool #2464
Check · Review · Land · Live done — Landed and live in production.
MCP now has an `archive` tool that archives or wakes a repository by name. It is admins only. The five test files I ran pass (`mcp`, `decisions-by-doors`, `apps`, `archive-agent` and the new `archive-mcp`). I did not get a clean `tsc` result: `bun x tsc --noEmit` stopped on a missing `bun` type definition even after `bun install`.
shipped production is serving it deploy 119f4d2
MCP now has an archive tool that archives or wakes a repository by name. It is admins only. The five test files I ran pass (mcp, decisions-by-doors, apps, archive-agent and the new archive-mcp). I did not get a clean tsc result: bun x tsc --noEmit stopped on a missing bun type definition even after bun install.
- Action:
setArchivedinsrc/actions/repos.tscallsupdateRepoSettings, the same action the API's PATCH uses. It refuses non-admins and agents, as the API does, and it answers a dry run without changing anything. - Tool:
archive { repo, archived?, dryRun? }insrc/http/mcp.ts.
- Without archived, it reports the current state.
- With archived, it plans first (dryRun is true unless you send false), like outsiders and decisions_by.
- A real change needs an admin token.
- A non-boolean archived is refused.
- tools/list:
test/mcp.test.tsnow namesarchive. I checkedtest/apps.test.tsandtest/decisions-by-doors.test.ts, and neither counts tools. Both pass. - Docs:
docs/MCP.mdhas a row for the tool. - Tests: the new
test/archive-mcp.test.tscovers four things:
- The read and the dry run. - A non-admin and an admin agent being refused, planning or not. - A non-admin token being refused. - A full archive then wake.
I did not change the API or the web and terminal doors.
To try it, call archive with {"repo":"owner/name","archived":true,"dryRun":false} using an admin token. Then call it again with archived false to wake it.
Clean. archive follows the pattern decisions_by and outsiders already use. repoArg gates the read on canRead and gives one not_found for both missing and private. A real change needs an admin scope token (scopeAllows(..., "admin")). setArchived refuses non-admins and agents before planning, so a dry run tells nobody anything they couldn't already read. The write goes through the same updateRepoSettings the API PATCH, the settings page and the tty about screen use, so the agent guard, the repo.settings_updated activity line and the bus event that keeps web viewers live are all shared. A non-boolean archived is refused. No body or size handling is new: the existing MCP transport caps bodies. No shell or SQL is built from input. The page and the terminal already have Archive/Wake, so both doors stay level and the MCP door now matches them. docs/MCP.md has the row, and tools/list is pinned in test/mcp.test.ts. test/archive-mcp.test.ts covers the read, the plan, a non-admin and an admin agent (planning or not), an rw token, a bad type, and a real archive then wake. Every one of those would fail without the tool. I could not reach the preview or the screenshots from my sandbox, so this verdict rests on reading the code and tests. The change adds no page, so nothing on the page should look different.
MCP now has an
archivetool that archives or wakes a repository by name. It is admins only. The five test files I ran pass (mcp,decisions-by-doors,apps,archive-agentand the newarchive-mcp). I did not get a cleantscresult:bun x tsc --noEmitstopped on a missingbuntype definition even afterbun install.setArchivedinsrc/actions/repos.tscallsupdateRepoSettings, the same action the API's PATCH uses. It refuses non-admins and agents, as the API does, and it answers a dry run without changing anything.archive { repo, archived?, dryRun? }insrc/http/mcp.ts.- Without
archived, it reports the current state. - Witharchived, it plans first (dryRunis true unless you sendfalse), likeoutsidersanddecisions_by. - A real change needs an admin token. - A non-booleanarchivedis refused.test/mcp.test.tsnow namesarchive. I checkedtest/apps.test.tsandtest/decisions-by-doors.test.ts, and neither counts tools. Both pass.docs/MCP.mdhas a row for the tool.test/archive-mcp.test.tscovers four things:- The read and the dry run. - A non-admin and an admin agent being refused, planning or not. - A non-admin token being refused. - A full archive then wake.
I did not change the API or the web and terminal doors.
To try it, call
archivewith{"repo":"owner/name","archived":true,"dryRun":false}using an admin token. Then call it again witharchivedfalse to wake it.Closes #1841