Files
mcp/cmd/mcp/helpers.go
Kyle Isom 08b3e2a472 Migrate module path from kyle/ to mc/ org
All import paths updated to git.wntrmute.dev/mc/. Bumps mcdsl to v1.2.0,
mc-proxy to v1.1.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 02:07:42 -07:00

32 lines
772 B
Go

package main
import (
"fmt"
"os"
mcpv1 "git.wntrmute.dev/mc/mcp/gen/mcp/v1"
"git.wntrmute.dev/mc/mcp/internal/config"
)
// findNodeAddress looks up a node by name in the CLI config and returns
// its address.
func findNodeAddress(cfg *config.CLIConfig, nodeName string) (string, error) {
for _, n := range cfg.Nodes {
if n.Name == nodeName {
return n.Address, nil
}
}
return "", fmt.Errorf("node %q not found in config", nodeName)
}
// printComponentResults prints the result of each component operation.
func printComponentResults(results []*mcpv1.ComponentResult) {
for _, r := range results {
if r.GetSuccess() {
fmt.Printf(" %s: ok\n", r.GetName())
} else {
fmt.Fprintf(os.Stderr, " %s: error: %s\n", r.GetName(), r.GetError())
}
}
}