Skip to content

Add configurable Codex MCP cwd#642

Merged
pushpak1300 merged 4 commits intolaravel:mainfrom
cyppe:codex-mcp-cwd-config
Mar 12, 2026
Merged

Add configurable Codex MCP cwd#642
pushpak1300 merged 4 commits intolaravel:mainfrom
cyppe:codex-mcp-cwd-config

Conversation

@cyppe
Copy link
Contributor

@cyppe cyppe commented Mar 9, 2026

Summary

  • Add boost.executable_paths.current_directory config option (env: BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH) to override the MCP server cwd
  • Keep the existing base_path() behavior as the default fallback
  • Cover the default, config override, and env override paths in CodexTest

Why

Boost currently generates Codex MCP config with cwd = base_path(). That works when Boost and Codex both run in the same environment, but it breaks when Boost is executed inside a container and Codex runs on the host.

A concrete example is DDEV:

  • php artisan boost:update runs inside the DDEV container
  • Laravel base_path() resolves to a container path like /var/www/html
  • Codex starts on the host, reads .codex/config.toml, and then tries to launch the MCP server with cwd = /var/www/html
  • that path does not exist on the host, so MCP startup fails before the command even runs

The command path can already be overridden safely with BOOST_PHP_EXECUTABLE_PATH, but there is currently no official way to override the MCP working directory.

This uses the existing executable_paths config group rather than a new mcp.cwd key because the setting describes the working directory of an executable — consistent with how BOOST_PHP_EXECUTABLE_PATH and friends are already organized.

Safety

  • Fully backward compatible because base_path() remains the fallback
  • No container or platform heuristics are introduced
  • Users only opt in when they need a host/container path split
  • The current Codex behavior is unchanged unless BOOST_CURRENT_DIRECTORY_EXECUTABLE_PATH is set

Verification

  • ./vendor/bin/pest tests/Unit/Install/Agents/CodexTest.php
  • ./vendor/bin/pint --test config/boost.php src/Install/Agents/Codex.php tests/Unit/Install/Agents/CodexTest.php

@pushpak1300 pushpak1300 self-requested a review March 10, 2026 11:54
@pushpak1300 pushpak1300 merged commit ba0a9e6 into laravel:main Mar 12, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants