Archestra编码代理
一个定制的MCP服务器,它结合了 Serena的 具有Git/GitHub操作的语义代码编辑功能,打包为Archestra基于K8s的MCP服务器运行时的Docker映像。
特性
Serena工具(语义代码操作)
项目和配置
activate_project-按名称或路径激活项目check_onboarding_performed-检查项目入职培训是否已完成onboarding-执行项目入职培训get_current_config-打印当前代理配置prepare_for_new_conversation-为新的对话做准备
符号操作
find_symbol-按名称路径模式检索符号/代码实体find_referencing_symbols-查找对符号的引用get_symbols_overview-获取文件中代码符号的高级概述rename_symbol-在整个代码库中重命名符号replace_symbol_body-替换符号的主体insert_after_symbol-在符号定义后插入内容insert_before_symbol-在符号定义之前插入内容
文件操作
create_text_file-写入新文件或覆盖现有文件read_file-读取文件或其中的一部分list_dir-列出文件和目录find_file-查找与文件掩码匹配的文件replace_content-替换文件中与模式匹配的内容search_for_pattern-在代码库中灵活搜索模式
Shell 执行
execute_shell_command-执行shell命令并返回输出
内存管理
list_memories-列出可用记忆read_memory-读取内存文件的内容write_memory-将信息写入内存文件edit_memory-编辑内存文件中的内容delete_memory-删除内存文件
思维工具
think_about_collected_information-反思所收集信息的充分性think_about_task_adherence-检查任务是否仍在正轨上think_about_whether_you_are_done-反思任务完成情况
Git工具
git_clone-将Git存储库克隆到工作区git_status-获取存储库的git状态git_diff-显示未提交更改的差异git_commit-阶段和提交更改git_push-向远程推送提交git_checkout_branch-创建新分支或切换到现有分支
GitHub工具
github_create_pr-在GitHub上创建pull请求github_list_prs-列出存储库的拉取请求github_get_issue-获取GitHub问题的详细信息
配置
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
GITHUB_TOKEN | 是 | API操作的GitHub个人访问令牌 |
WORKSPACE_DIR | 否 | 克隆存储库的目录(默认: /workspace) |
建筑
# Build the Docker image
make build
# Build and push to GCP Artifact Registry
make push在Archestra的使用
- 将此MCP服务器添加到内部目录
- 使用分配的此服务器创建配置文件
- 配置
GITHUB_TOKEN在服务器的环境变量中 - 开始编码!
本地测试
在本地构建和运行
# Build the Docker image
make build
# Run with a GitHub token
export GITHUB_TOKEN=your-token-here
make run
# Or run an interactive shell for debugging
make shell测试MCP服务器
- 塑造形象:
make build - 启动容器:
docker run -it --rm \
-e GITHUB_TOKEN=$GITHUB_TOKEN \
-v $(pwd)/workspace:/workspace \
-p 9121:9121 \
europe-west1-docker.pkg.dev/friendly-path-465518-r6/archestra-public/archestra-coding-agent:0.0.1- 将MCP客户端连接到端口9121上的服务器
运行单元测试
# Install test dependencies
pip install -r requirements.txt pytest
# Run tests
make test添加到Archestra内部目录
使用 catalog-entry.json 将此MCP服务器添加到内部目录的文件:
- 转到Archestra中的MCP目录页面
- 点击“添加内部服务器”
- 从导入配置
catalog-entry.json - 或者使用API:
curl -X POST http://localhost:9000/api/internal-mcp-catalog \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d @catalog-entry.json发展
# Install dependencies
pip install -r requirements.txt
# Run tests
pytest tests/ -v建筑
┌─────────────────────────────────────────────────────────┐
│ K8s Pod │
│ ┌─────────────────────────────────────────────────┐ │
│ │ archestra-coding-agent │ │
│ │ ┌─────────────┐ ┌─────────────────────────┐ │ │
│ │ │ Serena │ │ Custom Git/GitHub │ │ │
│ │ │ MCP Server │ │ Tools │ │ │
│ │ └──────┬──────┘ └───────────┬─────────────┘ │ │
│ │ │ │ │ │
│ │ └─────────┬───────────┘ │ │
│ │ ▼ │ │
│ │ ┌─────────────────┐ │ │
│ │ │ /workspace │ │ │
│ │ │ (cloned repo) │ │ │
│ │ └─────────────────┘ │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘