游标数据库 MCP 服务器
用于访问 Cursor IDE 的 SQLite 数据库的模型上下文协议 (MCP) 服务器。该服务器允许 AI 助手探索并与 Cursor 的项目数据、聊天记录和作曲家信息进行交互。
光标
先决条件
游标 IDE
安装
易于安装
使用提供的安装脚本安装所有依赖项:
该脚本将安装:
- 基本 MCP 服务器和依赖项
与 Cursor IDE 一起使用
- 打开 Cursor 并导航至设置->光标设置->MCP。
- 点击:添加新的 MCP 服务器
- 名称:Cursor DB MCP;类型:命令
- 命令:<完全限定路径>uv run --with mcp[cli] mcp run <完全限定路径>/cursor-db-mcp-server.py
现在您可以询问有关数据库的问题或检索有关历史聊天的信息。
与 Claude Desktop 一起使用
将其添加到您的 claude_desktop_config.json 文件中
可用资源
cursor://projects
- 列出所有可用的 Cursor 项目cursor://projects/detailed
- 列出项目的详细信息cursor://projects/{project_name}/chat
- 获取特定项目的聊天数据cursor://projects/{project_name}/composers
- 获取特定项目的作曲家 IDcursor://composers/{composer_id}
- 获取特定作曲家的数据
可用工具
query_table
- 查询项目数据库中的特定表refresh_databases
- 刷新数据库路径列表
工作原理
服务器会扫描您的 Cursor 安装目录,查找项目数据库(state.vscdb 文件)。然后,它会通过 MCP 资源和工具公开这些数据库,以便 AI 助手查询和分析数据。
笔记
- Cursor 将 AI 对话存储在不同位置。聊天记录越来越多地以“composerData”的形式存储在 globalStorage/state.vscdb 下。如果您在查询最近项目的聊天记录时没有得到结果,请尝试查询作曲家。
- 本文是在 Mac 上编写的。其他操作系统可能有所不同。
无耻的插件
喜欢这个?试试Cursor Journal ,直接从 Cursor 聊天记录创建 DevLog!
执照
麻省理工学院
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议服务器使 AI 助手能够探索和与 Cursor IDE 的 SQLite 数据库交互,从而提供对项目数据、聊天历史记录和作曲家信息的访问。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that integrates with Linear, enabling AI assistants to create, update, search, and comment on issues for project management and issue tracking.Last updated -56PythonApache 2.0
- AsecurityFlicenseAqualityA starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.Last updated -169TypeScript
- -securityAlicense-qualityA Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.Last updated -6TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants like Claude to interact with Outline document services, supporting document searching, reading, creation, editing, and comment management.Last updated -2519PythonMIT License