Skip to content

feat(mcp): add pad_workspace restore + deleted actions (TASK-1973)#834

Merged
xarmian merged 1 commit into
mainfrom
feat/mcp-workspace-restore
Jul 6, 2026
Merged

feat(mcp): add pad_workspace restore + deleted actions (TASK-1973)#834
xarmian merged 1 commit into
mainfrom
feat/mcp-workspace-restore

Conversation

@xarmian

@xarmian xarmian commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

Adds two actions to the pad_workspace MCP ToolDef, mirroring the TASK-1972 CLI commands pad workspace restore / pad workspace deleted:

  • deleted (read-only) — lists the caller's soft-deleted workspaces still inside the 30-day restore window.
  • restore (mutating, non-destructive, owner-only) — un-soft-deletes a workspace by slug while it's still restorable.

Both passThrough to the CLI subcommands and reuse the existing slug param (no new params). Non-interactive and non-destructive, so MCP-appropriate per CLAUDE.md's surface criteria.

Why

TASK-1972 (#833) shipped the CLI/web soft-delete recovery surface; this closes the loop by exposing recovery to MCP agents (Claude Desktop / Cursor / cloud remote MCP) so a workspace deleted by accident can be listed and restored conversationally.

Details

  • deleted marked read-only in tool_surface.go::readOnlyActions; restore stays a write (the safe default).
  • Wired both into the HTTP MCP route table (dispatch_http_routes.go) so cloud/remote MCP dispatches to the existing GET /workspaces/deleted + POST /workspaces/{slug}/restore endpoints instead of "not yet implemented over HTTP transport" — mirroring TASK-1521's create/claim wiring.
  • ToolSurfaceVersion 0.7 -> 0.8 (pure addition; backwards-compatible for v0.7 consumers that don't enumerate the new actions).
  • Documented in the CLAUDE.md MCP stability contract.
  • Extended catalog bijection/dispatch tests + cmdhelp fixture and added route-table + HTTP-mapping tests.

Gate

go build ./..., golangci-lint run ./internal/mcp/... (0 issues), go test ./internal/mcp/... — all green. Codex review: CLEAN.

Closes TASK-1973

https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST

Expose the TASK-1972 CLI commands `pad workspace restore` /
`pad workspace deleted` on the MCP surface as two new pad_workspace
actions:

- `deleted` (read-only) — lists the caller's soft-deleted workspaces
  still inside the 30-day restore window.
- `restore` (mutating, non-destructive, owner-only) — un-soft-deletes
  a workspace by slug while it's still restorable.

Both passThrough to the CLI subcommands and reuse the existing `slug`
param (no new params). Non-interactive and non-destructive, so
MCP-appropriate.

- Mark `deleted` read-only in tool_surface.go readOnlyActions (restore
  stays a write, the safe default).
- Wire both into the HTTP MCP route table (dispatch_http_routes.go) so
  cloud/remote MCP dispatches to the existing /workspaces/deleted +
  /workspaces/{slug}/restore endpoints instead of "not yet implemented
  over HTTP transport" — mirroring TASK-1521's create/claim wiring.
- Bump ToolSurfaceVersion 0.7 -> 0.8 and document the addition in the
  CLAUDE.md MCP stability contract.
- Extend catalog bijection/dispatch tests + cmdhelp fixture and add
  route-table + HTTP-mapping tests for the new actions.

Claude-Session: https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST
@xarmian xarmian merged commit 7687521 into main Jul 6, 2026
4 checks passed
@xarmian xarmian deleted the feat/mcp-workspace-restore branch July 6, 2026 16:37
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