Documentation
¶
Overview ¶
Package mcptoolset provides a Toolset implementation for MCP servers.
MCP (Model Context Protocol) allows connecting to external tool servers that expose tools via a standardized protocol.
The toolset uses lazy initialization - the MCP connection is only established when Tools() is first called.
Transport Support:
- stdio: Uses mcp-go library for subprocess communication
- sse, streamable-http: Uses Hector's httpclient with retry/backoff
Index ¶
Constants ¶
View Source
const ( // DefaultSSEResponseTimeout is the default timeout for reading SSE responses // Set to 5 minutes to accommodate long-running operations DefaultSSEResponseTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Name identifies this toolset.
Name string
// URL is the MCP server URL (for HTTP transports).
URL string
// Transport specifies the MCP transport (sse, streamable-http, stdio).
Transport string
// Command for stdio transport.
Command string
// Args for stdio transport.
Args []string
// Env for stdio transport.
Env map[string]string
// Filter limits which tools are exposed.
Filter []string
// MaxRetries for HTTP requests (default: 3).
MaxRetries int
// SSETimeout for SSE response reading (default: 5m).
SSETimeout time.Duration
}
Config configures an MCP toolset.
Click to show internal directories.
Click to hide internal directories.