Cursor DB Explorer MCP server

Provides access to Cursor IDE's SQLite databases for exploring project data, chat history, and composer information through an API that automatically detects installations and exposes structured resources and tools for analysis.
Back to servers
Setup instructions
Provider
John Damask
Release date
Mar 08, 2025
Language
Python
Stats
21 stars

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.

Prerequisites

Before installation, ensure you have Cursor IDE installed on your system.

Installation

Easy Installation Method

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.

Integration with Cursor IDE

  1. Open Cursor and navigate to Settings->Cursor Settings->MCP
  2. Click: Add new MCP server
  3. Configure with the following parameters:
    • Name: Cursor DB MCP
    • Type: Command
    • Command: uv run --with mcp[cli] mcp run /cursor-db-mcp-server.py

After configuration, you can interact with the MCP server by asking questions about your database or retrieving information about historical chats.

Integration with Claude Desktop

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

Available Resources

The server exposes several endpoints that you can use to retrieve information:

  • cursor://projects - Lists all available Cursor projects
  • cursor://projects/detailed - Lists projects with detailed information
  • cursor://projects/{project_name}/chat - Gets chat data for a specific project
  • cursor://projects/{project_name}/composers - Gets composer IDs for a specific project
  • cursor://composers/{composer_id} - Gets data for a specific composer

Available Tools

The server provides the following tools:

  • query_table - Allows you to query a specific table in a project's database
  • refresh_databases - Refreshes the list of database paths

How It Works

The 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.

Notes

  1. Cursor stores AI conversations in different locations. More recent chats are typically stored as "composerData" under globalStorage/state.vscdb. If you don't see results when inquiring about chats for recent projects, try asking for composers instead.
  2. The server was developed on a Mac, so your experience may vary on other operating systems.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later