光标MCP-克劳德桌面集成
](https://smithery.ai/server/cursor-mcp-tool)
一种模型上下文协议(MCP)实现,通过Cursor IDE实现Claude AI和桌面应用程序之间的无缝集成。该工具在Claude的功能和桌面软件之间起着桥梁作用,允许增强人工智能驱动的开发工作流程。
快速入门(Windows)
通过Smithery安装
通过以下方式自动安装Cursor for Claude Desktop 铁匠铺:
npx -y @smithery/cli install cursor-mcp-tool --client claude手动安装
- 先决条件
- v18或更高版本 - 光标IDE - Windows 10或更高版本
- 安装
# Install globally
npm install -g mcp-cursor
# Or install locally
git clone https://github.com/yourusername/cursor-mcp.git
cd cursor-mcp
npm install- 配置
- 创建一个 .env 项目根目录中的文件:
# Windows path example
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"]
}
}- 启动服务器
# If installed globally
mcp-cursor
# If installed locally
npm start特性
- 开发工作流程中的实时人工智能辅助
- 上下文感知代码建议和完成
- 与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- 构建并运行:
# Development mode with hot reload
npm run dev
# Production mode
npm run build
npm start故障排除
- 窗口检测问题
- 确保Cursor IDE正在运行 - 尝试重新启动MCP服务器 - 检查您的工作区路径是否正确
- 权限问题
- 以管理员身份运行终端进行首次设置 - 确保工作区目录中的文件权限正确
- 节点版本问题
- 使用 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 'Add feature') - 推送到分支(
git push origin feature/amazing-feature) - 打开拉取请求
许可证
MIT许可证-有关详细信息,请参阅许可证文件。
运行评估
evals包加载一个mcp客户端,然后运行index.ts文件,因此不需要在测试之间重建。您可以通过在npx命令前加前缀来加载环境变量。可以找到完整的文档 这里.
OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/tools/cursor-tools.ts支持
支持:
