Skip to main content
Glama

游标数据库 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

Related MCP Servers

  • -
    security
    -
    license
    -
    quality
    A Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.
  • A
    security
    -
    license
    A
    quality
    A Model Context Protocol (MCP) server for Cursor IDE that simplifies the installation and configuration of other MCP servers.
    Last updated -
    3
    95
    70
    MIT License
    • Apple
    • Linux
  • -
    security
    -
    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 -
    7
    MIT License
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.
    Last updated -
    8
    19
    4
    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