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 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)
- 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
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