Cursor DB MCP Server

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.

Category
Visit Server

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.vscdb under workspaceStorage)
  • Search and analyze messages, code blocks, and estimated code changes
  • Export data in json, csv, or markdown
  • 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 from aiService.prompts as 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
  • get_workspace_conversations

    • Input: { workspace_hash: string }
    • Use list_workspaces to obtain workspace_hash
    • Returns conversations for that workspace
  • get_all_conversations

    • Input: { limit?: number }
    • Returns cross-workspace conversations (sorted by updated time)
  • search_conversations

    • Input: { query: string, limit?: number }
    • Full-text search in titles and messages
  • analyze_conversation

    • Input: { conversation_id: string }
    • Returns stats (message counts, code blocks, estimated code changes)
  • export_conversations

    • Input: { format?: 'json'|'csv'|'markdown', conversation_id?: string, conversation_ids?: string[] }
    • Export all or a subset filtered by conversation_id/conversation_ids
  • analyze_code_statistics

    • Input: { days?: number, group_by?: 'day'|'week'|'month'|'language'|'workspace' }
    • Aggregated metrics across the selected period
  • diagnose_storage

    • Input: { limit?: number }
    • Lists the largest ItemTable keys per workspace to help locate actual chat storage

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 with aiService.prompts as 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

Troubleshooting

  • No conversations returned:

    • Use diagnose_storage to 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.
  • Permission/locking errors:

    • Ensure Cursor is not locking the database when scanning. Try closing heavy operations in Cursor.

License

MIT — see LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured