C

Cursor 实时代码双向通信工具

@Buga-luga/cursor-mcp
1 Stars 556 次浏览 Buga-luga 更新于 2026-08-23

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

该服务暂未提供标准配置,请参考 README 手动接入

可用工具 (2 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get-alerts 1 个参数 需填 1 项

Get weather alerts for a state

必填参数:state

get-forecast 2 个参数 需填 2 项

Get weather forecast for a location

必填参数:latitude、longitude

服务介绍

Cursor MCP - Claude Desktop 集成

smithery 徽章

这是一个模型上下文协议(MCP)实现,通过Cursor IDE在Claude AI与桌面应用程序之间实现了无缝集成。此工具作为Claude功能与桌面软件之间的桥梁,允许增强AI驱动的开发工作流程。

快速开始 (Windows)

通过 Smithery 安装

要通过 Smithery 自动安装适用于 Claude 桌面版的 Cursor:

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

手动安装

  1. 先决条件

  2. 安装

    # 全局安装
    npm install -g mcp-cursor
    
    # 或者本地安装
    git clone https://github.com/yourusername/cursor-mcp.git
    cd cursor-mcp
    npm install
    
  3. 配置

    • 在你的项目根目录下创建一个 .env 文件:
      # Windows 路径示例
      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. 启动服务器

    # 如果全局安装
    mcp-cursor
    
    # 如果本地安装
    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. 构建并运行:

    # 开发模式带热重载
    npm run dev
    
    # 生产模式
    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 '添加功能')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 打开一个 Pull Request

许可证

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

支持

获取支持:

相关 MCP 服务