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

Function setupMCP

main.go:412–419  ·  view source on GitHub ↗

setupMCP loads mcp.json (if present) and connects each configured server. progress receives per-server lifecycle events the caller can pipe into the TUI loading indicator. Errors connecting individual servers are logged but never fatal.

(ctx context.Context, progress mcp.ProgressFunc)

Source from the content-addressed store, hash-verified

410// the TUI loading indicator. Errors connecting individual servers are
411// logged but never fatal.
412func setupMCP(ctx context.Context, progress mcp.ProgressFunc) []*mcp.Client {
413 cfg, err := mcp.LoadConfig("mcp.json")
414 if err != nil {
415 fmt.Fprintf(os.Stderr, "mcp: config error: %v\n", err)
416 return nil
417 }
418 return mcp.Register(ctx, cfg, tool.Default, progress)
419}
420
421// registerSubagents wires up every subagent the harness exposes.
422func registerSubagents(llm provider.Provider) {

Callers 1

mainFunction · 0.85

Calls 2

LoadConfigFunction · 0.92
RegisterFunction · 0.92

Tested by

no test coverage detected