Documentation
¶
Overview ¶
Package config provides unified configuration loading for all MCP servers. Configuration is layered: YAML file → environment variables → CLI flags. Each MCP server specifies its own EnvPrefix to namespace env vars.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaults ¶
ApplyDefaults fills zero-value fields with sensible defaults.
Types ¶
type CacheConfig ¶
type CacheConfig struct {
Dir string `yaml:"dir"`
SyncInterval time.Duration `yaml:"sync_interval"`
}
CacheConfig controls local caching of remote repository content.
type Config ¶
type Config struct {
Sources Sources `yaml:"sources"`
Cache CacheConfig `yaml:"cache"`
Proxy httputil.ProxyConfig `yaml:"proxy"`
LLM optimizer.LLMConfig `yaml:"llm"`
Transport string `yaml:"transport"`
Addr string `yaml:"addr"`
GitHubToken string `yaml:"github_token,omitempty"`
}
Config holds configuration shared by all MCP servers.
func LoadFromFile ¶
LoadFromFile reads a YAML config file. Returns empty Config if path is empty or missing.
func (*Config) ParsedRepos ¶
ParsedRepos returns parsed RepoRef values from Sources.Repos.
type Options ¶
type Options struct {
// EnvPrefix namespaces environment variables (e.g. "INSTRUCTIONS" → INSTRUCTIONS_DIRS).
EnvPrefix string
// DefaultAddr is the default HTTP listen address.
DefaultAddr string
// DefaultCacheName is the cache subdirectory name (e.g. "mcp-instructions").
DefaultCacheName string
}
Options configures how Load resolves env vars and defaults per MCP server.
Click to show internal directories.
Click to hide internal directories.