Documentation
¶
Overview ¶
Package mcptool implements the private, bounded Streamable HTTP MCP client used by the runtime tool adapter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDescriptor = errors.New("invalid MCP tool descriptor")
ErrInvalidDescriptor reports that a broker-authorized descriptor is not a canonical MCP action. It is safe for the adapter to surface as invalid input.
ErrUnauthorizedServerTool reports an endpoint reference or Tool name that is absent from operator configuration. It must never trigger a network call.
var ErrUncertain = errors.New("MCP tool operation outcome is uncertain")
ErrUncertain reports that the caller cannot safely know whether an MCP operation completed. Callers must reconcile, never resubmit.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a private stateless MCP requester. A fresh protocol session per operation makes connection loss observational rather than authorization state, while every request still carries the negotiated session headers.
type Config ¶
type Config struct {
Servers []ServerConfig
RoundTripper http.RoundTripper
RequestTimeout time.Duration
CancelTimeout time.Duration
MaximumResultBytes int64
AllowInsecureLoopbackTests bool
}
Config constructs a bounded Streamable HTTP client. HTTP is only available for explicit loopback test fixtures; production endpoints must use HTTPS.
type CredentialSource ¶
CredentialSource obtains an authorization value only while one outbound MCP request is being constructed. Its value is never retained by Client.
type Descriptor ¶
type Descriptor struct {
Version string `json:"version"`
ServerID string `json:"server_id"`
ToolName string `json:"tool_name"`
Arguments json.RawMessage `json:"arguments"`
}
Descriptor is the private canonical MCP action persisted only after broker admission. It contains no endpoint URL, session, credential, or capability.
func DecodeDescriptor ¶
func DecodeDescriptor(raw []byte) (Descriptor, error)
DecodeDescriptor parses one exact mcp.tool/v1 immutable descriptor.
type ServerConfig ¶
type ServerConfig struct {
ID string
Endpoint string
Credentials CredentialSource
Tools []ToolConfig
ReconcileTool string
ReconcileOperationArgument string
}
ServerConfig declares one operator-configured MCP endpoint. The model never supplies this endpoint or its credential source.
type ToolConfig ¶
ToolConfig pins one server tool and its input schema. The operation ID is injected only into the declared argument, never chosen by a model request.