From 7133871be25fc78e1b540fa2987db7861be9b593 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Thu, 26 Mar 2026 15:16:34 -0700 Subject: [PATCH] Default CLI config path to ~/.config/mcp/mcp.toml Eliminates the need to pass --config on every command. Co-Authored-By: Claude Opus 4.6 (1M context) --- cmd/mcp/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/mcp/main.go b/cmd/mcp/main.go index b4bbd83..67b3477 100644 --- a/cmd/mcp/main.go +++ b/cmd/mcp/main.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os" + "path/filepath" "github.com/spf13/cobra" ) @@ -18,7 +19,11 @@ func main() { Use: "mcp", Short: "Metacircular Control Plane CLI", } - root.PersistentFlags().StringVarP(&cfgPath, "config", "c", "", "config file path") + defaultCfg := "" + if home, err := os.UserHomeDir(); err == nil { + defaultCfg = filepath.Join(home, ".config", "mcp", "mcp.toml") + } + root.PersistentFlags().StringVarP(&cfgPath, "config", "c", defaultCfg, "config file path") root.AddCommand(&cobra.Command{ Use: "version",