config

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(cfg *Config) error

Validate checks that every server in the config has the required fields for its transport type.

Types

type Config

type Config struct {
	Servers map[string]*ServerConfig `yaml:"servers"`
}

Config holds the full mcpx configuration.

func Load

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

Load reads the global (~/.mcpx/config.yml) and project (.mcpx/config.yml) configs, merges them, and validates the result. Returns the merged config, the project root (empty if no project config), and any error.

func LoadFrom

func LoadFrom(globalPath, projectPath string) (*Config, error)

LoadFrom loads configs from explicit paths (useful for testing).

func Merge

func Merge(global, project *Config) *Config

Merge combines global and project configs. Project servers replace global servers entirely on a per-server-name basis.

type ServerConfig

type ServerConfig struct {
	Command        string            `yaml:"command"`
	Args           []string          `yaml:"args"`
	Transport      string            `yaml:"transport"`
	Env            map[string]string `yaml:"env"`
	Daemon         bool              `yaml:"daemon"`
	StartupTimeout string            `yaml:"startup_timeout"`
	URL            string            `yaml:"url"`
}

ServerConfig describes a single MCP server.

Jump to

Keyboard shortcuts

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