config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalConfigPath

func GlobalConfigPath() (string, error)

GlobalConfigPath returns the path to the global config file.

func ProjectConfigPath

func ProjectConfigPath() (string, error)

ProjectConfigPath traverses upward from the current directory to find a project config file, stopping before the home directory or root.

func Save

func Save(cfg *Config, path string) error

Save writes the config to a file path.

Types

type Config

type Config struct {
	MCP map[string]ServerConfig `json:"mcp"` // Map of server name to server config
}

Config is the root configuration structure.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default empty values.

func Load

func Load(path string) (*Config, error)

Load loads config from a file path.

func LoadEffective

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

LoadEffective loads and merges global and project config.

func Merge

func Merge(base, override *Config) *Config

Merge combines two Config structs, with the second parameter taking precedence.

type ServerConfig

type ServerConfig struct {
	Type    TransportType     `json:"type"`    // Connection type: "stdio" or "http"
	Command string            `json:"command"` // Command for stdio transport
	Args    []string          `json:"args"`    // Arguments for stdio transport
	Env     map[string]string `json:"env"`     // Environment variables for stdio transport
	URL     string            `json:"url"`     // URL for HTTP transport
	Headers map[string]string `json:"headers"` // Headers for HTTP transport
}

ServerConfig defines the configuration for a single MCP server.

type TransportType

type TransportType string

TransportType specifies the transport protocol for connecting to an MCP server.

const (
	TransportStdio TransportType = "stdio"
	TransportHTTP  TransportType = "http"
)

Jump to

Keyboard shortcuts

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