feat(mcp)!: 按需发现与调用,避免全量工具目录阻断入口 - #140
Merged
Merged
Conversation
MCP 只广告固定网关入口,避免每次连接和调用依赖所有可见上游。工具路径、参数校验、权限、原生结果与设备投递语义复用现有契约,并通过 SDK consumer 和参数单测验证。 升级后 tools/list 不再展开业务工具,调用改用 tb_call(path,args),设备任务由 tb_device_operations 管理。app、嵌入 SDK 和 server 按实际公开运行时变化升 minor;CLI 与 Dashboard 无需机械升版。
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.
入站
/~mcp原来在发现和每次调用前遍历、校验全部可见工具,目录规模会进入客户端上下文,无关上游或坏 schema 也会阻断调用。现在只广告固定网关入口,业务工具通过完整 HTBP 路径按需发现、校验和执行。tb_search(有搜索能力才提供)、tb_help、tb_list_nodes、tb_call、tb_device_operations保持有界目录;删除全树扫描和编码后的业务工具名。升级行为变化:
tools/list不再返回每个业务工具;消费方改用tb_call({path,args,...}),不保留旧业务工具名。app 升至 0.22.0,内嵌该运行时的 SDK 升至 0.24.0、server 升至 0.23.0;CLI/Dashboard 的中立客户端契约未变。验证:
pnpm verify全绿,6,411 项测试,无跳过。pnpm turbo run build全绿。