ADK-agents/mcp_dev_agent/README.md
2026-07-30 14:34:51 +08:00

60 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Dev Agent MCP Server
将 Dev Agent 封装为 MCP 工具,供 CodeBuddy / Cursor / Windsurf 等 MCP 客户端调用。
## 功能
- **run_dev_agent** — 调用 Dev Agent 执行开发子任务
- 支持文件读写、终端命令执行、编译验证
- 支持指定 `session_id` 进行多轮对话
## 配置方法
### CodeBuddy
在 CodeBuddy 的 MCP 配置中添加:
```json
{
"mcpServers": {
"dev-agent": {
"command": "python",
"args": ["d:/nzy/workspace_python/agent/mcp_dev_agent/server.py"],
"env": {
"DEV_AGENT_API_URL": "http://127.0.0.1:8001",
"DEV_AGENT_APP_NAME": "dev_agent",
"DEV_AGENT_USER_ID": "codebuddy"
}
}
}
}
```
### 环境变量
| 变量 | 默认值 | 说明 |
|------|--------|------|
| `DEV_AGENT_API_URL` | `http://127.0.0.1:8001` | Dev Agent API Server 地址 |
| `DEV_AGENT_APP_NAME` | `dev_agent` | Agent 名称 |
| `DEV_AGENT_USER_ID` | `codebuddy` | 用户 ID用于会话隔离 |
## 使用前提
1. 先启动 Dev Agent API Server
```bash
python api_server.py
```
2. 配置 MCP server见上方配置方法
3. 重启 CodeBuddy / IDE
## 工具参数
### run_dev_agent
| 参数 | 必填 | 说明 |
|------|------|------|
| `task` | ✅ | 任务描述,越详细越好 |
| `session_id` | ❌ | 会话 ID不传则用 `default`。用于多轮对话续聊 |