Repository navigation
feat(tunnel): add ADK MCP tunnel support - #115
Merged
Merged
Conversation
hunter-xue
force-pushed
the
feat/tunnel
branch
from
November 13, 2026 02:59
180c133 to
17212f9
Compare
lijiafu618-alt
approved these changes
Nov 13, 2026
lijiafu618-alt
left a comment
Collaborator
There was a problem hiding this comment.
审核通过。
本次变更为顶层 Google ADK Agent 增加内网 Streamable HTTP MCP Tunnel,并接入 CLI 配置、部署环境变量、Runtime 生命周期和构建依赖。
已核对关键集成路径及两项 CI 修复:
- 构建器静态 import 探测提取为独立模块,保留原有依赖识别行为,并满足模块行数约束。
- 路由回归通过实际 HTTP/WS 请求验证服务查询鉴权和 Connector 注册,兼容新版 FastAPI 路由结构。
提交 db2c322 的 25 项 GitHub 检查均通过,包括三个 ADK 版本全量测试、PostgreSQL 持久化、打包、安全及端到端检查。ADK 2.14.0 首轮出现两项时序相关失败,重跑后通过。
功能范围按文档保持为 ADK、单 worker 和单副本或已验证的 sticky 拓扑。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 KsADK 增加面向顶层 Google ADK
Agent/LlmAgent的内网 Streamable HTTP MCP Tunnel。企业侧 connector 通过出站 WS/WSS 注册内网 MCP Server,云端 ADKRunner 在后续轮次发现并调用工具,无需企业侧开放入站端口。同时补齐项目级 CLI 配置、部署环境变量契约、构建依赖、 lifecycle/鉴权处理和中英文文档。
主要改动
ksadk.tunnel:connector、per-app registry、FastAPI 路由、动态TunnelToolset和 MCP protocol handler。agentengine config为 ADK 项目提供可选 Tunnel 配置;config set --global对 Tunnel 等项目级变量返回global_unsupported_env_keys并给出提示,不写入全局配置。.env、shell、显式--env/--env-file的部署合并和优先级,以及 CreateAgent / UpdateAgent 环境变量 payload。外层网关建联契约
无路径前缀时,完整建联 URL 为:
带 base path 时:
当网关已经占用
Authorization时,网关凭证通过TunnelConnector.extra_headers传递,Tunnel token 使用 URL 编码后的 query:TunnelConnector.cloud_url只接收 base URL,不能重复包含/tunnel/connect。外层入口网关必须放行该路径和 WebSocket Upgrade;/tunnel/mcp/*是 Runtime 内部 loopback 代理,不应为了 connector 建联暴露到公网。首版仍限定单 worker、单副本或经过验证的 sticky 拓扑,不支持自动重连和非 ADK Runtime 的自动工具注入。
真实验证
dist静态入口检查使用旧 wheel/sdist,因缺少 Web/Studio 静态入口而失败,未记为通过。config set -> deploy --dry-run与launch --dry-run:Tunnel 开关进入 payload,token 为***且IsSensitive=true,未生成 self URL;config set --global的独立全局文件不包含 Tunnel 变量。git diff --check通过。尚未完成的云端验收
真实云端部署 E2E 尚未执行:当前没有经授权的隔离云端 Agent、入口网关和测试凭证。外层 WSS 转发、idle timeout、最大帧、长连接和 sticky 拓扑仍需在隔离环境中验收;本地 MCP E2E 和 CLI dry-run 不替代该云端验收。
Rebase 更新(2026-11-13)
main的48b413779f1fca18d68f03afe4f2dae081ec05cf(PR chore(ci): 移除 Studio 桌面构建流水线 #119),新 head 为17212f92dbd7dbc3bbf5eae9f3213c9d01d3d9aa。uv.lock同步项目环境后,Tunnel、Runtime 装配、A2UI、MCP OAuth、配置和部署相关回归:164 项通过,10 项跳过。