MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / LoadConfig

Function LoadConfig

internal/mcp/register.go:65–78  ·  view source on GitHub ↗

LoadConfig reads a JSON config file. Missing file returns (nil, nil) — MCP is opt-in; absence is not an error.

(path string)

Source from the content-addressed store, hash-verified

63// LoadConfig reads a JSON config file. Missing file returns (nil, nil) — MCP
64// is opt-in; absence is not an error.
65func LoadConfig(path string) (*Config, error) {
66 data, err := os.ReadFile(path)
67 if errors.Is(err, fs.ErrNotExist) {
68 return nil, nil
69 }
70 if err != nil {
71 return nil, err
72 }
73 var c Config
74 if err := json.Unmarshal(data, &c); err != nil {
75 return nil, fmt.Errorf("parse mcp config %s: %w", path, err)
76 }
77 return &c, nil
78}
79
80// ProgressStatus is one phase of MCP server bring-up. A ProgressFunc gets
81// called once per phase per server, plus ProgressBegin/ProgressDone

Callers 1

setupMCPFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected