Skip to main content

A Model Context Protocol (MCP) server for accessing Cursor IDE's SQLite databases

Project description

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 In Cursor GIF

Prerequisites

Cursor IDE

Installation

Easy Installation

Use the provided installation script to install all dependencies:

python install.py

This 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: <fully qualified path to>uv run --with mcp[cli] mcp run <fully qualified path to>/cursor-db-mcp-server.py

Cursor DB MCP

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

DB structure

DB keys

Using with Claude Desktop

Installing MCP servers for Claude Desktop

Add this 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"
      ]
    }

Cursor DB fuzzy search

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_cursor_db_mcp-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_cursor_db_mcp-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_cursor_db_mcp-0.1.0.tar.gz.

File metadata

File hashes

Hashes for iflow_mcp_cursor_db_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 228b31947174f27cab21d0c50ebe64bd3de8ef8c6ad1cf07a8edd28a01547226
MD5 50c49fab75602d1760fa6877aba081c0
BLAKE2b-256 63804cf12697e82fc4281e0c98da3c8c02f5f9f40eb4101debe526ead5f2ca76

See more details on using hashes here.

File details

Details for the file iflow_mcp_cursor_db_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iflow_mcp_cursor_db_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 996c950c7861e0c83667dcc1a57d8ec5455f920e0e87594f8656b3c9abce53d9
MD5 4c06d4a804f71786d88f63f6835356f0
BLAKE2b-256 8c9ef6eb20b8b8b5b76d094dbf9566ffbfb0238d47562aeaa992e68e953b51e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page