cursor-db-mcp
Model Context Protocol server for querying Cursor chat history
Documentation
Cursor DB MCP Server
A Model Context Protocol (MCP) server for accessing Cursor IDE's SQLite databases. This server allows AI assistants to explore and interact with Cursor's project data, chat history, and composer information.
__Cursor__

Prerequisites
Cursor IDE
Installation
Easy Installation
Use the provided installation script to install all dependencies:
python install.pyThis script will install:
- Basic MCP server and dependencies
Using with Cursor IDE
1. Open Cursor and navigate to Settings->Cursor Settings->MCP.
2. Click: Add new MCP server
3. Name: Cursor DB MCP; Type: Command
4. Command: \uv run --with mcp[cli] mcp run \/cursor-db-mcp-server.py

Now you can ask questions about the database or retrieve info about historical chats.


Using with Claude Desktop
Installing MCP servers for Claude Desktop
Add this to your claude_desktop_config.json file
"cursor-db-mcp": {
"command": "/uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"/cursor-db-mcp-server.py"
]
}
Available Resources
- `cursor://projects` - List all available Cursor projects
- `cursor://projects/detailed` - List projects with detailed information
- `cursor://projects/{project_name}/chat` - Get chat data for a specific project
- `cursor://projects/{project_name}/composers` - Get composer IDs for a specific project
- `cursor://composers/{composer_id}` - Get data for a specific composer
Available Tools
- `query_table` - Query a specific table in a project's database
- `refresh_databases` - Refresh the list of database paths
How It Works
The server scans your Cursor installation directory to find project databases (state.vscdb files). It then exposes these databases through MCP resources and tools, allowing AI assistants to query and analyze the data.
Notes
1. Cursor stores AI conversations in different places. Increasingly, chats are stored as "composerData" under globalStorage/state.vscdb. If you don't get results when asking about chats for recent projects, try asking for composers.
2. This was written on a Mac. YMMV with other OS
Shameless Plug
Like this? Try Cursor Journal to create DevLogs directly from Cursor chat history!
License
MIT
Frequently asked questions
What is cursor-db-mcp?
cursor-db-mcp is Model Context Protocol server for querying Cursor chat history
How do I install cursor-db-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is cursor-db-mcp open source?
Yes — it is hosted on GitHub at https://github.com/jbdamask/cursor-db-mcp and has 21 stars.
Related MCP tools
🙌 OpenHands: Code Less, Make More for the Model Context Protocol. Enhance AI assistants with powerful integrations. Python-based implementation.
Universal memory layer for AI Agents; Announcing OpenMemory MCP - local and secure memory management. Python-based implementation.
基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择ChatGPT/Claude/DeepSeek/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
🚀 The fast, Pythonic way to build MCP servers and clients Trusted by 19900+ developers. Trusted by 19900+ developers. Trusted by 19900+ developers.
🔥 MaxKB is an open-source platform for building enterprise-grade agents. MaxKB 是强大易用的开源企业级智能体平台。 for the Model Context Protocol. Enhance AI assistants with po
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP