The Cursor DB MCP Server provides a Model Context Protocol (MCP) implementation that allows AI assistants to access and interact with Cursor IDE's SQLite databases. This server enables exploration of project data, chat history, and composer information, making it easier to retrieve and analyze your Cursor activities.
Before installation, ensure you have Cursor IDE installed on your system.
The simplest way to install the server and its dependencies is by using the provided installation script:
python install.py
This script will automatically install the basic MCP server and all required dependencies.
After configuration, you can interact with the MCP server by asking questions about your database or retrieving information about historical chats.
To use this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json
file:
"cursor-db-mcp": {
"command": "<fully qualified path to>/uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"<fully qualified path to>/cursor-db-mcp-server.py"
]
}
For more information about installing MCP servers for Claude Desktop, visit: https://modelcontextprotocol.io/quickstart/user
The server exposes several endpoints that you can use to retrieve information:
cursor://projects
- Lists all available Cursor projectscursor://projects/detailed
- Lists projects with detailed informationcursor://projects/{project_name}/chat
- Gets chat data for a specific projectcursor://projects/{project_name}/composers
- Gets composer IDs for a specific projectcursor://composers/{composer_id}
- Gets data for a specific composerThe server provides the following tools:
query_table
- Allows you to query a specific table in a project's databaserefresh_databases
- Refreshes the list of database pathsThe server operates by scanning your Cursor installation directory to locate project databases (state.vscdb files). These databases are then exposed through MCP resources and tools, allowing AI assistants to query and analyze the data efficiently.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "cursor-db-mcp" '{"command":"uv","args":["run","--with","mcp[cli]","mcp","run","cursor-db-mcp-server.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-db-mcp": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"cursor-db-mcp-server.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"cursor-db-mcp": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"cursor-db-mcp-server.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect