Documentation
¶
Overview ¶
Package mcptool adapts a Model Context Protocol (MCP) server into agentcore.Tool values, using the official modelcontextprotocol/go-sdk client over the Streamable HTTP transport.
It is a thin, policy-free bridge: Connect opens a session, Session.Tools lists the server's tools as executable [agentcore.Tool]s keyed by their un-namespaced names, and each tool's Execute performs a CallTool round-trip and returns the joined text content. Higher-level policy — allow-list filtering, namespacing, collision handling, connect timeouts, and metering — belongs to the composition layer that builds on this package.
Index ¶
Constants ¶
const DefaultClientName = "datum-assistant-service"
DefaultClientName is the MCP client name announced during initialization.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Endpoint is the Streamable HTTP endpoint of the MCP server.
Endpoint string
// HTTPClient overrides the HTTP client used for the transport. Nil uses a
// client whose transport adds the Accept header some stateless servers
// require (see [acceptRoundTripper]).
HTTPClient *http.Client
// ClientName overrides the announced client name. Empty uses
// [DefaultClientName].
ClientName string
// ClientVersion is the announced client version. Empty uses "0".
ClientVersion string
// Headers are set on every request of this session, but only on requests
// to Endpoint's own host, so a redirect off the endpoint cannot carry a
// credential meant for it. Which headers an endpoint deserves is
// internal/capability's policy, not this package's.
Headers map[string]string
// EnableStandaloneSSE opts into the server-initiated SSE stream. It is off
// by default because the per-request, request/response usage here needs no
// server-initiated notifications, and some stateless servers reject the
// standalone GET.
EnableStandaloneSSE bool
}
Options configures a Connect call. Endpoint is required.