codex cli does not detect correctly nextjs dev server launched by my terminal with next dev tools
What version of Codex is running?
0.63
What subscription do you have?
plus
Which model were you using?
gpt 5.1
What platform is your computer?
wsl2 linux
What issue are you seeing?
I’m trying to use next-devtools-mcp from the Codex CLI and running into a situation where nextjs_index reports no dev servers, even though:
a Next.js 16 dev server is running and healthy, and
the MCP endpoint at /_next/mcp is reachable from the same environment.
This exact project works with Next DevTools in GitHub Copilot; the problem only appears when using the MCP server via Codex.
Environment
Host: Windows 11 + WSL2
MCP client: Codex CLI (running inside WSL/Ubuntu)
Project: Next.js 16 app (App Router) with dev script next dev
Next.js version: 16.0.5
Node: >= 24.11.0 (per project package.json; dev server starts fine)
MCP server: next-devtools-mcp@latest via npx
Codex config (~/.codex/config.toml) for MCP:
model = "gpt-5.1"
sandbox_mode = "workspace-write"
approval_policy = "on-request"
[sandbox_workspace_write]
network_access = true
writable_roots = [ "path/to/project/", "/dev/shm" ]
[features]
web_search_request = true
apply_patch_freeform = true
rmcp_client = true
ghost_commit = true
[shell_environment_policy]
include_only = [ "PATH", "HOME", "TERM", "LANG", "LC_ALL", "PAGER", "GIT_PAGER", "PYTHONUNBUFFERED" ]
[shell_environment_policy.set]
CODEX_CLI = "1"
TERM = "xterm-256color"
LANG = "C.UTF-8"
LC_ALL = "C.UTF-8"
PAGER = "cat"
GIT_PAGER = "cat"
PYTHONUNBUFFERED = "1"
[mcp_servers.next-devtools]
command = "npx"
args = [ "next-devtools-mcp@latest" ]
startup_timeout_sec = 60
All other mcp's are fine and all other funtionnalities from this mcp is fine as well. The problem is that codex is not able to watch what processes i have running in my terminal from it's sandbox. Which is a a big limitation and does not let me use a lot of other tools.
What steps can reproduce the bug?
Run dev server of a next js project in a terminal and have codex try to use nextdev tools mcp to detect if the server is running.
What is the expected behavior?
The tool "just works" in github copilot because it uses my terminal so any process is easily detected. The expected behavior would be that codex needs access to my terminal if i want to give it to it, or needs it's own working long running terminal (i have tried setting up streamable_shell = true and unified_exec = true in the toml file to give it a long running terminal, but it does not work well, it fails with error keyboard interrupt, which is impossible because codex does not have a keyboard). It would be nice to have a switch in the .toml where codex uses my terminal when desired.
Additional information
It would be nice to put somewhere some information, that is easy to understand about the constraints of the sandbox and the options that we have to set it up.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗