setup guide
Connect modebox to your agent.
No changes to your agent: install the CLI, list your tools, and add modebox to your agent's MCP config. Your agent then gets up to three tools.
- types
- Shows the TypeScript signatures of everything a script can call.
- execute
- Runs the agent's JavaScript or TypeScript in the sandbox.
- approve
- Resumes a paused run with your decision. Only in some setups.
01 install
Install the CLI
It's also the MCP server. Needs Rust 1.96 or later.
$ cargo install modeboxOr download it from the latest release:
curl -LO https://github.com/farming-labs/modebox/releases/latest/download/modebox-aarch64-apple-darwin.tar.gz
curl -LO https://github.com/farming-labs/modebox/releases/latest/download/modebox-aarch64-apple-darwin.tar.gz.sha256
shasum -a 256 -c modebox-aarch64-apple-darwin.tar.gz.sha256
tar xzf modebox-aarch64-apple-darwin.tar.gz
sudo mkdir -p /usr/local/bin
sudo mv modebox-aarch64-apple-darwin/modebox /usr/local/bin/
modebox --versionOn another machine, swap aarch64-apple-darwin for x86_64-apple-darwin (Intel Mac), x86_64-unknown-linux-gnu or aarch64-unknown-linux-gnu.
npm install modebox and pip install modebox (Python 3.10 or later) install the library for your own code. They don't include the modebox command.
02 config
List your tools in modebox.json
Put it at your project root. Shell commands can only write inside that folder and temp folders.
{
"mcpServers": {
"github": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]
}
},
"approve": ["github.*"],
"shell": { "enabled": true, "network": false, "allow": ["ls", "rg", "git status", "git diff"] },
"limits": { "timeoutMs": 60000 }
}- mcpServers
- Servers whose tools become functions, like
github.create_issue(). Local (stdio) servers only. - approve
- Patterns for calls that pause for your approval.
*matches anything, sogithub.*asks before every GitHub call. - shell
- Turns on
sh(). Allowed commands run; anything else pauses.networkis off, on, or a list of hosts. - flows · fetch · fs · limits
- Data-flow rules,
fetch(), file storage and resource limits. - mcp.approveTool
- Whether to offer the
approvetool. See approvals below.
Keep tokens out of the file. Your MCP servers inherit the environment your agent starts them with, so export GITHUB_PERSONAL_ACCESS_TOKEN=… there. Codex passes only a few variables, so its tab forwards the token with env_vars.
Check it before connecting anything:
$ modebox -c modebox.json types03 connect
Connect your agent
Every agent runs the same command: modebox mcp.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"modebox": {
"type": "local",
"command": ["modebox", "mcp", "-c", "modebox.json"],
"enabled": true,
"timeout": 300000
}
},
"permission": {
"modebox_approve": "ask"
}
}timeout, in milliseconds, applies to every MCP request, including tool calls.300000gives long scripts 5 minutes."modebox_approve": "ask"makes opencode ask you before everyapprovecall. Keep it: opencode allows every tool by default.- Use
integrations/opencode/modebox.jsonfrom the repo as yourmodebox.json. It turns on theapprovetool. - Optional: copy
integrations/opencode/.opencode/plugin/modebox-sandbox.tsinto.opencode/plugin/, and opencode's ownbashtool runs in modebox's OS sandbox too.
{
"mcpServers": {
"modebox": { "command": "modebox", "args": ["mcp", "-c", "modebox.json"] }
}
}$ claude mcp add --scope project modebox -- modebox mcp -c modebox.json- Put the file at your project root, or let Claude Code write it with the command above.
- In an interactive session, Claude Code asks you to trust a project's MCP servers the first time it sees them.
- Don't add
mcp__modebox__approveto your allowed tools. - Check the connection with
claude mcp listor/mcp.
[mcp_servers.modebox]
command = "modebox"
args = ["mcp", "-c", "/absolute/path/to/your/project/modebox.json"]
env_vars = ["GITHUB_PERSONAL_ACCESS_TOKEN"]
tool_timeout_sec = 300- Put it in
~/.codex/config.toml, or in.codex/config.tomlin a trusted project, and point it at yourmodebox.jsonwith an absolute path. - Codex starts MCP servers with only a few environment variables.
env_varsforwards the ones your tools need, like the GitHub token. tool_timeout_secgives long scripts up to 5 minutes; the default is 60 seconds.
{
"mcpServers": {
"modebox": { "command": "modebox", "args": ["mcp", "-c", "${workspaceFolder}/modebox.json"] }
}
}- Cursor fills in
${workspaceFolder}, so the path is absolute. - To use modebox in every project, put the same entry in
~/.cursor/mcp.json.
- T3 Code drives the agents installed on your machine, such as Codex, Claude Code and opencode, and they load their own MCP servers.
- Set modebox up in the agent you use through T3 Code, using its tab here, and it's available in T3 Code too.
- New T3 Code threads start in Full access mode, which doesn't ask before tools run. Keep
approveTooloff there; see approvals below.
$ modebox mcp -c /path/to/modebox.json- Add a local (stdio) server that runs this command.
- Desktop apps may not see your shell's
PATH. If so, use the full path thatwhich modeboxprints.
04 approvals
How approvals reach you
modebox picks the best option your client supports.
- MCP 2026-07-28 clients
- The client asks you, and the paused run travels with the request, so your answer can come after a restart.
- Clients that can prompt
- You get a prompt inline, and the run continues.
- Everyone else
- The call is denied with a
PermissionDeniederror."mcp": { "approveTool": true }offers anapprovetool instead.
The model is the one that calls approve. Turn on approveTool only if your agent asks you before every call to it, and keep it off in any mode that skips permission prompts.
05 help
If something's off
- The agent doesn't see modebox
- Run
modebox -c modebox.json typesin the same folder. If that works, use the full path tomodeboxas the command. - Tool calls time out
- Raise your agent's MCP timeout:
timeoutfor opencode,tool_timeout_secfor Codex. Claude Code's default is already long. - A call was denied, not asked
- Your client can't ask you itself, and
approveToolis off. - sh() has no OS sandbox
- On Linux, install bubblewrap and allow user namespaces. modebox never runs a command unconfined.