Skip to main content
Glama

🔄 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

Related MCP server: Rewindex

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

git clone https://github.com/khalilbalaree/Rewind-MCP.git
cd Rewind-MCP

then,

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:

{
  "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:

# 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 file for details.

🙋‍♂️ Support


Built with ❤️ for the Claude Code ecosystem

Available Tools

5 tools
checkpointA

MANDATORY: ALWAYS call this function FIRST before making ANY file modifications, deletions, or creations. This creates a checkpoint to enable undo functionality. This must be called before every single file operation - no exceptions. Never modify files without calling checkpoint first.

ParametersJSON Schema
NameRequiredDescriptionDefault
filesYesArray of file paths that will be modified, created, or deleted
descriptionNoConcise, action-focused description of the next specific change to be madeManual checkpoint

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly indicates this is a prerequisite action for enabling undo functionality, implying it's a safe, non-destructive setup operation. However, it doesn't specify what happens if called multiple times, error conditions, or system-specific constraints like rate limits or permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized but repetitive ('This must be called before every single file operation - no exceptions. Never modify files without calling checkpoint first'). While front-loaded with the mandatory instruction, it could be more concise by eliminating redundancy while maintaining clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description provides strong contextual completeness regarding its critical role in the workflow. It clearly explains the tool's purpose, mandatory usage, and relationship to file operations. However, it doesn't describe what the tool returns or confirm successful checkpoint creation, leaving some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain format requirements for file paths or provide examples for the description field). Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose: 'creates a checkpoint to enable undo functionality' before file operations. It specifies the verb ('creates a checkpoint') and resource ('file modifications, deletions, or creations'), distinguishing it from siblings like 'undo' or 'list_undos' that handle existing checkpoints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage instructions: 'ALWAYS call this function FIRST before making ANY file modifications, deletions, or creations' and 'before every single file operation - no exceptions'. It clearly states when to use it (before file changes) and when not to (without file changes), with strong emphasis on mandatory usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cleanupB

Clear all undo checkpoints from the stack

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Clear') which implies a destructive operation, but doesn't specify whether this is irreversible, requires confirmation, affects system state, or has side effects. For a tool with zero annotation coverage and a potentially destructive function, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero waste—it states the exact action and target without fluff. It's appropriately sized and front-loaded, making it highly efficient for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's potential complexity (a destructive operation with no annotations and no output schema), the description is incomplete. It doesn't explain the outcome (e.g., what 'cleared' means, if confirmation is needed, or what happens post-operation), leaving the agent with insufficient context for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description appropriately doesn't add parameter details, earning a baseline score of 4 for not introducing unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Clear') and the target resource ('all undo checkpoints from the stack'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_undos' or 'undo', which would require mentioning that this removes all checkpoints rather than listing or reverting them individually.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'undo' or 'checkpoint'. It lacks context about scenarios where clearing all checkpoints is appropriate, prerequisites, or warnings about irreversible effects, leaving the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_undosB

List all undo checkpoints in the stack

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but doesn't explain what 'undo checkpoints' are, how the stack works, whether this is a read-only operation, or what the output format looks like. This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words, making it highly concise and front-loaded. Every part of the sentence contributes directly to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'undo checkpoints' or 'the stack' mean, nor does it describe the return values or behavioral context, leaving the agent with insufficient information to use the tool effectively beyond its basic purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100%, so there's no need for parameter details in the description. The description appropriately doesn't mention parameters, earning a high baseline score for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('undo checkpoints in the stack'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'checkpoint' or 'undo', which likely have related but distinct functions, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'checkpoint' or 'undo', nor does it mention any prerequisites or context for usage. It simply states what the tool does without indicating appropriate scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

statusA

Get current status of the undo system (checkpoint count, number of checkpoints in the stack, and whether undo is possible)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the return data but doesn't disclose behavioral traits like whether this is a read-only operation, if it has side effects, performance characteristics, or error conditions. The description is purely informational about output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently conveys the tool's purpose and output details without any redundant or unnecessary information. It's appropriately sized and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no annotations, and no output schema, the description adequately explains what the tool does and what information it returns. However, it lacks details on behavioral aspects like side effects or error handling, which would be beneficial for a tool interacting with system state.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (empty schema). The description appropriately doesn't add parameter details beyond what the schema provides, which is minimal since there are no parameters. Baseline for 0 parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get current status') and the exact resource ('undo system'), listing the specific data points returned (checkpoint count, number of checkpoints in stack, undo possibility). It distinguishes from siblings like 'checkpoint' (create), 'cleanup' (remove), 'list_undos' (list), and 'undo' (execute).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying what information is retrieved about the undo system, suggesting it's for monitoring state. However, it doesn't explicitly state when to use this tool versus alternatives like 'list_undos' or provide any exclusion criteria or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

undoA

Undo the last checkpoint (pops from stack and restores files). Each call removes the latest checkpoint from the stack. To undo multiple changes, call this function repeatedly until the desired state is reached.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it's a destructive operation (removes from stack, restores files), operates on a stack-based checkpoint system, and requires repeated calls for multiple undos. It doesn't mention error cases (e.g., what happens if the stack is empty) or side effects, but covers core behavior well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured: two sentences that front-load the core action ('undo the last checkpoint') followed by operational details. Every sentence earns its place by explaining how it works and how to use it for multiple undos, with zero wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive undo operation), lack of annotations, and no output schema, the description is mostly complete. It explains what the tool does, how to use it, and the stack mechanism. It could improve by mentioning error handling (e.g., empty stack) or what 'restores files' entails, but it's sufficient for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so the baseline is 4. The description adds no parameter-specific information (as there are none), which is appropriate. It does imply the tool operates on an implicit stack state, but this is behavioral rather than parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('undo the last checkpoint'), the mechanism ('pops from stack and restores files'), and distinguishes it from siblings like 'checkpoint' (which creates checkpoints) and 'list_undos' (which lists them). It goes beyond just restating the tool name by explaining the stack-based behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides usage guidance: 'Each call removes the latest checkpoint from the stack' and 'To undo multiple changes, call this function repeatedly until the desired state is reached.' This tells the agent exactly how to use it versus alternatives (like calling multiple times vs. other tools).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4/5.0
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

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides persistent context management for Claude AI coding assistants, allowing you to save and restore conversation context, create checkpoints, and organize information across sessions to prevent losing important work history and decisions during long coding sessions.
    181
    133
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Auto-snapshot tool for AI agents. Reduces the risk of AI agents breaking your code by automatically saving a snapshot of every file change locally. Rewind sessions, audit code changes, and inspect diffs directly from your AI chat or the built-in dashboard. Free and safe no cloud run local.
    1

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/khalilbalaree/Rewind-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server