Local History MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Local History MCP Servershow me the recent changes to my main.py file"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: memgrep
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-mcpOption 2: From Source
git clone https://github.com/xxczaki/local-history-mcp.git && cd local-history-mcp
pnpm install
pnpm build
pnpm startMCP Tools
Tool | Description |
| List all files with Local History |
| View complete history for a file |
| Get specific history entry content |
| Restore file to previous state (with backup) |
| Search across all history entries |
| 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-mcpFor 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 inspectorAI disclosure
This project contains code generated by Large Language Models (LLMs), under human supervision and proofreading.
License
MIT
Available Tools
6 toolsget_file_historyB
Get the complete history for a specific file
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | The path to the file. Please provide an absolute path (e.g., "/Users/user/project/biome.json") for reliable matching. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must cover behavioral traits. 'Complete history' is vague; it does not disclose whether the tool is read-only, what exactly is returned (metadata, content, diffs), or if there are any side effects. This is insufficient for safe invocation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence with no fluff, but it misses an opportunity to add value (e.g., specifying it's read-only or the scope of 'complete'). Still concise and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a history retrieval tool with no output schema and no annotations, the description is too sparse. It does not explain what 'history' entails (e.g., versions, changes), whether it requires permissions, or what the output format looks like. This leaves the agent with significant uncertainty.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the schema already describes filePath adequately (including absolute path example). The description adds no additional parameter semantics beyond reiterating the tool's purpose.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The verb 'Get' and resource 'complete history' are specific and clearly state the tool's action. It distinguishes from siblings like get_history_entry (specific entry) and get_history_stats (statistics), making its purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies using this tool when you want the full history of a file, but it does not explicitly state when to use alternatives (e.g., get_history_entry for a single version) or mention any prerequisites or restrictions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_history_entryA
Get a specific history entry for a file
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | The path to the file. Please provide an absolute path (e.g., "/Users/user/project/biome.json") for reliable matching. | |
| entryIndex | Yes | The index of the history entry (0 = most recent) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It only states 'get', implying read-only, but fails to mention error handling, return format, or side effects. This minimal transparency is insufficient for a tool with no annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, six-word sentence with no wasted words. It is front-loaded and immediately communicates the tool's purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is adequate for a simple retrieval tool, but it omits details about the return value (e.g., what a history entry contains) and error conditions. Given the absence of an output schema, the description could be more informative.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both parameters having clear descriptions in the schema. The tool description adds no additional meaning beyond what the schema already provides. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get'), the resource ('a specific history entry'), and the scope ('for a file'). It effectively distinguishes this tool from siblings like 'get_file_history' (which lists all entries) and 'restore_from_history' (which restores).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit guidance on when to use this tool versus alternatives, such as 'get_file_history' or 'restore_from_history'. While the context of sibling tools helps, the description itself lacks usage context, exclusions, or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_history_statsA
Get statistics about the local history (total files, entries, etc.)
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description bears full burden. It discloses the return type (statistics) but omits details like idempotency, permission requirements, or performance implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single concise sentence with no redundant information, effectively communicating the tool's function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple no-parameter tool, the description provides adequate context about the output, though listing specific statistics would enhance completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100%. The description adds no parameter specifics, which is acceptable given zero parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it retrieves aggregate statistics like total files and entries, distinguishing it from siblings that deal with specific entries, files, or content searches.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implicitly suggests use when aggregate stats are needed, but does not explicitly contrast with siblings or mention when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_history_filesA
List all files that have local history entries in VS Code
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behavior. It states 'list' implying a read-only operation, but lacks details on side effects, performance, ordering, or limits. With zero parameters, the scope is simple, making the description adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no fluff, front-loaded with the key action and resource. Every word serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema means the description could hint at return format (e.g., file paths). It does not. For a simple list operation with no parameters, the description is minimally complete but lacks details on what the list contains.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (no parameters). With zero parameters, baseline score is 4. The description adds no parameter info, which is acceptable as there are none to describe.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly specifies the verb 'list', the resource 'files that have local history entries', and the context 'in VS Code'. It distinguishes from siblings like get_file_history (for a specific file) and search_history_content (for content search).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance. The description implies usage for listing files with history, but does not contrast with siblings or state exclusions. Usage is inferred from context, not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
restore_from_historyB
Restore a file to a specific point in its local history
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | The absolute path to the file to restore (e.g., "/Users/user/project/biome.json"). | |
| entryIndex | Yes | The index of the history entry to restore (0 = most recent) | |
| createBackup | No | Whether to create a backup of the current file before restoring |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits such as side effects (e.g., overwriting the file), prerequisites, or how the restore operation works. The backup parameter is in the schema but not highlighted in the description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is concise and front-loaded with the essential action. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool modifies state and has no output schema or annotations, the description does not provide sufficient context about the restore behavior, results, or prerequisites. It is incomplete for a mutation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already fully describes parameters. The description adds no additional meaning beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (restore) and the resource (file) with specificity (to a specific point in history). It distinguishes from sibling tools which are about listing or searching history.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives. No explicit context or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_history_contentB
Search for specific content across all history entries
| Name | Required | Description | Default |
|---|---|---|---|
| searchTerm | Yes | The text to search for in history entries | |
| caseSensitive | No | Whether the search should be case sensitive |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description should disclose behavioral traits (e.g., read-only) but only states the search action, leaving the agent uninformed about side effects or limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence is concise and front-loaded, but could be more informative without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a simple tool with full schema coverage, but lacks behavioral or usage context expected given no output schema or annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema covers 100% of parameter descriptions; the description adds no further semantic value beyond what is already documented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Search', the resource 'history entries', and the scope 'across all', distinguishing it from siblings which focus on file-level operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly guide when to use search versus alternatives like get_history_entry or list_history_files, though the purpose is implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
6 tool updates
v1.1.2- Removed
get_file_history - Removed
get_history_entry - Removed
get_history_stats - Removed
list_history_files - Removed
restore_from_history - Removed
search_history_content
6 tool updates
v1.1.0- Added
get_file_history - Added
get_history_entry - Added
get_history_stats - Added
list_history_files - Added
restore_from_history - Added
search_history_content
6 tool updates
v1.0.1- Removed
get_file_history - Removed
get_history_entry - Removed
get_history_stats - Removed
list_history_files - Removed
restore_from_history - Removed
search_history_content
6 tool updates
- First observed
get_file_history - First observed
get_history_entry - First observed
get_history_stats - First observed
list_history_files - First observed
restore_from_history - First observed
search_history_content
TDQS
Each tool targets a distinct operation—retrieving full history, a specific entry, statistics, listing files, restoring, or searching—with no overlap in purpose.
All tools follow a consistent verb_noun pattern in snake_case (e.g., get_file_history, restore_from_history), making the set predictable and easy to navigate.
With six tools, the server covers core local history workflows without unnecessary complexity—appropriate for its focused scope.
The tools provide a complete lifecycle: querying history, listing tracked files, retrieving entries, restoring files, and searching content—no obvious gaps for the stated purpose.
Maintenance
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
Shared memory for AI coding agents. Save once, reuse from Cursor, Claude Code, Codex.
Securely search and manage workspace context files for AI agents and teams.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables querying, searching, and analyzing Cursor IDE conversation history from SQLite workspaceStorage databases. Supports exporting chat data in multiple formats and provides workspace utilities for managing conversation data across projects.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to search and retrieve past chat transcripts from Cursor, Claude Code, and Kiro, providing a global, local memory for context-aware assistance.152MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to securely browse, search, inspect, and understand local project files through Model Context Protocol tools.MIT
- AlicenseBqualityDmaintenanceProvides AI assistants with VS Code integration for file operations, command execution, project analysis, and development workflow automation.29MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/xxczaki/local-history-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server