package
Version:
v1.6.1
Opens a new window with list of versions in this module.
Published: Oct 10, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Client 持有 SDK 返回的连接对象。Close 会释放传输连接,
使用 stdio 时也会关闭子进程。
Connect 与外部 server 建立连接并协商协议版本。ctx 只限制此过程;
后续请求使用各自传入的 context。
CallTool 保留完整 MCP 结果,包括结构化内容和 IsError。
工具自身失败仍是调用结果,不当作传输错误。
Close 结束 MCP 会话,并在使用 stdio 时停止子进程。
ListTools 读取所有 tools/list 分页,并保留 server 返回的 schema。
Config 提供单个连接的运行时参数。调用方可通过 HTTPClient 注入认证能力;
持久化配置和凭据管理不属于本包。
Transport 表示外部 MCP server 的连接方式。
const (
TransportStdio Transport = "stdio"
TransportStreamableHTTP Transport = "streamable_http"
)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.