Cursor DB MCP Server
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.
README
cursor-db-mcp (MCP Server)
An MCP server for querying, exporting, and analyzing Cursor IDE conversation history from the new workspaceStorage (SQLite) layout.
Highlights
- Query conversations across all workspaces (SQLite
state.vscdbunderworkspaceStorage) - Search and analyze messages, code blocks, and estimated code changes
- Export data in
json,csv, ormarkdown - Workspace utilities to list/filter recent workspaces
- Diagnostics tool to discover actual storage keys in your environment
Data sources and fallbacks
- Primary: legacy chat key (if present):
workbench.panel.aichat.view.aichat.chatdata - Heuristics: if the legacy key is missing, the server scans values for structures containing
conversations/messages/assistant/role. - Last resort: synthesizes conversations from
aiService.generations(user-side prompts). Optionally, it heuristically pairs items fromaiService.promptsas assistant replies to improve completeness.
Note: Depending on your Cursor version, assistant replies may not be locally persisted under known keys. The diagnostics tool can help you discover new keys. If you can share a confirmed key/path containing assistant messages, this server can be adapted quickly.
Installation
npm install
npm run build
Run MCP Inspector for local testing:
npm run inspector
The Inspector prints a local URL for interactive testing in your browser.
Configure in Cursor
Basic configuration:
{
"mcp.servers": {
"cursor-db": {
"command": "cursor-db-mcp",
"args": []
}
}
}
Custom workspaceStorage path:
{
"mcp.servers": {
"cursor-db": {
"command": "cursor-db-mcp",
"args": ["--workspace-path", "/custom/path/to/workspaceStorage"]
}
}
}
Available Tools
-
list_workspaces
- Input:
{ recent_days?: number } - Returns workspace list with hash, path, projectPath, lastModified
- Input:
-
get_workspace_conversations
- Input:
{ workspace_hash: string } - Use
list_workspacesto obtainworkspace_hash - Returns conversations for that workspace
- Input:
-
get_all_conversations
- Input:
{ limit?: number } - Returns cross-workspace conversations (sorted by updated time)
- Input:
-
search_conversations
- Input:
{ query: string, limit?: number } - Full-text search in titles and messages
- Input:
-
analyze_conversation
- Input:
{ conversation_id: string } - Returns stats (message counts, code blocks, estimated code changes)
- Input:
-
export_conversations
- Input:
{ format?: 'json'|'csv'|'markdown', conversation_id?: string, conversation_ids?: string[] } - Export all or a subset filtered by
conversation_id/conversation_ids
- Input:
-
analyze_code_statistics
- Input:
{ days?: number, group_by?: 'day'|'week'|'month'|'language'|'workspace' } - Aggregated metrics across the selected period
- Input:
-
diagnose_storage
- Input:
{ limit?: number } - Lists the largest
ItemTablekeys per workspace to help locate actual chat storage
- Input:
Ensuring assistant replies in results
- If your environment has a key containing full conversations (including assistant messages), the server will parse it directly.
- If not, the server falls back to
aiService.generations(user-only prompts) and tries to pair them withaiService.promptsas assistant replies heuristically. This improves completeness but may not perfectly reflect the original assistant responses. - To achieve exact assistant outputs, provide the confirmed storage key or path where Cursor persists assistant replies in your version.
Export formats
- JSON: raw conversations array
- CSV: one line per conversation with high-level metadata
- Markdown: per-conversation sections with messages and code blocks
Development
npm install
npm run build
npm run watch # optional: incremental builds
npm run inspector
Notes
- SQLite access uses
sqlite3. On some systems you may need build tools (e.g., Xcode CLT on macOS) installed. - Default workspace storage paths:
- macOS:
~/Library/Application Support/Cursor/User/workspaceStorage - Windows:
%APPDATA%/Cursor/User/workspaceStorage - Linux:
~/.config/Cursor/User/workspaceStorage
- macOS:
Troubleshooting
-
No conversations returned:
- Use
diagnose_storageto inspect keys. If no conversation-like key exists, your Cursor version may not store assistant replies locally. - The server will still return synthesized conversations from
aiService.generations(user prompts). Provide the real chat key to enable full parsing.
- Use
-
Permission/locking errors:
- Ensure Cursor is not locking the database when scanning. Try closing heavy operations in Cursor.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。