config

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltinTool

type BuiltinTool struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Script      string         `json:"script"`
	InputSchema map[string]any `json:"inputSchema,omitempty"`
}

BuiltinTool represents a built-in tool configuration

type Config

type Config struct {
	Version      string                 `json:"version,omitempty"`
	MCPServers   map[string]MCPServer   `json:"mcpServers"`
	BuiltinTools map[string]BuiltinTool `json:"builtinTools,omitempty"`
}

Config represents the MCP hub configuration

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads configuration from a JSON file

func (*Config) Validate

func (c *Config) Validate() error

Validate performs comprehensive validation of the configuration

type MCPServer

type MCPServer struct {
	Transport     string            `json:"transport,omitempty"` // defaults to "stdio"
	Command       string            `json:"command,omitempty"`
	Args          []string          `json:"args,omitempty"`
	Env           map[string]string `json:"env,omitempty"`
	URL           string            `json:"url,omitempty"`
	Enable        *bool             `json:"enable,omitempty"` // pointer to distinguish between false and unset
	Required      bool              `json:"required,omitempty"`
	Headers       map[string]string `json:"headers,omitempty"`       // Custom HTTP headers for http/sse transports
	Timeout       *int              `json:"timeout,omitempty"`       // Request timeout in seconds
	TLSSkipVerify *bool             `json:"tlsSkipVerify,omitempty"` // Skip TLS verification (dev only)
}

MCPServer represents a remote MCP server configuration

func (*MCPServer) GetTransport

func (s *MCPServer) GetTransport() string

GetTransport returns the transport type, defaulting based on URL/Command presence

func (*MCPServer) IsEnabled

func (s *MCPServer) IsEnabled() bool

IsEnabled returns true if the server should be enabled (default true if not specified)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL