MCPcopy Create free account
hub / github.com/diillson/chatcli / resolveMCPConfigPath

Function resolveMCPConfigPath

cli/cli.go:1622–1627  ·  view source on GitHub ↗

resolveMCPConfigPath returns the path chatcli should consult for MCP server configuration: the explicit `CHATCLI_MCP_CONFIG` override when set, otherwise the conventional `~/.chatcli/mcp_servers.json`. Extracted so tests can drive the auto-enable decision without stomping on the real user environmen

()

Source from the content-addressed store, hash-verified

1620// Extracted so tests can drive the auto-enable decision without
1621// stomping on the real user environment.
1622func resolveMCPConfigPath() string {
1623 if p := os.Getenv("CHATCLI_MCP_CONFIG"); p != "" {
1624 return p
1625 }
1626 return mcp.DefaultConfigPath()
1627}
1628
1629// shouldAutoEnableMCP returns true when MCP should be initialized
1630// automatically (i.e., without `CHATCLI_MCP_ENABLED=true`). It says

Calls 1

DefaultConfigPathFunction · 0.92