Repository navigation
feat(tunnel): add ADK MCP tunnel support - #115
Open
hunter-xue wants to merge 2 commits into
Open
hunter-xue wants to merge 2 commits into
hunter-xue wants to merge 2 commits into
Conversation
hunter-xue
force-pushed
the
feat/tunnel
branch
from
November 13, 2026 02:59
180c133 to
17212f9
Compare
This branch has not been deployed
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 项跳过。