PRD: Add Delete Plan MCP Tool
Project: ai-plans Date: 2026-02-12 Status: draft
Context
Currently there's no way to delete plans through MCP. Users have to manually delete folders or use git commands. Need a safe way to remove plans that are no longer needed.
Goals
- Add
delete_planMCP tool - Safely remove plan folder and all files
- Update index.md after deletion
- Create git commit with deletion
- Prevent accidental deletions with confirmation
Requirements
Functional
- Add
delete_plantool to MCP server - Delete entire plan folder (project/task/)
- Update main index.md
- Create git commit
- Return confirmation message
- Handle errors gracefully (plan not found, etc.)
Non-functional
- Safe operation (no accidental deletions)
- Clear error messages
- Fast execution (<1s)
Technical Approach
- New tool: delete_plan
- Parameters:
project,task - Validate plan exists
- Delete folder recursively
- Update index.md
- Git commit with message
-
Return success/error
-
Safety considerations:
- Check if plan exists before deleting
- No confirmation prompt (user decides when to call)
- Clear error if plan not found
-
Git commit allows recovery if needed
-
Implementation:
- Add
src/tools/delete-plan.ts - Use
fs.rm(path, { recursive: true }) - Call
updateIndexPage() - Call
commitDocs() - Register in
server.ts
Constraints and Risks
- Deletion is permanent (until git revert)
- Need to handle edge cases (empty folders, etc.)
- Should we delete empty project folders?
Open Questions
- Should we require confirmation parameter?
- Delete empty project folder if last task removed?
- Add to steering rules?