serverStartCommand is the auto-started server's command. Its env is this process's, minus config.InternalNoDataDirWarningEnv: an MCP tool-call child carries that variable so its own warning stays out of an agent-facing error, and it is often the process that auto-starts the server, which is long-liv
(exePath string)
| 83 | // and it is often the process that auto-starts the server, which is |
| 84 | // long-lived and must still log the warning (BUG-4066). |
| 85 | func serverStartCommand(exePath string) *exec.Cmd { |
| 86 | cmd := exec.Command(exePath, "server", "start") |
| 87 | prefix := config.InternalNoDataDirWarningEnv + "=" |
| 88 | for _, kv := range os.Environ() { |
| 89 | if !strings.HasPrefix(kv, prefix) { |
| 90 | cmd.Env = append(cmd.Env, kv) |
| 91 | } |
| 92 | } |
| 93 | return cmd |
| 94 | } |
| 95 | |
| 96 | func startBackgroundServer(cfg *config.Config) error { |
| 97 | // Start server as background process |