Documentation
¶
Overview ¶
Package sessionmcptools serves any agentkit.ToolProvider to an external ACP agent as a loopback streamable-http MCP server.
agent/acp-remote's sessionMcp slot takes a capacp.SessionMCPProvider, but the tools a host wants to expose usually already exist as a ToolProvider (tool/openapi, tool/mcp, a static tool list, ...). This plugin is the general bridge between the two, so a host does not need one bespoke MCP server per tool source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// APIToken enables a loopback Bearer check. Empty disables it (local only).
APIToken string `json:"apiToken,omitempty"`
// ServerName is the MCP server name announced to the agent.
ServerName string `json:"serverName,omitempty"`
// Headers are static extra headers for the ACP session/new spec.
Headers map[string]string `json:"headers,omitempty"`
// Bind maps turn-context fields to session headers and restores them on
// inbound tool calls, preserving the session, user, workspace and route.
Bind map[string]HeaderBind `json:"bind,omitempty"`
}
Config configures the loopback MCP endpoint.
type Deps ¶
type Deps struct {
Provider agentkit.ToolProvider `json:"provider"`
Workspace workspace.Service `json:"workspace,omitempty"`
}
Deps wires the tool source and the workspace used to resolve paths.
type HeaderBind ¶
type HeaderBind struct {
From string `json:"from"`
In string `json:"in"`
Name string `json:"name"`
}
HeaderBind mirrors the header-bind shape hosts already use: From is a ctx: source, In is the transport slot, Name the wire name.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements capacp.SessionMCPProvider over the supplied ToolProvider.
func (*Provider) Refresh ¶
Refresh re-reads the provider's tools into the MCP registry. Call it after a runtime change (an OpenAPI reload, an MCP client discovery); it is safe to call concurrently with in-flight calls.
func (*Provider) SessionMCPServers ¶
SessionMCPServers implements capacp.SessionMCPProvider.