Repository navigation
Conversation
wklken
commented
Oct 23, 2026
Retain server RPC code/message, distinguish invalid authentication from configuration errors, and report safe server/field diagnostics. Allow bounded DELETE cleanup without replacing operation response headers and mask session IDs. Accept null pagination cursors and reject help combined with offline preview before network access. Keep explicit HTTP configuration and existing authentication combinations. Add regression and integration coverage for the six reviewed findings.
Flush SDK-compatible SSE events at EOF and count complete CRLF sequences. Reject implicit flag tokens as values before network access, classify raw results before SDK decoding errors, and preserve RPC errors in HTTP error responses. Separate auxiliary request state and align check-stage labels with connection errors. Distinguish HTTP failures and handle SIGTERM. Add regression and integration coverage for the verified review findings.
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.
新增
bk-cli mcp <server>,按独立mcp.json配置连接远程 Streamable HTTP server,支持--list离线列出已配置服务,以及检查、完整工具发现、动态帮助、具名参数/完整 JSON 调用和离线预览。MCP 认证只来自选定 server 的 headers,不加载 context 凭据、tenant 或 stage。type: "http",校验整个文件;条目错误指出 server、字段和原因,凭据值不回显。header 字符串原样发送,不做环境变量展开。支持 Bearer、应用 code/secret + ticket 或 token、独立 access_token,以及通用 headers;认证形态错误独立返回invalid_mcp_auth并说明支持格式。--list成功仅代表结构有效。12e768b461fd06ea80b0d87e14ac7fa0d24c606a(v1.8.1-0.20261022085357-12e768b461fd),兼容测试覆盖2025-03-26、2025-06-18、2025-11-25、2026-07-28。该提交包含 structuredContent 修复,Schema/元数据仍由 HTTP 边界保留原始 JSON 数字,覆盖参数、目录、结果、envelope 和 jq 简单字段提取。tools/call。完整分页检测循环/重名/上限,null 游标视为结束;单 JSON/SSE 事件 16 MiB、累计目录 32 MiB、100 页,默认 60 秒总预算,SIGINT/SIGTERM 可取消。失败后仍允许预算内的 DELETE 清理;清理、通知及回复请求不覆盖业务响应头或错误,Mcp-Session-Id始终脱敏。mcp_rpc_error,在data.rpc_error保留服务端 code/message;普通 HTTP 失败用mcp_http_error,认证/权限/重定向保留专用分类;--check阶段状态与错误类别一致。保留工具错误和未支持的 input_required/sampling/elicitation/task 状态。SSE 的 EOF 事件与 CRLF 字节上限遵循固定 SDK 行为;可判定的完整原始结果不会仅因 SDK 解码失败被标为 unknown。调用结果丢失时输出data.execution_state: "unknown";jq/输出失败不触发重发。离线 dry-run 只接受完整 body,与--help互斥,零网络并标注未验证远端。参数值以-开头时使用--name=value,避免短选项被吞作工具参数;--body -继续支持 stdin。验证:Go 1.25.8;
make fmt、make lint、make test(28 suites)、make build、Windows amd64 交叉构建、相关 race 检查通过。本轮 10 项修复具有修改前失败、修改后通过的证据;SIGTERM 通过本地 mock + 子进程信号验证。MCP-001 至 MCP-005 Docker 场景通过,HTTP helper 提取后再次执行 MCP-003 CASE,覆盖 SSE EOF 结果保留和 HTTP 400 RPC 错误。internal/mcpclient覆盖率 95.5%。独立复核未发现新增缺陷。make test-cover未整体通过:未改动的internal/update覆盖率为 88.5%,低于 90% 门槛;基线9f834ab08438090ee9bee3111ff5158f94847c55干净副本也为 88.5%。本 PR 不修改该包或阈值。真实服务联调未执行,认证与协议兼容以本地 mock 为证;集成测试文档提供人工验收清单。ok:true不证明任意业务成功或异步任务完成。Closes #42.