Skip to content

Cursor 集成

将 TaskFlow AI 集成到 Cursor,让 AI 编程助手更强大


📋 前置要求

  • Cursor 已安装
  • Node.js 18+ 或 npm 已安装

🚀 快速配置

方法一:NPM 安装(推荐)

bash
# 全局安装
npm install -g taskflow-ai

编辑 Cursor MCP 配置文件:

macOS: ~/Library/Application Support/Cursor/User/globalStorage/mcp.json

Windows: %APPDATA%\Cursor\User\globalStorage\mcp.json

Linux: ~/.config/Cursor/User/globalStorage/mcp.json

json
{
  "mcpServers": {
    "taskflow": {
      "command": "npx",
      "args": ["-y", "taskflow-ai"]
    }
  }
}

方法二:Docker 部署

json
{
  "mcpServers": {
    "taskflow": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${workspaceFolder}:/workspace",
        "agions/taskflow-ai:latest"
      ]
    }
  }
}

✅ 验证安装

  1. 重启 Cursor

  2. 打开 Cursor 设置

  3. 查看 MCP 服务器列表

    应该看到 taskflow 服务器

  4. 测试工具

    在 Chat 中输入:

    列出当前目录的文件

⚙️ 高级配置

使用工作区变量

json
{
  "mcpServers": {
    "taskflow": {
      "command": "npx",
      "args": ["-y", "taskflow-ai", "--work-dir", "${workspaceFolder}"]
    }
  }
}

启用详细日志

json
{
  "mcpServers": {
    "taskflow": {
      "command": "npx",
      "args": ["-y", "taskflow-ai"],
      "env": {
        "TASKFLOW_LOG_LEVEL": "debug"
      }
    }
  }
}

🐛 故障排查

问题解决方案
工具不显示检查配置文件格式,重启 Cursor
权限错误确保 Node.js 有文件访问权限
配置无效验证 JSON 格式,检查路径是否正确

🔗 相关链接


集成遇到问题随时问我

Released under the MIT License.