From c809c08756b720111e9fc0be8f3b762cd85225ba Mon Sep 17 00:00:00 2001 From: Anton Panasenko Date: Thu, 16 Jul 2026 22:38:56 -0700 Subject: [PATCH] fix(mcp): use absolute path for Codex setup --- README.md | 25 +++++++++++++++++++++++++ install-mcp.ps1 | 2 +- install-mcp.sh | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 24ec96e98..d0879b3a5 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,31 @@ brew upgrade fff-mcp # after new stable releases Formula lives in [`Formula/fff-mcp.rb`](./Formula/fff-mcp.rb) in this repo and is **auto-bumped on every stable release** (see `bump-homebrew-formula` in [`.github/workflows/release.yaml`](./.github/workflows/release.yaml)). Installs the prebuilt `fff-mcp` binary from [GitHub releases](https://github.com/dmtrKovalenko/fff.nvim/releases). +### Codex setup + +Register the installed binary using its absolute path, since Codex desktop sessions may not inherit your interactive shell's `PATH`. + +Homebrew: + +```bash +codex mcp add fff -- "$(brew --prefix)/bin/fff-mcp" +``` + +One-line installer: + +```bash +codex mcp add fff -- "$HOME/.local/bin/fff-mcp" +``` + +This creates an entry in `~/.codex/config.toml` similar to: + +```toml +[mcp_servers.fff] +command = "/opt/homebrew/bin/fff-mcp" +``` + +Use the actual installed path for your system, then restart Codex or start a new task so it loads the server. + Once the server is connected, ask the agent to "use fff" and it picks up the `ffgrep`, `fffind`, and `fff-multi-grep` tools. ### Recommended agent prompt diff --git a/install-mcp.ps1 b/install-mcp.ps1 index dfa1090af..dd7b2f873 100644 --- a/install-mcp.ps1 +++ b/install-mcp.ps1 @@ -209,7 +209,7 @@ function Show-SetupInstructions { if (Get-Command codex -ErrorAction SilentlyContinue) { $foundAny = $true Write-Success "[Codex] detected" - Write-Host "codex mcp add fff -- fff-mcp" + Write-Host "codex mcp add fff -- `"$BinaryPath`"" Write-Host "" } diff --git a/install-mcp.sh b/install-mcp.sh index eeb3e7279..b40b34dfd 100755 --- a/install-mcp.sh +++ b/install-mcp.sh @@ -262,7 +262,7 @@ print_setup_instructions() { found_any=true success "[Codex] detected" echo "" - echo "codex mcp add fff -- fff-mcp" + echo "codex mcp add fff -- \"${binary_path}\"" echo "" fi