McpHostOptions
이 콘텐츠는 아직 번역되지 않았습니다.
createMcpHost 选项(servers 为主体;其余是超时/观测/测试注入缝)
baseEnv?
Section titled “baseEnv?”optional baseEnv?: Record<string, string | undefined>;${VAR} 引用与 stdio 子进程环境的取值源;缺省 process.env
clientInfo?
Section titled “clientInfo?”optional clientInfo?: McpPeerInfo;initialize 声明的客户端身份
connectFactory?
Section titled “connectFactory?”optional connectFactory?: McpConnectFactory;连接工厂注入缝(hermetic 测试桩连接;缺省真 transport)
connectTimeoutMs?
Section titled “connectTimeoutMs?”optional connectTimeoutMs?: number;每服务器握手超时(毫秒);缺省 kernel 10s
fetchImpl?
Section titled “fetchImpl?”optional fetchImpl?: HttpFetchLike;http transport 的 fetch 注入缝(测试)
killGraceMs?
Section titled “killGraceMs?”optional killGraceMs?: number;stdio close 后强杀前宽限(毫秒)
onEvent?
Section titled “onEvent?”optional onEvent?: McpEventObserver;结构化观测缝(mcp.connected/connect_failed/discovered 等)
requestTimeoutMs?
Section titled “requestTimeoutMs?”optional requestTimeoutMs?: number;连接级默认请求超时(tools/list 等;毫秒);缺省 kernel 60s
servers
Section titled “servers”servers: Record<string, McpServerConfig>;服务器表:名字 → kernel McpServerConfig(transport 判别联合)。名字
进桥接工具名 mcp__<name>__<tool> 与权限规则面(禁 __)。
toolTimeoutMs?
Section titled “toolTimeoutMs?”optional toolTimeoutMs?: number;桥接工具每调用硬超时覆盖(毫秒;缺省调度器统一 120s)
이 페이지가 도움이 되었나요?
피드백 감사합니다. 이 문서를 계속 개선하겠습니다.