Skip to main content
Glama

Cursor DB MCP Server

by jbdamask

游标数据库 MCP 服务器

用于访问 Cursor IDE 的 SQLite 数据库的模型上下文协议 (MCP) 服务器。该服务器允许 AI 助手探索并与 Cursor 的项目数据、聊天记录和作曲家信息进行交互。

光标光标 GIF

先决条件

游标 IDE

安装

易于安装

使用提供的安装脚本安装所有依赖项:

python install.py

该脚本将安装:

  • 基本 MCP 服务器和依赖项

与 Cursor IDE 一起使用

  1. 打开 Cursor 并导航至设置->光标设置->MCP。
  2. 点击:添加新的 MCP 服务器
  3. 名称:Cursor DB MCP;类型:命令
  4. 命令:<完全限定路径>uv run --with mcp[cli] mcp run <完全限定路径>/cursor-db-mcp-server.py

游标数据库 MCP

现在您可以询问有关数据库的问题或检索有关历史聊天的信息。

数据库结构

数据库键

与 Claude Desktop 一起使用

为 Claude Desktop 安装 MCP 服务器

将其添加到您的 claude_desktop_config.json 文件中

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

游标DB模糊搜索

可用资源

  • cursor://projects - 列出所有可用的 Cursor 项目
  • cursor://projects/detailed - 列出项目的详细信息
  • cursor://projects/{project_name}/chat - 获取特定项目的聊天数据
  • cursor://projects/{project_name}/composers - 获取特定项目的作曲家 ID
  • cursor://composers/{composer_id} - 获取特定作曲家的数据

可用工具

  • query_table - 查询项目数据库中的特定表
  • refresh_databases - 刷新数据库路径列表

工作原理

服务器会扫描您的 Cursor 安装目录,查找项目数据库(state.vscdb 文件)。然后,它会通过 MCP 资源和工具公开这些数据库,以便 AI 助手查询和分析数据。

笔记

  1. Cursor 将 AI 对话存储在不同位置。聊天记录越来越多地以“composerData”的形式存储在 globalStorage/state.vscdb 下。如果您在查询最近项目的聊天记录时没有得到结果,请尝试查询作曲家。
  2. 本文是在 Mac 上编写的。其他操作系统可能有所不同。

无耻的插件

喜欢这个?试试Cursor Journal ,直接从 Cursor 聊天记录创建 DevLog!

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器使 AI 助手能够探索和与 Cursor IDE 的 SQLite 数据库交互,从而提供对项目数据、聊天历史记录和作曲家信息的访问。

  1. 先决条件
    1. 安装
      1. 易于安装
    2. 与 Cursor IDE 一起使用
      1. 与 Claude Desktop 一起使用
    3. 可用资源
      1. 可用工具
        1. 工作原理
          1. 笔记
            1. 无耻的插件
              1. 执照

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that integrates with Linear, enabling AI assistants to create, update, search, and comment on issues for project management and issue tracking.
                  Last updated -
                  5
                  6
                  Python
                  Apache 2.0
                • A
                  security
                  F
                  license
                  A
                  quality
                  A starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.
                  Last updated -
                  1
                  6
                  9
                  TypeScript
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.
                  Last updated -
                  6
                  TypeScript
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that enables AI assistants like Claude to interact with Outline document services, supporting document searching, reading, creation, editing, and comment management.
                  Last updated -
                  25
                  19
                  Python
                  MIT License

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/jbdamask/cursor-db-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server