Workspace to the SDK as an in-process MCP server, so every file and shell operation the agent runs is routed through Mirage instead of the host filesystem.
This is distinct from Claude Code, the claude CLI run as it is on a workspace. Use this SDK integration when you build your own agent with the SDK’s query() and want Mirage tools rather than the built-in file tools.
Install
Use this integration from Node. The Claude Agent SDK launches the native Claude Code runtime, so the completequery() workflow does not run in a browser.
Usage
buildOptions adds and preapproves Mirage tools, turns off the SDK’s built-in tools, and describes the mounted paths in the system prompt.
Composing with other MCP servers
UseMirageServer directly to combine Mirage with other servers:
Shell
To keep Claude’s own Bash tool and run it in a workspace, point the SDK atmirage-bash, as for Claude Code, and give it Mirage’s other tools over mirage mcp in place of Claude’s file tools. Both reach one workspace that the Mirage daemon serves:
env replaces the environment Claude Code starts with, so keep process.env in it. command -v mirage-bash prints the path.
- Bash runs in the workspace, and Mirage’s
read,write,edit,ls,grepandglobtake the place of Claude’s Read, Edit, Write, Glob and Grep, so every file the agent touches goes through Mirage. - Mount the project and
/tmpat their own paths, as the Claude Code page shows, socdcarries over. - To run under a profile, create a session with
mirage session create demo --id agent -p reviewer, then setMIRAGE_SESSIONtoagentand add-s agentto themirage mcparguments.
Tools
The server serves the session’s seven tools,session.tools: shell, read, write, edit, ls, grep and glob, named mcp__mirage__<tool> in the SDK. It carries the ones the session’s profile leaves it (session.tools.names()).