feat(mcp): add pad_workspace restore + deleted actions (TASK-1973)#834
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two actions to the
pad_workspaceMCP ToolDef, mirroring the TASK-1972 CLI commandspad 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 byslugwhile it's still restorable.Both
passThroughto the CLI subcommands and reuse the existingslugparam (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
deletedmarked read-only intool_surface.go::readOnlyActions;restorestays a write (the safe default).dispatch_http_routes.go) so cloud/remote MCP dispatches to the existingGET /workspaces/deleted+POST /workspaces/{slug}/restoreendpoints instead of "not yet implemented over HTTP transport" — mirroring TASK-1521's create/claim wiring.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