Public: anyone can read this; the crew can change it.

MCP `backups`: where snapshots go and the last ones taken, for a forge admin #5425

Parked opened this
Closed without merging

I added a read-only MCP tool backups that takes no arguments, is admin-only, and answers from the same functions the /settings/backups page uses. The four tests you named pass and the type check is clean. I didn't run the rest of the suite.

Notes

stopped parked by the crew deploy d49281c

opened this

I added a read-only MCP tool backups that takes no arguments, is admin-only, and answers from the same functions the /settings/backups page uses. The four tests you named pass and the type check is clean. I didn't run the rest of the suite.

What it returns

  • Destination: destination is { kind: sealed | dir | env, where }, and never a credential. With no destination it is null, and says carries the page's sentence. I moved that sentence into an exported NO_DESTINATION in src/web/pages/backups.ts, so the page and the tool can't drift apart.
  • Snapshots: the newest fourteen from the store, each as { key, at, bytes }. If the store can't be listed, listing carries the error rather than failing the call.
  • Mirror: mirror has configured, where, reachable, syncedAt, newest and problem, which is the mirrorNeed sentence.
  • Non-admins: the tool isn't listed for them, and a direct call is refused with the page's 404 words.

Tests and docs

  • test/mcp-backups.test.ts has the three cases: no destination, a local destination with one snapshot, and a non-admin refused. The tool is also added to the expected tools/list in test/mcp.test.ts.
  • docs/MCP.md has one new row.

Size cap

  • The tool itself fits, but tools/list was only 3 bytes under the 37,000 headroom in test/mcp-size.test.ts, so adding it put the list over. I shortened about a dozen other tool descriptions by a few words each, without changing what they say. I did not raise the ceiling.
  • test/mcp.test.ts asserts on some description wording, so two phrases that test checks (the sign-up descriptions) are kept as they were.

Left out

  • It doesn't report the last snapshot failure or the last restore drill, which the page shows. I kept to the destination, snapshots and mirror you listed.

To try it: as an admin, call the backups tool from any MCP client.

🤖 Generated with Claude Code

Closes #5415

commented

I added a read-only MCP tool backups that takes no arguments, is admin-only, and answers from the same functions the /settings/backups page uses. The four tests you named pass and the type check is clean. I didn't run the rest of the suite.

What it returns

  • Destination: destination is { kind: sealed | dir | env, where }, and never a credential. With no destination it is null, and says carries the page's sentence. I moved that sentence into an exported NO_DESTINATION in src/web/pages/backups.ts, so the page and the tool can't drift apart.
  • Snapshots: the newest fourteen from the store, each as { key, at, bytes }. If the store can't be listed, listing carries the error rather than failing the call.
  • Mirror: mirror has configured, where, reachable, syncedAt, newest and problem, which is the mirrorNeed sentence.
  • Non-admins: the tool isn't listed for them, and a direct call is refused with the page's 404 words.

Tests and docs

  • test/mcp-backups.test.ts has the three cases: no destination, a local destination with one snapshot, and a non-admin refused. The tool is also added to the expected tools/list in test/mcp.test.ts.
  • docs/MCP.md has one new row.

Size cap

  • The tool itself fits, but tools/list was only 3 bytes under the 37,000 headroom in test/mcp-size.test.ts, so adding it put the list over. I shortened about a dozen other tool descriptions by a few words each, without changing what they say. I did not raise the ceiling.
  • test/mcp.test.ts asserts on some description wording, so two phrases that test checks (the sign-up descriptions) are kept as they were.

Left out

  • It doesn't report the last snapshot failure or the last restore drill, which the page shows. I kept to the destination, snapshots and mirror you listed.

To try it: as an admin, call the backups tool from any MCP client.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("one list > an issue assigned to you is a row that says so, and every door counts it") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs