Codex runs commands in your working copy. Pointing it at the Sandscale MCP server gives it a separate place to run the commands you would rather keep off your machine: each sandbox is its own Firecracker microVM, with the network your plan and your organization’s policy allow, and every call lands in your organization’s audit log.
This guide uses Sandscale’s Quickstart, Connect Claude or ChatGPT guide and MCP tools reference for the Sandscale side, and OpenAI’s Codex MCP documentation for the Codex side, as of November 2026. The Sandscale Quickstart says Codex connects by adding a remote MCP server with the same address as other clients; the exact Codex syntax below is from the Codex docs.
The remote server in config.toml
Codex keeps MCP configuration in ~/.codex/config.toml, or in a project’s .codex/config.toml for trusted projects. Each server is a [mcp_servers.<name>] table. For the remote Sandscale server:
[mcp_servers.sandscale]
url = "https://mcp.sandscale.dev/mcp"
No token goes in the file. Sandscale’s remote server uses OAuth, and Codex’s default auth for HTTP servers is stored MCP OAuth credentials. Sign in once:
codex mcp login sandscale
Codex opens the authorization URL. Sandscale’s sign-in page asks you to approve the app; the approval page names it and says it is not made by Sandscale. After that, each tool call runs as you, with a short-lived credential that never leaves Sandscale’s server.
On a machine without a browser, such as a remote dev box, use codex mcp login sandscale --no-browser. Codex prints the URL; open it anywhere, sign in, then paste the full redirect URL back into the terminal, even if the browser could not load the callback page.
codex mcp list shows configured servers, and /mcp inside the Codex TUI shows the active ones. In the IDE extension, the MCP servers screen marks servers that need OAuth and has an Authenticate button.
Restrict and gate the tools
The remote server has 15 tools. Codex lets you shape them per server with enabled_tools, disabled_tools and approval modes, which is a good fit because the Sandscale reference marks which tools change things.
A configuration for a coding agent that should run commands in throwaway sandboxes but leave workspaces and storage alone:
[mcp_servers.sandscale]
url = "https://mcp.sandscale.dev/mcp"
enabled_tools = [
"sandbox_list",
"sandbox_create",
"sandbox_run",
"sandbox_upload_file",
"sandbox_download_file",
"sandbox_snapshot",
"sandbox_stop",
]
default_tools_approval_mode = "writes"
[mcp_servers.sandscale.tools.sandbox_stop]
approval_mode = "prompt"
What each piece does, per the Codex docs:
enabled_toolsis an allow list. Tools not on it are not offered to the model. Here that removesworkspace_start,workspace_stop, the storage tools,vault_list_secretsand pause and resume.default_tools_approval_mode = "writes"prompts for any tool not marked read-only. The other values areauto,promptandapprove.- The per-tool table sets
sandbox_stopto always prompt. On the remote server, stopping a sandbox deletes its disk, and the reference marks that as not undoable. A prompt is a cheap check that the agent is stopping the sandbox it made.
If you trust the task more, move sandbox_run and sandbox_upload_file to auto with their own tools.<name> tables and keep the prompt on stop.
Mind the tool timeout
Codex gives each MCP tool call a time limit, tool_timeout_sec, whose default value is 60 (it is in seconds). A sandbox command such as a full test suite or a dependency install can run longer than that, and if the client gives up first the agent sees a timeout even though the command may still be running in the sandbox.
Raise it for this server by adding a line to the same table:
[mcp_servers.sandscale]
url = "https://mcp.sandscale.dev/mcp"
tool_timeout_sec = 600
Keep the sandbox’s own limits in mind too. A sandbox stops by itself when its time limit runs out, so the agent should not assume a box it started an hour ago is still there; sandbox_list will tell it.
The local server instead
The Sandscale CLI includes sandscale mcp, a stdio server that uses your CLI sign-in. After sandscale login, add it with the Codex CLI:
codex mcp add sandscale-local -- sandscale mcp
or in config.toml:
[mcp_servers.sandscale-local]
command = "sandscale"
args = ["mcp"]
The local server has 13 tools with different names: sandbox_start, sandbox_exec, sandbox_stop, sandbox_show, the workspace tools, and read-only build host and lab host tools. Its reference says signing in, the vault and deleting anything are not offered as tools, sandbox_start gives a sandbox no network unless asked, and sandbox_exec takes an optional timeout_seconds. sandscale mcp connect prints the recommended setup for each client. The remote vs local post compares the two servers.
What Sandscale enforces on its side
Codex settings decide what the model may call without asking. They do not decide what is allowed. Sandscale applies its own checks to every call, from any client:
- The same API, roles, plan limits and policy as the console and SDK. A refusal comes back with the API’s error code, which the model can read and report.
- An audit log entry for every remote MCP call with the tool, region, outcome and app, never the arguments.
- Up to 120 calls a minute per app and 60 per person.
- The United States region only for now on the remote server; another region is refused with
region_unavailable. - No Vault values to the model.
vault_list_secretsreturns names only, and no Sandscale MCP tool returns values.
Revoking access
To disconnect, remove the server from config.toml and revoke the connector on the Sandscale side with DELETE /api/v1/me/mcp-connectors/{id}, which ends the app’s sessions at once. Removing the config alone stops Codex from using the server but does not revoke what was issued.
A first task
“Create a sandbox from the Go template, upload go.mod, go.sum and the files under internal/ one by one, run go vet ./... && go test ./..., download any failing test’s output, then stop the sandbox.” It touches create, upload, run, download and the prompt on stop, and none of it runs on your machine.