MCP Catalogs
首页local-history-mcp screenshot

local-history-mcp

by xxczaki·15·综合分 42

MCP 服务器提供 AI 访问 VS Code/Cursor 本地历史记录,用于数据恢复。

developer-toolsfile-systemai-llm
5
Forks
11
活跃 Issue
本月
最近提交
2 天前
收录于

概述

这个 MCP 服务器弥合了 AI 助手和编辑器本地历史记录之间的差距,实现了数据恢复和增强的上下文感知能力。与撤销/重做不同,本地历史记录在保存点捕获文件快照,保留了否则会丢失的工作内容。通过模型上下文协议,该服务器为个人使用提供了直接访问 Cursor/VS Code 本地历史记录的途径。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:从编辑器历史记录中恢复意外删除或覆盖的代码
:搜索文件的所有先前版本以找到更早的实现
:将文件恢复到先前的状态,同时创建当前版本的备份
:什么是本地历史记录?
:这个 MCP 服务器如何工作?

什么时候选它

如果您使用 VS Code 或 Cursor,并且需要恢复丢失的代码版本或在 AI 工作流程中比较文件状态,请选择此工具。

什么时候不要选它

如果您需要为其他编辑器进行历史记录恢复,或者在本地历史记录被禁用或不支持的环境中工作,请不要使用此工具。

此 server 暴露的工具

从 README 抽取出 6 个工具
  • 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

可对比工具

vscode-local-historyfile-history-mcpgit-mcp

安装

包管理器安装

# npm
npx local-history-mcp

# pnpm
pnpm dlx local-history-mcp

# yarn
yarn global add local-history-mcp

# bun
bunx local-history-mcp

Claude Desktop

添加到您的 Claude Desktop 配置中:

{
  "mcpServers": {
    "local-history": {
      "command": "npx",
      "args": ["-y", "local-history-mcp"]
    }
  }
}

VS Code/Cursor

使用一键安装按钮或按照官方文档添加此 MCP 服务器。

FAQ

什么是本地历史记录?
本地历史记录是 VS Code 和 Cursor 中的一项功能,它在文件保存时自动保存文件快照,允许从意外删除或覆盖中恢复丢失的工作。
这个 MCP 服务器如何工作?
该服务器通过 MCP 协议提供工具,使 AI 助手能够访问、搜索和恢复本地历史数据库中的文件版本。

local-history-mcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。