Skip to main content
Glama
xxczaki

Local History MCP Server

by xxczaki

Local History MCP Server

Access Cursor/VS Code Local History through the Model Context Protocol for AI-powered data recovery

CI Release MCP

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

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:

Install MCP Server

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.

License

MIT

Available Tools

6 tools
get_file_historyB

Get the complete history for a specific file

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesThe path to the file. Please provide an absolute path (e.g., "/Users/user/project/biome.json") for reliable matching.

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesThe path to the file. Please provide an absolute path (e.g., "/Users/user/project/biome.json") for reliable matching.
entryIndexYesThe index of the history entry (0 = most recent)

TDQS

A3.5/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 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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesThe absolute path to the file to restore (e.g., "/Users/user/project/biome.json").
entryIndexYesThe index of the history entry to restore (0 = most recent)
createBackupNoWhether to create a backup of the current file before restoring

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

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 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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
searchTermYesThe text to search for in history entries
caseSensitiveNoWhether the search should be case sensitive

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

  1. 6 tool updatesv1.1.2
    • Removedget_file_history
    • Removedget_history_entry
    • Removedget_history_stats
    • Removedlist_history_files
    • Removedrestore_from_history
    • Removedsearch_history_content
  2. 6 tool updatesv1.1.0
    • Addedget_file_history
    • Addedget_history_entry
    • Addedget_history_stats
    • Addedlist_history_files
    • Addedrestore_from_history
    • Addedsearch_history_content
  3. 6 tool updatesv1.0.1
    • Removedget_file_history
    • Removedget_history_entry
    • Removedget_history_stats
    • Removedlist_history_files
    • Removedrestore_from_history
    • Removedsearch_history_content
  4. 6 tool updates
    • First observedget_file_history
    • First observedget_history_entry
    • First observedget_history_stats
    • First observedlist_history_files
    • First observedrestore_from_history
    • First observedsearch_history_content

TDQS

A3.9/5.0
Disambiguation5/5

Each tool targets a distinct operation—retrieving full history, a specific entry, statistics, listing files, restoring, or searching—with no overlap in purpose.

Naming Consistency5/5

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.

Tool Count5/5

With six tools, the server covers core local history workflows without unnecessary complexity—appropriate for its focused scope.

Completeness5/5

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

ActivityActive
ResponsivenessUnresponsive

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
    D
    maintenance
    Enables 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
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to search and retrieve past chat transcripts from Cursor, Claude Code, and Kiro, providing a global, local memory for context-aware assistance.
    15
    2
    MIT

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/xxczaki/local-history-mcp'

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