Skip to main content

PhysBox: MCP

PhysBox: MCP is a Model Context Protocol (MCP) server that enables LLMs and MCP clients (such as Claude Code or Claude Desktop) to interact programmatically with the four simulation web applications in the browser:

Application Production URL Description
Volt volt.physbox.io SPICE circuit simulation (powered by NgSpice WASM in browser)
Mesh mesh.physbox.io Rigid-body physics simulation & OpenSCAD parametric CAD (powered by MuJoCo WASM)
Etch etch.physbox.io 2D vector studio, CNC toolpathing & WebSerial GRBL controller
Flux (Coming Soon) flux.physbox.io Discrete-event / system-dynamics simulation

All communication is handled via JSON over WebSockets directly to the web app in your browser—no browser automation or DOM scraping is needed.

🧠 The Only AI-Native Physical World Model

Unlike static code generation or offline file outputs, PhysBox gives AI agents an interactive ground-truth world model. LLMs execute 81 typed tool calls to observe spatial kinematics, circuit node waveforms, and G-code safety warnings, allowing them to self-correct designs iteratively.


💬 Example Agent Prompts for Claude Code & Cursor

Paste any of these prompts directly into your MCP-connected agent:

  • Volt (Electronics):

    "Optimize the RC filter values in the active Volt schematic to achieve a 1 kHz cutoff frequency, then execute circuit_run_sim and plot the magnitude response."

  • Mesh (3D Physics & CAD):

    "Write an OpenSCAD parametric mounting bracket in Mesh with 4mm screw holes, run a MuJoCo collision stability check using physics_check_collisions, and export the Z-up STL."

  • Etch (CNC & Laser):

    "Import this vector SVG logo, apply 2-pass 3mm stepdown feeds for Plywood, check end mill safety warnings, and generate GRBL G-code."


How It Works

PhysBox: MCP functions as a local companion server that establishes a WebSocket relay on port 3142.

When you open any of the simulation web apps, they connect directly to this WebSocket relay. When an MCP client executes a tool call, the command flows from the client to the companion server, gets forwarded to the active browser tab, and the results flow back.

MCP Client (e.g. Claude Desktop)
  └── spawns → physbox-mcp (stdio)
                 └── WebSocket Server (ws://localhost:3142)
                                ├── Flux
                                ├── Volt
                                ├── Mesh
                                └── Etch

Installation

Install the companion server directly from PyPI:

pip install physbox-mcp

Usage & Setup

1. Open the Web Applications

Launch or access the simulation web applications in your web browser:

As soon as a page finishes loading, it automatically registers with the companion WebSocket server.

2. Configure Your MCP Client

For Claude Desktop

Add the following block to your Claude Desktop configuration file (typically located at AppData/Roaming/Claude/claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "physbox-mcp": {
      "command": "physbox-mcp",
      "args": ["--stdio"]
    }
  }
}

For Claude Code / Local Workspace (.mcp.json)

Add a .mcp.json file to your project root (or update your global configuration at ~/.claude/mcp.json):

{
  "mcpServers": {
    "physbox-mcp": {
      "type": "stdio",
      "command": "physbox-mcp",
      "args": ["--stdio"]
    }
  }
}

Developing from source? If running directly from a cloned repository or virtual environment, use your Python interpreter:

{
  "mcpServers": {
    "physbox-mcp": {
      "type": "stdio",
      "command": "python",
      "args": ["-m", "physbox_mcp.server", "--stdio"]
    }
  }
}

(Replace "python" with the path to your virtual environment's Python executable if needed, e.g. /path/to/venv/bin/python).

For Google Antigravity IDE

On Windows/WSL setups, Antigravity IDE reads configuration from the global configuration directory. Because the global directory (~/.gemini/config/) may be write-restricted, you should link it to the writable ~/.gemini/antigravity/ folder:

  1. In PowerShell, create a Hard Link from the global configuration target to the writable user directory:

    # Delete the empty placeholder file if it exists
    Remove-Item -Path "$env:USERPROFILE\.gemini\config\mcp_config.json" -Force -ErrorAction SilentlyContinue
    
    # Create a Hard Link to the writable copy
    New-Item -ItemType HardLink -Path "$env:USERPROFILE\.gemini\config\mcp_config.json" -Target "$env:USERPROFILE\.gemini\antigravity\mcp_config.json"
    
  2. Add the physbox-mcp WSL configuration to your mcp_config.json (replacing <your-wsl-distro> with your WSL distribution such as Ubuntu-20.04):

    {
      "mcpServers": {
        "physbox-mcp": {
          "command": "C:\\Windows\\system32\\wsl.exe",
          "args": [
            "-d",
            "<your-wsl-distro>",
            "physbox-mcp",
            "--stdio"
          ]
        }
      }
    }
    

    (If developing from source in WSL, pass your virtual environment's Python binary and -m physbox_mcp.server in args instead).

  3. Restart the IDE (or close and reload the agent chat session) to register the MCP tools natively.

3. Run the Companion Server Manually (Optional)

If you are running the server in HTTP mode rather than Stdio, you can run:

# Starts HTTP server listening on port 3141 (default)
physbox-mcp

Or configure custom port parameters:

physbox-mcp --port=4000

Development & Contribution

For instructions on local development, modifying schemas, extending tool definitions, and manual builds, please refer to README_DEV.md.


📜 License

Distributed under the PhysBox Permissive Public License (PPPL-1.0).

Free for personal, educational, research, and commercial use, including commercial sale of anything you produce with it. Redistributing or hosting the software itself as a standalone or competing product requires prior written authorization. See LICENSE for full terms, including the machinery and hardware safety disclaimer.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

physbox_mcp-0.8.1.tar.gz (61.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

physbox_mcp-0.8.1-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

Details for the file physbox_mcp-0.8.1.tar.gz.

File metadata

  • Download URL: physbox_mcp-0.8.1.tar.gz
  • Upload date:
  • Size: 61.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for physbox_mcp-0.8.1.tar.gz
Algorithm Hash digest
SHA256 ab62b1c0352837c5994fcb95897e8af3547772bab3d7545ad7f30fcc16b33b0a
MD5 095b8dc8a17424abd3b3c5c2728fb877
BLAKE2b-256 26debb781a45e19a698ab401a86eb9add4cfd5e24159be6297b97c5a0eb0ec22

See more details on using hashes here.

Provenance

The following attestation bundles were made for physbox_mcp-0.8.1.tar.gz:

Publisher: publish.yml on physbox-io/physbox-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file physbox_mcp-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: physbox_mcp-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 60.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for physbox_mcp-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42d11bc581dd38d1ae2b9ba3c97bc364d0dace8d1a7e620ff2941e02fd723021
MD5 a523e26385d3084b9fb830bf0aa866dd
BLAKE2b-256 9a9a72a416582da1d0d6c1e0321776b4d61c1e21a9a3a7edfc7574fbc5d7967e

See more details on using hashes here.

Provenance

The following attestation bundles were made for physbox_mcp-0.8.1-py3-none-any.whl:

Publisher: publish.yml on physbox-io/physbox-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 files

0.8.0

2 files

0.7.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page