Documentation
¶
Overview ¶
Package mcp provides integration with the Model Context Protocol (MCP). It allows Bucephalus to use tools from MCP servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToolsFromMCP ¶
func ToolsFromMCP(ctx context.Context, command string, args []string, opts ...Option) ([]llm.Tool, func() error, error)
ToolsFromMCP is a convenience function to get tools from an MCP server.
Example:
tools, cleanup, err := mcp.ToolsFromMCP(ctx, "./my-mcp-server", nil)
if err != nil {
return err
}
defer cleanup()
resp, err := llm.Call(ctx, "Help me", llm.WithTools(tools...))
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an MCP client for use with Bucephalus.
func NewStdioClient ¶
func NewStdioClient(ctx context.Context, command string, args []string, opts ...Option) (*Client, error)
NewStdioClient creates an MCP client that communicates via stdio with a subprocess.
Example:
client, err := mcp.NewStdioClient(ctx, "./my-mcp-server", nil)
if err != nil {
return err
}
defer client.Close()
tools, err := client.Tools(ctx)
Click to show internal directories.
Click to hide internal directories.