游标数据库 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!
执照
麻省理工学院
Related MCP Servers
- -security-license-qualityA Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server for Cursor IDE that simplifies the installation and configuration of other MCP servers.Last updated -39570MIT License
- -security-license-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 -7MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.Last updated -8194MIT License