Agent Plugin Setup
mcp-exec ships plugin manifests for every supported AI agent. Each manifest registers the MCP server, wires skills, and sets the correct MCP_EXEC_RUNTIME env var so the server selects the right sandbox path at startup.
How Detection Works
mcp-exec reads the MCP_EXEC_RUNTIME environment variable at startup to select a sandbox strategy:
| Value | Sandbox | Config source |
|---|---|---|
| (absent) | SRT (@anthropic-ai/sandbox-runtime) | ~/.claude/settings.json + .claude/settings.json |
opencode | SRT | ~/.srt-settings.json + .srt-settings.json |
codex | Codex native (Seatbelt / bwrap) | ~/.codex/config.toml (diagnostics only) |
Each plugin manifest sets this env var automatically. You do not need to set it manually.
Claude Code
Plugin manifest: .claude-plugin/plugin.json
Install
claude plugin install joeblackwaslike/mcp-exec
Or manually add to your Claude Code MCP config:
{
"mcpServers": {
"mcp-exec": {
"command": "npx",
"args": ["@joeblackwaslike2/mcp-exec"]
}
}
}
Skills
Claude Code discovers skills from the plugin's skills/ directory automatically. To also prime the activation rule into your CLAUDE.md (recommended — increases skill trigger reliability from ~60% to ~95%):
mcp-exec-prime-skill
This appends a one-time activation rule to your project's CLAUDE.md. Run it once per project.
Sandbox configuration
MCP_EXEC_RUNTIME is not set — mcp-exec uses SRT and reads from ~/.claude/settings.json.
Add a sandbox block to configure network and filesystem access:
{
"sandbox": {
"network": {
"allowedDomains": ["api.github.com", "*.googleapis.com"]
},
"filesystem": {
"allowWrite": ["~/.mcp-exec/sessions", "/tmp", "./output"],
"denyRead": ["~/.ssh", "~/.aws"]
},
"env": {
"allow": ["PATH", "HOME", "TMPDIR", "USER", "GITHUB_TOKEN"]
}
}
}
Project-scope overrides go in .claude/settings.json at the project root. Array fields are merged (union + dedup) across user and project configs.
OpenCode
Plugin file: .opencode/plugins/mcp-exec.js
Install
Copy or symlink the plugin file into your OpenCode plugins directory:
cp .opencode/plugins/mcp-exec.js ~/.opencode/plugins/mcp-exec.js
Or reference the project-local plugin in your OpenCode config.
What the plugin does
The plugin hooks three things:
- Skills — pushes the
skills/directory toconfig.skills.pathsso OpenCode auto-discoversusing-mcp-execandmcp-exec-dev-workflow - MCP server — registers
mcp-execinconfig.mcp.serverswithMCP_EXEC_RUNTIME=opencode - Bootstrap injection — prepends the
using-mcp-execskill content to the first user message of each conversation so the model knows the tools are available without waiting for a skill trigger
Sandbox configuration
OpenCode does not provide a native OS sandbox. mcp-exec uses SRT and reads from ~/.srt-settings.json.
Create this file with your sandbox policy:
{
"network": {
"allowedDomains": ["api.github.com", "*.googleapis.com"]
},
"filesystem": {
"allowWrite": ["~/.mcp-exec/sessions", "/tmp"],
"denyRead": ["~/.ssh", "~/.aws"]
},
"env": {
"allow": ["PATH", "HOME", "TMPDIR", "USER", "GITHUB_TOKEN"]
}
}
For project-specific overrides, create .srt-settings.json in the project root. The format is identical — arrays are merged across user and project files.
The ~/.mcp-exec/sessions path is always added to allowWrite even if absent from your config.
Codex CLI
Plugin manifest: .codex-plugin/plugin.json
Install
Add mcp-exec to your Codex config:
[mcp_servers.mcp-exec]
command = "npx"
args = ["@joeblackwaslike2/mcp-exec"]
[mcp_servers.mcp-exec.env]
MCP_EXEC_RUNTIME = "codex"
Skills
The plugin manifest declares "skills": "./skills/". Codex auto-discovers skills from this path when the plugin is installed. No manual step required.
Sandbox
Codex provides platform-native sandboxing. mcp-exec does not initialize SRT when MCP_EXEC_RUNTIME=codex is set. Codex's OS-level sandbox handles all enforcement.
| Platform | Mechanism | Prerequisites |
|---|---|---|
| macOS | Seatbelt (sandbox-exec) | None — built into macOS |
| Linux | bubblewrap (bwrap) | sudo apt install bubblewrap (Ubuntu) |
| WSL2 | bubblewrap in WSL2 | Same as Linux |
| Windows | Windows Sandbox | Managed by Codex |
Configure the sandbox in your Codex config:
sandbox_mode = "workspace-write"
approval_policy = "on-request"
See the Codex Sandboxing reference for full details.
Gemini CLI
Extension manifest: .gemini-plugin/gemini-extension.json
Install
Copy the extension to your Gemini extensions directory:
cp -r .gemini-plugin/ ~/.gemini/extensions/mcp-exec/
Gemini auto-discovers extensions in ~/.gemini/extensions/. The extension registers the MCP server and loads skills automatically — no further configuration needed.
Manual registration (without the extension):
{
"mcpServers": {
"mcp-exec": {
"command": "npx",
"args": ["@joeblackwaslike2/mcp-exec"],
"env": { "MCP_EXEC_RUNTIME": "gemini" }
}
}
}
Skills
The extension includes a GEMINI.md context file that references both skills via @ includes. Gemini loads this as always-on context at session start. The skills/ subdirectory is also auto-discovered for on-demand skill activation.
Sandbox
Gemini provides opt-in native OS sandboxing. mcp-exec does not initialize SRT when MCP_EXEC_RUNTIME=gemini is set — Gemini's sandbox handles OS-level enforcement when enabled.
Enable the sandbox:
export GEMINI_SANDBOX=true # auto-select mechanism
# or in ~/.gemini/settings.json: "tools": { "sandbox": true }
Sandbox mechanisms by platform:
| Platform | Mechanism | Notes |
|---|---|---|
| macOS | Seatbelt (sandbox-exec) | GEMINI_SANDBOX=sandbox-exec |
| Linux | bubblewrap (bwrap) | GEMINI_SANDBOX=bwrap — requires apt install bubblewrap |
| Linux (high isolation) | gVisor (runsc) | GEMINI_SANDBOX=runsc — strongest isolation |
| All | Docker / Podman | GEMINI_SANDBOX=docker or podman |
Gemini's sandbox is opt-in. Without it, no OS-level isolation is active when running under Gemini. mcp-exec logs a warning at startup if it detects no sandbox.
See the Gemini Sandboxing reference for full details.
Cursor
Plugin manifest: .cursor-plugin/plugin.json
Install
Copy the plugin to your Cursor plugins directory:
cp -r .cursor-plugin/ ~/.cursor/plugins/mcp-exec/
Or add the MCP server manually to ~/.cursor/mcp.json:
{
"mcpServers": {
"mcp-exec": {
"command": "npx",
"args": ["@joeblackwaslike2/mcp-exec"],
"env": { "MCP_EXEC_RUNTIME": "cursor" }
}
}
}
A project-level .cursor/mcp.json takes precedence over the global config.
Skills
The plugin manifest declares "skills": "./skills/" for on-demand skill discovery. An always-on rule at .cursor/rules/mcp-exec.mdc (registered via "rules": ".cursor/rules/") loads activation context into every session with alwaysApply: true. Install it manually for project-scoped activation:
cp .cursor/rules/mcp-exec.mdc .cursor/rules/
Sandbox
Cursor provides no native MCP sandbox — MCP servers run with full Cursor process permissions. mcp-exec uses SRT and reads from ~/.cursor/srt-settings.json:
{
"network": { "allowedDomains": ["api.github.com"] },
"filesystem": { "allowWrite": ["/tmp"], "denyRead": ["~/.ssh"] },
"env": { "allow": ["PATH", "HOME", "TMPDIR", "USER"] }
}
Project overrides go in .cursor/srt-settings.json at the project root. See the Cursor Sandboxing reference for full details.
Summary: Skills Wiring Per Agent
| Agent | Skills mechanism | Auto or manual |
|---|---|---|
| Claude Code | skills/ dir in plugin manifest + mcp-exec-prime-skill primes CLAUDE.md | Auto-discover; prime command recommended |
| OpenCode | config.skills.paths in plugin hook + bootstrap injection in every conversation | Fully automatic |
| Codex CLI | skills/ field in plugin manifest | Fully automatic |
| Gemini CLI | contextFileName: GEMINI.md + skills/ in extension | Fully automatic |
| Cursor | skills/ in plugin manifest + alwaysApply rule in .cursor/rules/ | Fully automatic via plugin |
Adding a New Agent
To wire mcp-exec into a new agent:
-
Register the MCP server with
MCP_EXEC_RUNTIME=<agent-name>as an env var -
Add a detection function in
src/sandbox/config.ts:export function isMyAgentRuntime(): boolean {return process.env.MCP_EXEC_RUNTIME === 'my-agent';} -
Add a branch in
initializeSandbox()insrc/server.ts— either skip SRT (if the agent provides native sandboxing) or call SRT with an appropriate config resolver -
Point the agent at the
skills/directory so it discoversusing-mcp-execandmcp-exec-dev-workflow