Skip to main content
Glama
checkpointer

checkpointer

checkpointer

MCP server for file checkpointing and undo. Built with the Python MCP SDK v2 (mcp[cli] 2.0.0b1), implementing the 2025-07-28 MCP spec.

Lets an AI agent safely read, write, and edit files within a project directory while maintaining a full snapshot history. Changes can be reverted per-file or globally without requiring git or any external VCS.

How it works

All file state is tracked in a .checkpointer/ directory at the project root. Before any mutating tool runs, the current file content is hashed, compressed, and stored as a snapshot. A master ledger (master.json) records the per-file undo stack and a global edit history.

This adds minimal token overhead — snapshots are stored on disk, not in context.

Related MCP server: claude-vigil-mcp

Tools

Tool

Description

read_file

Read a file with line numbers. Smart-truncates large files (head+tail). Supports start_line/end_line for ranges.

list_directory

List directory contents, optionally recursive to a given depth.

write_file

Overwrite or create a file. Snapshots before writing.

edit_file_lines

Replace a line range. Returns surrounding context with line numbers.

str_replace

Content-based find-and-replace. old_str must be unique in the file. No line numbers needed.

undo_file_edit

Revert a specific file to its state before the last mutation.

undo_global

Revert whichever file was last mutated.

revert_file

Discard all AI changes for a specific file.

reset_session

Revert all AI changes across the project and delete history.

get_session_diff

Unified diff of a file against its original state.

Setup

Requires Python 3.10+.

uv sync

Set PROJECT_DIR to the root of the project you want to checkpoint:

PROJECT_DIR=/path/to/project uv run main.py

Configuration

After cloning the repo, add to your Claude Code MCP config:

{
  "mcpServers": {
    "checkpointer": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/this/repo/",
        "server.py"
      ],
      "env": {
        "PROJECT_DIR": "/path/to/target/project/"
      }
    }
  }
}

Available Tools

10 tools
edit_file_linesOverwrite a specific chunk in a file.A
Destructive

To replace a specific chunk in a file from start_line inclusive to end_line inclusive with content(one based indexing for lines), after it's snapshot has been taken.

Inputs: content (required), end_line (required), filepath (required), start_line (required). Returns: result

get_session_diffB

Get a diff of what exactly was modified in a file from its orignal state.

Inputs: filepath (required). Returns: result

list_directoryGet the structure of a directory.A
Read-only

To read the structure inside a directory, either surface level or recursively. Results will be truncated if they exceed 500.

Inputs: directory_path (required), depth, recursively. Returns: result

read_fileRead a file inside the project directory.A
Read-only

To read the contents of a file with line numbers. Returns numbered lines. For large files, output is truncated to head+tail unless a specific range is given via start_line/end_line (1-based, inclusive).

Inputs: filepath (required), end_line, start_line. Returns: result

reset_sessionWipe all AI changes across the directory.D
Destructive

Wipe all AI changes across the directory

Inputs: no named parameters. Returns: result

revert_fileUndo all LLM changes for this specific file.B
Destructive

Discard all AI changes for this specific file.

Inputs: filepath (required). Returns: result

str_replaceReplace matching text in a file.A
Destructive

Replace an exact occurrence of old_str with new_str in a file. old_str must appear exactly once in the file. No line numbers needed — matches on content.

Inputs: new_str (required), old_str (required), filepath (required). Returns: result

undo_file_editUndo changes in a file.A
Destructive

Revert file before the most recent mutating tool was called on it. This will be recorded in the master ledger as an undo operation.

Inputs: filepath (required). Returns: result

undo_globalUndo changes in the last file edited or reverted.A
Destructive

Revert the last file edited before the most recent mutating tool was called on it(undo_file_edit is also mutating)

Inputs: no named parameters. Returns: result

write_fileOverwrite a entire file.C
Destructive

To completely overwrite a file, after it's snapshot has been taken. (or to create a new file)

Inputs: content (required), filepath (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools have distinct purposes, but undo_file_edit and undo_global could be confused due to similar names and descriptions. edit_file_lines and str_replace both replace content, though their methods differ. Overall, the overlap is minor.

    Naming Consistency4/5

    Tool names follow a verb_noun snake_case pattern (e.g., edit_file_lines, list_directory, write_file). However, 'str_replace' deviates from the pattern (no underscore after verb), and 'undo_file_edit' is slightly awkward. Overall consistent.

    Tool Count5/5

    10 tools is appropriate for the scope of file editing and version control. Each tool has a clear role without being excessive or insufficient.

    Completeness4/5

    The tool set covers reading, writing, editing (two methods), listing, diff, undo, revert, and session reset. Missing features like manual snapshot saving or session listing are minor gaps given the automatic snapshotting implied.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server that intercepts and controls AI agent actions in your codebase by enforcing policies on file operations and commands, with logging, approval workflows, and rollback capabilities.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server for creating named checkpoints and snapshots of projects, with selective file restore, content diffs, and artifact preservation, enabling safe recovery from external file changes in Claude Code.
      5
      16 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides on-demand safety for AI coding workflows, enabling inspection, review, checkpointing, and rollback of risky actions.
      37 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that lets multiple AI coding agents share state, preserve context across sessions, and coordinate via a knowledge graph, messaging, and branch-preserving checkpoint/resume with conflict handling.
      57 npm
      1
      Apache 2.0