Skip to main content
Glama
README.md
# πŸ”„ Rewind MCP

Smart and lightweight checkpointing mcp server for Claude Code CLI.

## Features

- 🎯 **Smart Checkpointing**: Automatically checkpoint project states before agent wants to make any changes
- πŸ”„ **Complete Undo Support**: Restore modified files, recover deleted files, or remove unwanted files
- ⚑ **Fast Multi-File Restore**: Rewind changes across multiple files instantly

## Example Agent Interaction

```
πŸ‘€ User: "Add error handling..."

πŸ€– Agent: Creating checkpoint before modifications...
βœ… Checkpoint: "Before adding error handling"

πŸ€– Agent: "I have added error handling to the code"

πŸ‘€ User: "This breaks the flow, please rewind"

πŸ€– Agent: Restoring files from checkpoint...
βœ… Files restored to state before error handling
```

## πŸš€ Quick Start

### Installation
```bash
git clone https://github.com/khalilbalaree/Rewind-MCP.git
cd Rewind-MCP
```
then,
```bash
npm install
npm run build
```

### Claude Code Configuration

Add this server to your Claude Code MCP configuration:

#### User-Based Configuration (Global)
Edit `~/Library/Application Support/Claude/claude_code_config.json`:

```json
{
  "mcpServers": {
    "Rewind-MCP": {
      "command": "node",
      "args": ["/absolute/path/to/Rewind-MCP/dist/index.js"],
      "env": {}
    }
  }
}
```

#### Project-Specific Configuration (Alternative)

For easier project sharing and version control, create a `.mcp.json` file in your project directory:

```bash
# In your project directory
cat > .mcp.json << 'EOF'
{
  "mcpServers": {
    "Rewind-MCP": {
      "command": "node",
      "args": ["/absolute/path/to/Rewind-MCP/dist/index.js"],
      "env": {}
    }
  }
}
EOF
```


## Use Cases

```
πŸ‘€ User: "Add error handling to my API"

πŸ€– Agent: I'll add comprehensive error handling to your API files.

[Agent modifies src/api/routes.js]
βœ… Checkpoint created and pushed to stack: "Modified src/api/routes.js"

[Agent creates src/middleware/errorHandler.js]
βœ… Checkpoint created and pushed to stack: "Created src/middleware/errorHandler.js"

πŸ€– Agent: I've added try-catch blocks and centralized error handling to your API routes and created a new error middleware.

πŸ‘€ User: "Actually, I want to try a different approach. Can you show me what checkpoints are available?"

πŸ€– Agent: I'll show you the available checkpoints.
πŸ“‹ Available checkpoints:
  1. "Created src/middleware/errorHandler.js" - [Most Recent]
  2. "Modified src/api/routes.js"
  3. "Database schema update"
  4. "Initial project setup"

πŸ‘€ User: "Rewind the most recent changes"

πŸ€– Agent: I'll restore the files from the most recent checkpoints.
βœ… Undone: "Created src/middleware/errorHandler.js"
βœ… Undone: "Modified src/api/routes.js"
Restored files:
  - src/api/routes.js (restored)
  - src/middleware/errorHandler.js (deleted)

πŸ‘€ User: "Perfect! Now implement error handling using a custom Error class instead"

πŸ€– Agent: I'll implement error handling using a custom Error class approach.

[Agent modifies src/api/routes.js]
βœ… Checkpoint created and pushed to stack: "Modified src/api/routes.js"

[Agent creates src/utils/CustomError.js]
βœ… Checkpoint created and pushed to stack: "Created src/utils/CustomError.js"

πŸ€– Agent: I've implemented error handling using a custom Error class that provides better error categorization and response formatting.
```


## Available Functional Calls for Claude
Just ask, and it will do the rest.

- `checkpoint(files, description)` - Create checkpoint before changes
- `undo(file)` - Restore to previous checkpoint  
- `list_undos()` - Show available checkpoints
- `cleanup` - clean up all the checkpoints
- `status()` - Show current checkpoint status


## 🀝 Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## πŸ“„ License

MIT License - see [LICENSE](LICENSE) file for details.

## πŸ™‹β€β™‚οΈ Support

- πŸ“– [Documentation](https://github.com/khalilbalaree/Rewind-MCP/wiki)
- πŸ› [Issue Tracker](https://github.com/khalilbalaree/Rewind-MCP/issues)
- πŸ’¬ [Discussions](https://github.com/khalilbalaree/Rewind-MCP/discussions)

---

**Built with ❀️ for the Claude Code ecosystem**

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: checkpoint creates a checkpoint, cleanup clears checkpoints, list_undos lists them, status provides system status, and undo performs the undo operation. The descriptions make it unambiguous which tool to use for each action.

Naming Consistency5/5

All tools follow a consistent naming pattern: checkpoint, cleanup, list_undos, status, and undo. They use clear, imperative verbs that directly describe their function, with no mixing of conventions or styles.

Tool Count5/5

With 5 tools, this server is well-scoped for its undo system purpose. Each tool serves a specific role in the checkpoint/undo lifecycle, and there are no extraneous or missing tools for this focused functionality.

Completeness5/5

The tool set provides complete coverage for the undo system domain: checkpoint creation, cleanup, listing, status checking, and undo execution. There are no gaps in the CRUD/lifecycle operations needed for this functionality.

Maintenance

ActivityInactive
ResponsivenessNo issues