Rewind MCP is a smart and lightweight checkpointing server for Claude Code CLI that automatically creates checkpoints before code modifications. It provides complete undo support, allowing you to restore modified files, recover deleted files, or remove unwanted files across your project with just a few commands.
To install the Rewind MCP server:
git clone https://github.com/khalilbalaree/Rewind-MCP.git
cd Rewind-MCP
npm install
npm run build
You need to add the Rewind MCP server to your Claude Code MCP configuration using one of these methods:
Edit your Claude configuration file at ~/Library/Application Support/Claude/claude_code_config.json
:
{
"mcpServers": {
"Rewind-MCP": {
"command": "node",
"args": ["/absolute/path/to/Rewind-MCP/dist/index.js"],
"env": {}
}
}
}
For easier sharing, create a .mcp.json
file in your project directory:
# In your project directory
cat > .mcp.json << 'EOF'
{
"mcpServers": {
"Rewind-MCP": {
"command": "node",
"args": ["/absolute/path/to/Rewind-MCP/dist/index.js"],
"env": {}
}
}
}
EOF
Rewind MCP automatically creates checkpoints before Claude makes changes to your code. Here's how you can interact with it:
You can ask Claude to perform these checkpoint operations:
checkpoint(files, description)
- Create checkpoint before changesundo(file)
- Restore to previous checkpointlist_undos()
- Show available checkpointscleanup
- Clean up all the checkpointsstatus()
- Show current checkpoint statusHere's a typical workflow with Rewind MCP:
👤 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"
The Rewind MCP server integrates seamlessly with Claude Code, giving you peace of mind when making complex code changes with an AI assistant.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "Rewind-MCP" '{"command":"node","args":["/absolute/path/to/Rewind-MCP/dist/index.js"],"env":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"Rewind-MCP": {
"command": "node",
"args": [
"/absolute/path/to/Rewind-MCP/dist/index.js"
],
"env": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"Rewind-MCP": {
"command": "node",
"args": [
"/absolute/path/to/Rewind-MCP/dist/index.js"
],
"env": []
}
}
}
3. Restart Claude Desktop for the changes to take effect