Access local file history in VS Code and Cursor editors
MCP server exposing Cursor/VS Code Local History to AI assistants - browse, search, and restore file save-point snapshots.
Maintainer of this project? Claim this page to edit the listing.
1.1.2Add to Favorites
Why it matters
Retrieve and review previous versions of code files from the local history maintained by VS Code or Cursor, enabling developers to track changes, recover lost work, and understand code evolution without relying on version control systems.
Outcomes
What it gets done
Browse historical versions of files saved in VS Code/Cursor local history
Compare current code against previous local snapshots
Recover accidentally deleted or overwritten code segments
Review incremental changes made during a coding session
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-local-history | bash Overview
Local History MCP Server
Local History MCP Server exposes Cursor/VS Code Local History save-point snapshots to an AI assistant for browsing, searching, and restoring lost file versions. Use it for AI-assisted recovery of overwritten or lost code from editor save-point history; it's not a substitute for git version control.
What it does
Local History MCP Server bridges AI assistants and the editor's Local History feature (in Cursor/VS Code), which captures file snapshots at every save point - distinct from undo/redo, and often the only remaining copy of work that was later overwritten or deleted. It lets an assistant list files with history, view a file's full history timeline, retrieve a specific historical entry's content, restore a file to a previous state (creating a backup first), search across all history entries' content, and get overview statistics.
It exists because current AI assistants (Claude, Cursor AI, GitHub Copilot) have no built-in access to this Local History data despite otherwise extensive diagnostic capabilities - this server fills that specific gap for personal data recovery.
When to use - and when NOT to
Use this connector when you've lost code that was overwritten, deleted, or corrupted since a save point, and want an assistant to search or browse editor Local History to recover it, or when you want to compare a file's evolution across save points.
Do not rely on it as a substitute for version control (git) - Local History is a local, editor-specific safety net for save-point recovery, not a full history/branching system.
Inputs and outputs
Tools take file paths and, for entry-specific operations, a history entry identifier or search query. Outputs are lists of tracked files, a file's history timeline, a specific entry's content, restore confirmation (with backup created), search matches across history content, or aggregate statistics.
Capabilities
list_history_files: list all files that have Local Historyget_file_history: view the complete history timeline for a fileget_history_entry: get a specific history entry's contentrestore_from_history: restore a file to a previous state, creating a backup firstsearch_history_content: search across all history entries' contentget_history_stats: overview statistics
How to install
npx local-history-mcp
For Cursor, use the one-click install button, or for Claude Code:
claude mcp add local-history -- npx -y local-history-mcp
Also installable from source via pnpm install && pnpm build && pnpm start.
Who it's for
Developers using Cursor or VS Code who want an AI assistant to help recover lost code from editor Local History save-point snapshots.
Source README
Local History MCP Server
Access Cursor/VS Code Local History through the Model Context Protocol for AI-powered data recovery
Overview
This MCP server bridges the gap between AI assistants and editor Local History, enabling data recovery and enhanced context awareness. Unlike undo/redo, Local History captures file snapshots at save points, preserving work that would otherwise be lost.
Problem: Current AI assistants (Claude, Cursor AI, GitHub Copilot) cannot access Local History data despite having extensive diagnostic capabilities.
Solution: Simple MCP server providing direct access to Cursor/VS Code Local History for personal use.
Installation
Option 1: Package Manager (Recommended)
Install using your preferred package manager:
# npm
npx local-history-mcp
# pnpm
pnpm dlx local-history-mcp
# yarn
yarn global add local-history-mcp
# bun
bunx local-history-mcp
Option 2: From Source
git clone https://github.com/xxczaki/local-history-mcp.git && cd local-history-mcp
pnpm install
pnpm build
pnpm start
MCP Tools
| Tool | Description |
|---|---|
list_history_files |
List all files with Local History |
get_file_history |
View complete history for a file |
get_history_entry |
Get specific history entry content |
restore_from_history |
Restore file to previous state (with backup) |
search_history_content |
Search across all history entries |
get_history_stats |
Overview statistics |
Configuration
Cursor
You can install this MCP server in Cursor using the one-click install button:
Or manually configure by following the official Cursor MCP documentation.
Claude Code & Claude Desktop
For Claude Code (CLI), install directly:
claude mcp add local-history -- npx -y local-history-mcp
For Claude Desktop, see the official MCP documentation.
VS Code
See the official documentation.
Development
# Development mode
pnpm dev
# Run tests
pnpm test
# Linting and formatting
pnpm lint
# Launch MCP Inspector
pnpm inspector
AI disclosure
This project contains code generated by Large Language Models (LLMs), under human supervision and proofreading.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.