Documentation
¶
Index ¶
- type MCPProvider
- func (p *MCPProvider) GetName() string
- func (p *MCPProvider) Type() ProviderType
- func (p *MCPProvider) Validate() error
- func (p *MCPProvider) WithArgs(args ...string) *MCPProvider
- func (p *MCPProvider) WithEnv(key, value string) *MCPProvider
- func (p *MCPProvider) WithHeader(key, value string) *MCPProvider
- func (p *MCPProvider) WithStdinData(data string) *MCPProvider
- func (p *MCPProvider) WithTimeout(seconds int) *MCPProvider
- func (p *MCPProvider) WithURL(url string) *MCPProvider
- func (p *MCPProvider) WithWorkingDir(dir string) *MCPProvider
- type McpConfig
- type McpHttpServer
- type McpServer
- type McpStdioServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MCPProvider ¶
type MCPProvider struct {
Name string `json:"name" yaml:"name"`
Command []string `json:"command" yaml:"command"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
WorkingDir string `json:"workingDir,omitempty" yaml:"workingDir,omitempty"`
StdinData string `json:"stdinData,omitempty" yaml:"stdinData,omitempty"`
Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}
MCPProvider represents an MCP (Model Context Protocol) tool provider.
func NewMCPProvider ¶
func NewMCPProvider(name string, command []string) *MCPProvider
NewMCPProvider constructs a new MCPProvider with the given name and command.
func NewMCPProviderFromJSON ¶
func NewMCPProviderFromJSON(data []byte) (*MCPProvider, error)
NewMCPProviderFromJSON creates an MCPProvider from JSON configuration.
func (*MCPProvider) GetName ¶
func (p *MCPProvider) GetName() string
GetName returns the provider's name.
func (*MCPProvider) Type ¶
func (p *MCPProvider) Type() ProviderType
Type returns the provider type.
func (*MCPProvider) Validate ¶
func (p *MCPProvider) Validate() error
Validate ensures the provider configuration is valid.
func (*MCPProvider) WithArgs ¶
func (p *MCPProvider) WithArgs(args ...string) *MCPProvider
WithArgs sets command line arguments for the MCP server process.
func (*MCPProvider) WithEnv ¶
func (p *MCPProvider) WithEnv(key, value string) *MCPProvider
WithEnv sets environment variables for the MCP server process.
func (*MCPProvider) WithHeader ¶ added in v1.4.9
func (p *MCPProvider) WithHeader(key, value string) *MCPProvider
WithHeader adds a custom HTTP header for HTTP transport.
func (*MCPProvider) WithStdinData ¶
func (p *MCPProvider) WithStdinData(data string) *MCPProvider
WithStdinData sets data to be sent to the MCP server's stdin on startup.
func (*MCPProvider) WithTimeout ¶
func (p *MCPProvider) WithTimeout(seconds int) *MCPProvider
WithTimeout sets the timeout for MCP operations in seconds.
func (*MCPProvider) WithURL ¶ added in v1.4.9
func (p *MCPProvider) WithURL(url string) *MCPProvider
WithURL sets the remote MCP server URL for HTTP transport.
func (*MCPProvider) WithWorkingDir ¶
func (p *MCPProvider) WithWorkingDir(dir string) *MCPProvider
WithWorkingDir sets the working directory for the MCP server process.
type McpHttpServer ¶
type McpHttpServer struct {
Transport string `json:"transport"` // always "http"
URL string `json:"url"`
}
McpHttpServer config for HTTP transport.