Documentation
¶
Overview ¶
Package command implements a registry for Model Context Protocol (MCP) servers. It provides integration with MCP tools, allowing agents to dynamically discover and invoke tools exposed by MCP servers.
Index ¶
- func NewAuthTransport(spec AuthConfig) (*mcp.StreamableClientTransport, error)
- type AuthConfig
- type Native
- type Registry
- func (r *Registry) Attach(id string, server Server) error
- func (r *Registry) ConnectCmd(id string, cmd []string) error
- func (r *Registry) ConnectUrl(id string, url string) error
- func (r *Registry) Context() chatter.Registry
- func (r *Registry) Invoke(reply *chatter.Reply) (thinker.Phase, chatter.Message, error)
- func (r *Registry) WithNative(id string, fs ...Native) *Registry
- type SeqRegistry
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthTransport ¶ added in v0.3.2
func NewAuthTransport(spec AuthConfig) (*mcp.StreamableClientTransport, error)
Configures MCP transport with Bearer token authentication.
Types ¶
type AuthConfig ¶ added in v0.3.2
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Attach ¶ added in v0.3.0
Attach MCP server to the registry, making its tools available to the agent. The server is identified by a unique prefix, which is used to namespace tool names (e.g., fs_read). Tool names use underscore separator (prefix_toolname) due to AWS Bedrock constraints which only allow [a-zA-Z0-9_-] characters. The first token before underscore is always the server prefix. Each server runs independently, and its tools are registered with the prefix to avoid naming conflicts.
func (*Registry) ConnectCmd ¶ added in v0.3.2
func (*Registry) ConnectUrl ¶ added in v0.3.2
func (*Registry) Context ¶ added in v0.0.20
Context returns the registry as LLM embeddable schema. It fetches the list of available tools from all attached MCP servers.
type SeqRegistry ¶ added in v0.5.0
type SeqRegistry struct {
// contains filtered or unexported fields
}
func NewSeqRegistry ¶ added in v0.5.0
func NewSeqRegistry() *SeqRegistry
func (*SeqRegistry) Bind ¶ added in v0.5.0
func (r *SeqRegistry) Bind(reg *Registry)
func (*SeqRegistry) Context ¶ added in v0.5.0
func (r *SeqRegistry) Context() chatter.Registry
type Server ¶ added in v0.3.0
type Server interface {
ListTools(ctx context.Context, params *mcp.ListToolsParams) (*mcp.ListToolsResult, error)
CallTool(ctx context.Context, params *mcp.CallToolParams) (*mcp.CallToolResult, error)
Close() error
}
MCP Server interface