Token导航 LogoToken导航TokenDH.com
Cursor Conversations MCP logo
开发工具stdio官方级别未说明来源级核验

Cursor Conversations MCP

MCP Server

cursor-chat-history-mcp

将Cursor聊天记录与Git提交历史链接的服务,提供代码上下文检索和聊天历史搜索功能。

工具数

8

提示词数

0

GitHub Stars

33

资源数

0
开发工具TypeScriptClineCursorWindsurfCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

vltansky

提供方

vltansky

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx cursor-chat-history-mcp link list-conversation-links --conversation <id>

详细介绍

光标聊天历史MCP

将Cursor对话连接到git历史记录。

为什么?

你做出承诺。几周后,你会想: *“我为什么这样写?”*

git消息说 fix auth bug 但真正的背景——调试会话、考虑的替代方案、人工智能建议——存在于你永远不会再找到的Cursor对话中。

此MCP服务器会自动将您的Cursor对话链接到git提交。当你重新审视代码时,人工智能助手可以调出原始讨论。

快速开始

添加到 .cursor/mcp.json:

{
  "mcpServers": {
    "cursor-chat-history": {
      "command": "npx",
      "args": ["-y", "--package=cursor-chat-history-mcp", "cursor-chat-history-mcp"]
    }
  }
}

就是这样。钩子在第一次使用时会自动安装。

你能做什么

查找代码上下文

"What was the context behind commit abc123?"
"Find the conversation that led to this fix"
"Show discussions about auth.ts from the last month"

搜索您的聊天记录

"Find all debugging sessions about performance"
"Search conversations mentioning useState"
"List recent conversations in this project"

提取图案

"Create TypeScript guidelines from my actual usage"
"Extract error handling patterns from my conversations"
"Summarize my React patterns from chat history"

可用工具

Git链接器

工具目的
get_file_context获取与文件相关的对话和提交
get_commit_conversations查找与提交链接的对话
list_conversation_commits查找与对话链接的提交
link_conversation_commit手动链接对话↔ 承诺

聊天记录

工具目的
list_conversations使用过滤器浏览(项目、关键字、文件)
get_conversation获取完整的对话内容
search_conversations多关键字和模式搜索
get_conversation_analytics使用模式、文件活动、语言统计

隐私

  • 100%本地 -没有外部服务,没有API密钥
  • 您的数据保留在磁盘上 -仅限于SQLite数据库
  • 开源 -自己审核代码

______________________________________________________________________

运作原理

MCP服务器启动时会自动安装挂钩:

  • 光标挂钩 (~/.cursor/hooks.json)-捕获文件编辑和会话结束
  • Git提交后钩子 (当前仓库)-链接提交到对话

当您提交时,系统会使用以下命令查找相关对话:

  • 文件重叠(70%):提交对话中讨论的触及文件
  • 近期(30%):过去14天的对话

高效的上下文检索

大型对话不会直接加载到上下文中。相反:

  1. 使用 get_file_context 随着 keywords 查找相关对话
  2. 呼叫 get_conversation -写信给 ~/.cursor-chat-history/context/conversations/.md
  3. 使用Read/Grep工具高效地浏览markdown文件

CLI命令

# Query links
npx cursor-chat-history-mcp link list-conversation-links --conversation 
npx cursor-chat-history-mcp link get-commit-links --hash 

# Manual linking
npx cursor-chat-history-mcp link manual --conversation  --commit 

数据库位置

数据库macOSWindowsLinux
光标聊天~/Library/Application Support/Cursor/User/globalStorage/state.vscdb%APPDATA%/Cursor/...~/.config/Cursor/...
Git链接~/Library/Application Support/CursorChatHistory/links.sqlite%APPDATA%/CursorChatHistory/...~/.local/share/CursorChatHistory/...
上下文文件~/.cursor-chat-history/context/conversations/相同相同

覆盖 CURSOR_DB_PATHCURSOR_LINKS_DB_PATH.

工具参考

Core Tools Parameters

list_conversations

  • limit (默认值:10)-结果数量
  • projectPath -按项目筛选
  • keywords -搜索关键字
  • hasCodeBlocks -按代码存在进行筛选

get_conversation

  • conversationId (必填)-对话ID
  • summaryOnly -仅返回摘要(保存上下文)

search_conversations

  • query -文本搜索
  • keywords + keywordOperator ('AND'/'OR')-多关键字
  • likePattern -SQL LIKE模式

get_conversation_analytics

  • scope -“全部”、“最近”、“项目”
  • projectPath -按项目筛选
  • includeBreakdowns -\[“文件”、“语言”、“时间”、“大小”\]

Git Linker Tools Parameters

get_file_context

  • filePath (必需)-获取上下文的文件
  • keywords -按关键字过滤(例如。, ["JWT", "auth"])-返回匹配的摘录
  • limit -最大结果(默认值:5)

list_conversation_commits

  • conversationId -按对话筛选
  • projectPath -按项目筛选
  • filePath -按文件筛选

get_commit_conversations

  • commitHash (必填)-Git提交哈希

link_conversation_commit

  • conversationId (必填)
  • commitHash (必填)
  • confidence -链接置信度(0-1)

发展

git clone https://github.com/vltansky/cursor-chat-history-mcp
cd cursor-chat-history-mcp
yarn install
yarn build

支持的AI助手

助理状态备注
光标✅ 完整聊天、作曲、代理模式
克劳德代码✅ 完整VS代码扩展
克莱恩/鲁/基洛✅ 完整基于JSON任务的存储
帆板运动✅ 完整SQLite(与游标模式相同)
GitHub Copilot 聊天助手✅ 完整VS代码本机

路线图

  • \[ \] 知识图提取 -从对话中提取实体和关系(了解更多)
  • \[x\] 多代理支持 -Cline,Windsurf,Copilot聊天
  • \[x\] 质量评分 -优先考虑与解决方案的对话
  • \[x\] 自然时间过滤器 -“上周”、“昨天”
  • \[x\] 主题聚类 -按检测到的主题分组
  • \[ \] 语义搜索 -通过嵌入找到类似的对话

技术说明

  • 支持传统和现代Cursor对话格式
  • 使用ROWID按时间顺序排序(UUID不是按时间顺序排列的)
  • 关闭游标以避免数据库锁定问题
  • docs/SPEC.md 用于git链接器规范

许可证

麻省理工学院

目录标签

目录标签

开发工具TypeScriptCline代码上下文混合部署聊天历史Git集成AI辅助

支持客户端

CursorWindsurfCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

cursor-chat-history-mcp

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP