Cursor MCP Server

local-only server

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

Cursor MCP - Claude 桌面集成

模型上下文协议 (MCP) 实现,可通过 Cursor IDE 实现 Claude AI 与桌面应用程序的无缝集成。该工具可作为 Claude 功能与桌面软件之间的桥梁,从而增强 AI 驱动的开发工作流程。

快速启动(Windows)

通过 Smithery 安装

要通过Smithery自动安装 Cursor for Claude Desktop:

npx -y @smithery/cli install cursor-mcp-tool --client claude

手动安装

  1. 先决条件
  2. 安装
    # Install globally npm install -g mcp-cursor # Or install locally git clone https://github.com/yourusername/cursor-mcp.git cd cursor-mcp npm install
  3. 配置
    • 在项目根目录中创建一个.env文件:
      # Windows path example DEFAULT_WORKSPACE_PATH=C:/Users/YourUsername/Documents/cursor-workspaces
  4. 添加到 Claude 的 MCP 配置将以下内容添加到您的 Claude 配置中:
    { "name": "cursor", "type": "mcp", "config": { "server": "https://glama.ai/mcp/servers/4fg1gxbcex", "capabilities": ["cursor_control", "window_management"] } }
  5. 启动服务器
    # If installed globally mcp-cursor # If installed locally npm start

特征

  • 开发工作流程中的实时 AI 协助
  • 上下文感知的代码建议和完成
  • 与 Cursor IDE 无缝集成
  • Windows 自动化可提高生产力

详细设置

本地开发设置

  1. 克隆并安装:
    git clone https://github.com/yourusername/cursor-mcp.git cd cursor-mcp npm install
  2. 创建环境配置:
    cp .env.example .env
    编辑.env并设置您的工作区路径:
    DEFAULT_WORKSPACE_PATH=C:/Users/YourUsername/Documents/cursor-workspaces
  3. 构建并运行:
    # Development mode with hot reload npm run dev # Production mode npm run build npm start

故障排除

  1. 窗口检测问题
    • 确保 Cursor IDE 正在运行
    • 尝试重启 MCP 服务器
    • 检查你的工作区路径是否正确
  2. 权限问题
    • 首次设置时以管理员身份运行终端
    • 确保工作区目录中有正确的文件权限
  3. Node 版本问题
    • 使用nvm切换到 Node.js v18 或更高版本:
      nvm install 18 nvm use 18

项目结构

cursor-mcp/ ├── src/ # Source code │ ├── services/ # Core services │ ├── handlers/ # Event handlers │ └── types/ # TypeScript definitions ├── build/ # Compiled JavaScript └── .env # Environment configuration

脚本

  • npm run build编译 TypeScript
  • npm start运行生产服务器
  • npm run dev - 使用热重载启动开发服务器

贡献

  1. 分叉存储库
  2. 创建功能分支( git checkout -b feature/amazing-feature
  3. 提交更改( git commit -m 'Add feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

执照

MIT 许可证 - 详情请参阅 LICENSE 文件。

支持

如需支持:

-
security - not tested
A
license - permissive license
-
quality - not tested

通过实现实时代码索引、分析和与 Claude 的双向通信,支持并发会话和自动重新连接,促进与 Cursor 代码编辑器的集成。

  1. Quick Start (Windows)
    1. Installing via Smithery
    2. Installing Manually
  2. Features
    1. Detailed Setup
      1. Local Development Setup
      2. Troubleshooting
    2. Project Structure
      1. Scripts
        1. Contributing
          1. License
            1. Support
              ID: 4fg1gxbcex