# Sunfield Hosted Blender MCP Server

> Zero-local-install Streamable HTTP Remote MCP server (`https://sunfield.dev/mcp`) giving Claude Code, Cursor, Windsurf, VS Code, and OpenAI Agents SDK isolated headless Blender 4.5 GPU sandboxes and Cycles OptiX rendering.

- **Endpoint:** `https://sunfield.dev/mcp`
- **Transport:** Streamable HTTP (JSON-RPC 2.0, `MCP-Protocol-Version: 2025-03-26`)
- **Discovery Card:** `https://sunfield.dev/.well-known/mcp/server-card.json`
- **Auth:** `Authorization: Bearer sunfield_sk_...` ([Get $1.00 free key](https://sunfield.dev/start))

## Connect in 10 Seconds

### Claude Code
```bash
# Option A: 1-command OAuth 2.1 auto-provisioning (opens browser to claim $1 free key)
claude mcp add --transport http sunfield https://sunfield.dev/mcp

# Option B: Direct Bearer API key (headless / CI / scripts)
claude mcp add --transport http sunfield https://sunfield.dev/mcp \
  --header "Authorization: Bearer $SUNFIELD_API_KEY"
```

### Cursor / Windsurf / VS Code (`mcp.json`)
```json
{
  "mcpServers": {
    "sunfield": {
      "url": "https://sunfield.dev/mcp"
    }
  }
}
```
*(Or pass `"headers": {"Authorization": "Bearer $SUNFIELD_API_KEY"}` for non-interactive Bearer auth.)*

## All 14 Native Tools

| Tool | Parameters (`*` required) | Description |
| :--- | :--- | :--- |
| `sunfield_balance` | none | Return the current Sunfield account credit balance (USD) and recent double-entry ledger items. |
| `sunfield_search_assets` | `query`, `kind`, `category`, `max_tris`, `limit`, `contact_sheet` | Search Sunfield's 100% CC0 Poly Haven asset library (HDRIs, PBR materials, 3D models). Set contact_sheet=true to receive a labeled JPEG visual grid directly in the tool output. |
| `sunfield_stage_assets` | `session_id`*, `asset_ids`* | Mount 1..24 CC0 assets into a live Blender session and return ready-to-run bpy_snippet helpers. |
| `sunfield_create_session` | `preset`, `pool` | Claim a warm isolated headless Blender 4.5 GPU sandbox ($0.25 refundable hold). |
| `sunfield_list_sessions` | none | List active and recent Blender sandbox sessions for the authenticated account. |
| `sunfield_exec` | `session_id`*, `code`*, `timeout_s`, `checkpoint` | Execute Python (`bpy`) code inside a live session. Globals persist across calls, tmpfs checkpoints auto-recover crashes/timeouts, and load_hdri/load_glb/load_pbr helpers are pre-injected. |
| `sunfield_inspect` | `session_id`*, `views`, `passes`, `width`, `height`, `engine`, `cycles_samples`, `summary_only`, `include_images` | Render fast multi-view EEVEE or Cycles previews + spatial telemetry (bounds, framing, BVH collision penetration_depth, floating_objects) returning native image blocks. |
| `sunfield_checkpoint` | `session_id`*, `action`*, `name` | Save, list, or restore lightweight named tmpfs undo checkpoints (<20ms). |
| `sunfield_fork` | `session_id`*, `count` | Branch a live session into 1..8 independent child sessions for parallel exploration. |
| `sunfield_estimate_render` | `session_id`*, `samples`, `width`, `height`, `frames` | Run a two-point warm Cycles differential cost probe without committing to a full render. |
| `sunfield_render` | `session_id`*, `engine`, `samples`, `width`, `height`, `frames`, `aov_passes`, `max_cost_usd`, `async_mode` | Burst-render photorealistic or AOV frames on Cycles OptiX GPUs behind a hard max_cost_usd cap. Automatically shards multi-frame jobs across idle Pool B GPUs; use async_mode=true for >30s renders. |
| `sunfield_get_job` | `job_id`* | Poll live progress, rendered artifacts, archive_url, and video_url for an async render job. |
| `sunfield_stash` | `action`*, `session_id`, `name`, `names`, `format` | Save, list, mount, or delete account-scoped .blend/.glb assets in server-side Stash so parallel builder sessions can share scenes with a manager session without client round-trips. |
| `sunfield_close_session` | `session_id`* | Close a Blender sandbox session, settle exact active GPU-seconds, and refund the unused hold. |

## Why Remote Cloud MCP vs. Local Blender MCP?
- **Zero local GPU or Blender GUI required:** Runs headless Blender 4.5 on NVIDIA RTX/OptiX cloud workers.
- **Native VLM image feedback:** `sunfield_search_assets` returns labeled JPEG contact sheets and `sunfield_inspect` returns native MCP PNG `ImageContent` + `BVHTree` collision JSON in one tool call.
- **Hardened multi-tenant isolation:** Every session runs inside a dedicated `--network=none --cap-drop=ALL --read-only` Docker container with `392 ms` `tmpfs` crash recovery.
- **Predictable micro-USD metering:** `$0.00010/active GPU-s` interactive, `$0.000125/GPU-s` Cycles OptiX, hard `max_cost_usd` cap.
