Windsurf 集成
将 TaskFlow AI 集成到 Windsurf,让 AI 编程助手更强大
📋 前置要求
- Windsurf 已安装
- Node.js 18+ 或 npm 已安装
🚀 快速配置
方法一:NPM 安装(推荐)
bash
# 全局安装
npm install -g taskflow-ai编辑 Windsurf MCP 配置文件:
macOS: ~/Library/Application Support/Windsurf/mcp.json
Windows: %APPDATA%\Windsurf\mcp.json
Linux: ~/.config/Windsurf/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"
]
}
}
}✅ 验证安装
重启 Windsurf
打开 Windsurf 设置
查看 MCP 服务器列表
应该看到
taskflow服务器测试工具
在 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"
}
}
}
}🐛 故障排查
| 问题 | 解决方案 |
|---|---|
| 工具不显示 | 检查配置文件格式,重启 Windsurf |
| 权限错误 | 确保 Node.js 有文件访问权限 |
| 配置无效 | 验证 JSON 格式,检查路径是否正确 |
🔗 相关链接
集成遇到问题随时问我