Skip to content

MCP server

Last updated: 5 December 2026 · @hadronbox/mcp 0.1.0 · API v1 (beta)

The hadronbox MCP server gives an AI client that supports the Model Context Protocol (MCP) hadronbox machines as tools: the agent creates a machine, runs commands in it, reads and writes files. Commands run in the hadronbox machine, not on your computer.

Release status: the commands below work as soon as the @hadronbox/mcp package is published on npm. The server runs locally (stdio) and uses the public API with your API key.

Requirements

  • Node.js 20 or later (it runs with npx; nothing else to install).
  • A scoped API key. Create one on the API keys page of the panel.

Which scopes

The agent uses the key, so give it only the scopes it needs:

UseScopes
Work on existing machinesmachines:read, machines:exec
Also create machinesthe above + machines:create
Pause, resume, open portsthe above + machines:manage
Create machines from snapshotsthe above + snapshots:read
Delete machinesmachines:delete and --allow-delete on the server

The delete_machine tool is not listed by default; it appears when you start the server with --allow-delete (or HADRONBOX_MCP_ALLOW_DELETE=1). All scopes are on the API keys page.

Setup

Claude Code:

claude mcp add hadronbox -e HADRONBOX_API_KEY=$HADRONBOX_API_KEY -- npx -y @hadronbox/mcp

Claude Desktop (claude_desktop_config.json) and Cursor (.cursor/mcp.json or ~/.cursor/mcp.json) use the same format:

{
  "mcpServers": {
    "hadronbox": {
      "command": "npx",
      "args": ["-y", "@hadronbox/mcp"],
      "env": { "HADRONBOX_API_KEY": "<HADRONBOX_API_KEY>" }
    }
  }
}

Replace <HADRONBOX_API_KEY> with your own API key. If you put the key in a configuration file, do not commit that file. Environment variables:

VariableMeaning
HADRONBOX_API_KEYAPI key (required)
HADRONBOX_BASE_URLAPI address (default https://api.hadronbox.tr/v1)
HADRONBOX_MCP_ALLOW_DELETE1 also lists delete_machine

Tools

ToolWhat it doesScope
create_machineCreates a machine and waits until it runs (template, size, tools)machines:create, machines:read
list_machinesLists machines with id, name and statusmachines:read
execRuns a command; exit code, stdout, stderr; timeoutmachines:exec
read_fileReads a text file under /workspacemachines:exec
write_fileWrites a text file under /workspacemachines:exec
pause_machinePauses a machinemachines:manage
resume_machineResumes a paused machinemachines:manage
list_snapshotsLists snapshotssnapshots:read
create_from_snapshotCreates a machine from a ready snapshotmachines:create, machines:read
expose_portOpens a private preview URL for a port (Port preview)machines:manage
delete_machineDeletes a machine (only with --allow-delete)machines:delete

exec waits for the command to finish. The default timeout is 120 seconds, at most 3600 seconds; when it passes, the command is stopped in the machine too. Long output keeps its start and end and is shortened in the middle (20,000 characters by default). Commands get no stdin; for multi-line work the agent first writes a script with write_file.

Errors

Errors come back as tool results the model can read and act on:

  • Missing scope (INSUFFICIENT_SCOPE, 403): names the missing scope and the tool; the agent does not retry and asks you for a key with the right scope.
  • Command blocked (COMMAND_BLOCKED, 400): the security scan did not run the command; the blocked part (details.target) and the reason are included. If the part only looks like an address (for example 12:00), the command can run from a script file; if the target is really blocked, the agent is told not to look for another way.
  • Not enough credit (CREDIT_INSUFFICIENT, 402): shows the balance and the amount needed in TL; it is not retried until the balance is topped up.
  • Unknown machines, wrong states, rate limits and connection errors also come back with an explanation. All codes: Error codes.

Security and cost

  • The agent can do anything the key allows. Use the narrowest key; you can revoke it when the work is done.
  • Instructions in a web page or a file can mislead the agent (prompt injection). Turn on the delete tool only when you need it.
  • Running machines use credit. The agent calls pause_machine when it is done; idle machines pause automatically anyway.

Examples with agent frameworks (Claude Agent SDK, LangGraph, OpenAI Agents): Agent frameworks.

MCP server · hadronbox docs