Cursor 实时代码双向通信工具
通过启用与 Claude 的实时代码索引、分析和双向通信,促进与 Cursor 代码编辑器的集成,支持并发会话和自动重新连接。
可用工具 (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 集成
这是一个模型上下文协议(MCP)实现,通过Cursor IDE在Claude AI与桌面应用程序之间实现了无缝集成。此工具作为Claude功能与桌面软件之间的桥梁,允许增强AI驱动的开发工作流程。
快速开始 (Windows)
通过 Smithery 安装
要通过 Smithery 自动安装适用于 Claude 桌面版的 Cursor:
npx -y @smithery/cli install cursor-mcp-tool --client claude
手动安装
-
先决条件
- Node.js v18 或更高版本
- Cursor IDE
- Windows 10 或更高版本
-
安装
# 全局安装 npm install -g mcp-cursor # 或者本地安装 git clone https://github.com/yourusername/cursor-mcp.git cd cursor-mcp npm install -
配置
- 在你的项目根目录下创建一个
.env文件:# Windows 路径示例 DEFAULT_WORKSPACE_PATH=C:/Users/YourUsername/Documents/cursor-workspaces
- 在你的项目根目录下创建一个
-
添加到 Claude 的 MCP 配置中
将以下内容添加到你的 Claude 配置中:{ "name": "cursor", "type": "mcp", "config": { "server": "https://glama.ai/mcp/servers/4fg1gxbcex", "capabilities": ["cursor_control", "window_management"] } } -
启动服务器
# 如果全局安装 mcp-cursor # 如果本地安装 npm start
功能
- 在您的开发工作流中提供实时AI协助
- 上下文感知的代码建议和补全
- 与 Cursor IDE 无缝集成
- Windows 自动化以提高生产力
详细设置
本地开发环境设置
-
克隆并安装:
git clone https://github.com/yourusername/cursor-mcp.git cd cursor-mcp npm install -
创建环境配置文件:
cp .env.example .env编辑
.env并设置你的工作区路径:DEFAULT_WORKSPACE_PATH=C:/Users/YourUsername/Documents/cursor-workspaces -
构建并运行:
# 开发模式带热重载 npm run dev # 生产模式 npm run build npm start
故障排除
-
窗口检测问题
- 确保 Cursor IDE 正在运行
- 尝试重启 MCP 服务器
- 检查工作区路径是否正确
-
权限问题
- 第一次设置时以管理员身份运行终端
- 确保工作区目录中有适当的文件权限
-
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- 编译 TypeScriptnpm start- 运行生产服务器npm run dev- 启动带有热重载的开发服务器
贡献
- 叉分仓库
- 创建特性分支 (
git checkout -b feature/amazing-feature) - 提交更改 (
git commit -m '添加功能') - 推送到分支 (
git push origin feature/amazing-feature) - 打开一个 Pull Request
许可证
MIT 许可证 - 详情请参阅 LICENSE 文件。
支持
获取支持:
- 在 GitHub 仓库中打开一个问题
- 加入我们的 Discord 社区
- 查看 FAQ