nullspace CLI as MCP tools so a local coding agent can create
sandboxes, run commands, upload files, build templates, inspect volumes, and
stream lifecycle data without shelling out manually.
Use stdio for local coding agents. The agent starts nullspace mcp serve when
it needs tools, and the server process receives NULLSPACE_API_KEY and
NULLSPACE_API_URL from the MCP client configuration.
Install And Verify
Install the SDK with CLI and MCP extras:uv pip install "nullspace-sdk[cli,mcp]==0.1.9" is equivalent after the environment is active.
Install the local agent docs pack in the project where Claude Code or Codex
will run:
nullspace mcp serve as a separate background process for stdio
clients. Stdio clients launch it themselves and communicate over stdin/stdout.
Each leaf CLI command becomes a dotted MCP tool name. Hyphens normalize to
underscores:
| CLI command | MCP tool |
|---|---|
nullspace sandbox list | nullspace.sandbox.list |
nullspace sandbox create | nullspace.sandbox.create |
nullspace template build-status | nullspace.template.build_status |
nullspace volume download-url | nullspace.volume.download_url |
nullspace schema, and tool calls use the same
Click command path as the CLI.
Codex
nullspace docs install --agent codex writes local docs to
.nullspace/agent-docs/, installs the Nullspace skill under
.agents/skills/nullspace, and writes a Codex MCP snippet at
.nullspace/agent-docs/codex-config.toml.
Codex reads MCP servers from ~/.codex/config.toml. Add this block:
nullspace.sandbox.list. If it does not, restart Codex after
editing ~/.codex/config.toml and confirm the nullspace executable is on the
same PATH visible to Codex.
Codex can also add a stdio server with:
~/.codex/config.toml and add
env_vars, startup_timeout_sec, and tool_timeout_sec if they are missing.
Claude Code
nullspace docs install --agent claude-code writes local docs to
.nullspace/agent-docs/, adds managed Nullspace imports to CLAUDE.md, and
creates or updates .mcp.json. It also installs the Nullspace skill under
.claude/skills/nullspace for reusable Nullspace workflows.
For a project-scoped Claude Code setup, create .mcp.json in the project root:
/mcp to inspect connected servers. Claude Code will
ask for approval before using project-scoped servers from .mcp.json.
Ask for a read-only first call:
NULLSPACE_API_KEY and
NULLSPACE_API_URL are present in the shell that launched claude.
Cursor
Cursor usesmcp.json with an mcpServers object. Use a project-scoped file at
.cursor/mcp.json, or a global file at ~/.cursor/mcp.json:
nullspace appears in the available MCP tools, then
ask for a read-only action such as listing sandboxes.
VS Code Or GitHub Copilot Agent Mode
VS Code uses a different shape from Claude Code and Cursor: the top-level key isservers, not mcpServers. Put this in .vscode/mcp.json for a workspace
setup:
MCP: List Servers to confirm nullspace
starts. If you prefer env files, VS Code also supports envFile; keep any file
containing NULLSPACE_API_KEY out of git.
Hosted Transports
Prefer stdio when the agent can spawn local commands. Use HTTP or SSE only when the MCP client cannot spawnnullspace directly.
Streamable HTTP:
0.0.0.0 when you have a separate access-control layer in front of
the server. The Nullspace MCP server uses your Nullspace API key and should be
treated as a privileged local tool.
Troubleshooting
| Symptom | Check |
|---|---|
Agent cannot find nullspace | Use an absolute command path, or launch the agent from a shell where which nullspace succeeds. |
| MCP server starts but API calls fail | Confirm NULLSPACE_API_KEY and NULLSPACE_API_URL are passed into the MCP server config, not only set in another terminal. |
| Tools are not visible after config edits | Restart the agent and use its MCP list command or UI to refresh connected servers. |
| Cursor cannot resolve credentials | Use ${env:NULLSPACE_API_KEY} syntax and make sure Cursor was launched with that env var. |
| VS Code config does not load | Use top-level servers, not mcpServers, for .vscode/mcp.json. |
| Claude Code prompts for approval | Approve the project-scoped server from /mcp; this is expected for .mcp.json files. |