hydrilla-mcp

v2.2.3
hydrilla-mcp Checked 3 days ago Published 7 days ago

MCP server for Hydrilla: generate 3D models and send them into Blender, Unity, Unreal, Godot, Maya or 3ds Max, and control 3ds Max scenes.

Stdio MCP server for the Hydrilla developer API. Shared across Cursor, Claude Code, and other MCP clients via project-root .mcp.json (not under .cursor/). It lets the user's own AI agent (Claude Code, Cursor, Codex and others) drive Hydrilla from outside. It is separate from Hydrilla Agent, the chat agent inside the Hydrilla app at /app/agent, which talks to Blender through the add-on's own connection and does not use this package. Users get it the next time their AI app starts npx -y hydrilla-mcp@latest.

Summary extracted from the README.

Hydrilla MCP Server

Stdio MCP server for the Hydrilla developer API. Shared across Cursor, Claude Code, and other MCP clients via project-root .mcp.json (not under .cursor/).

It lets the user's own AI agent (Claude Code, Cursor, Codex and others) drive Hydrilla from outside. It is separate from Hydrilla Agent, the chat agent inside the Hydrilla app at /app/agent, which talks to Blender through the add-on's own connection and does not use this package.

Build

cd apps/frontend/plugins/mcp
pnpm install   # or npm install
pnpm run build # or npm run build

Release (automatic)

Bump "version" in package.json in your PR; merging it publishes that version to npm. .github/workflows/release-mcp.yml does this:

When What runs
A PR touches apps/frontend/plugins/mcp/ Builds, starts the server and lists its tools (it must report the package.json version and offer both Hydrilla and 3ds Max tools), and shows what would be published. Fails if published files changed (src/, catalog/, package.json; not README) but the version did not, or if that version is already on npm
The PR is merged to main Publishes the version with npm publish, unless npm already has it
Actions › Release hydrilla-mcp › Run workflow The same as a merge, by hand

Users get it the next time their AI app starts npx -y hydrilla-mcp@latest. The server reads its version from package.json (SERVER_VERSION in src/config.ts), so that is the only place to bump.

A change to the 3ds Max engine's tools regenerates catalog/max-tools.json, which is part of this package: bump this version in the same PR, or AI apps keep the old tool list.

One-time setup (npmjs.com)

The workflow uses npm trusted publishing: npm checks that the publish comes from this workflow in this repository, so no npm token is stored in GitHub. Signed in to npmjs.com as a maintainer of hydrilla-mcp:

  1. Open https://www.npmjs.com/package/hydrilla-mcp/access (Settings).
  2. Under Trusted publishing, choose GitHub Actions and enter: organization or user HydrillaAI, repository hydrilla-ai, workflow filename release-mcp.yml, environment left empty.
  3. Save. Optionally set Publishing access to "Require two-factor authentication and disallow tokens", so only this workflow (or a maintainer with 2FA) can publish.

Because the repository is public, npm also attaches a provenance statement to each version, linking it to the commit and workflow run that built it.

To publish by hand instead: npm login as a maintainer, then npm publish in this folder (prepublishOnly builds first).

Secrets

cp mcp.env.example mcp.env
# edit mcp.env — never commit mcp.env
Variable Required Purpose
HYDRILLA_API_KEY No, if a plugin has the key hyd_live_… from /app/api-keys. When unset, the server uses the key pasted into a Hydrilla plugin (~/.hydrilla/config.json), read on every call
HYDRILLA_API_BASE No Defaults to production backend
POSTHOG_PROJECT_TOKEN Recommended phc_… for MCP Analytics
POSTHOG_HOST No Defaults to https://us.i.posthog.com

Project MCP config (any AI)

The committed config (no secrets) is .mcp.json at the repo root. It points at dist/index.js with a path relative to that folder. The server loads mcp.env from its own directory. Do not use ${workspaceFolder} or envFile here: Claude Code does not expand that variable and does not read envFile.

The fastest setup is to paste this into any agent: Read and follow https://hydrilla.ai/agent-onboarding/SKILL.md.

Public install by hand (same flow as the MCP page). The npm package is hydrilla-mcp (Node.js 20+). Replace hyd_live_… with a key from /app/api-keys. The key stays in the client config, not in chat.

Claude Code (macOS / Linux):

claude mcp add -s user hydrilla --env HYDRILLA_API_KEY=hyd_live_… -- npx -y hydrilla-mcp@latest

Claude Code (Windows):

claude mcp add -s user hydrilla --env HYDRILLA_API_KEY=hyd_live_… "--" cmd /c npx -y hydrilla-mcp@latest

Codex:

codex mcp add hydrilla --env HYDRILLA_API_KEY=hyd_live_… -- npx -y hydrilla-mcp@latest

Cursor: open the install link from /integrations/mcp, or paste this into ~/.cursor/mcp.json and turn hydrilla on:

{
  "mcpServers": {
    "hydrilla": {
      "command": "npx",
      "args": ["-y", "hydrilla-mcp@latest"],
      "env": {
        "HYDRILLA_API_KEY": "hyd_live_…"
      }
    }
  }
}

Local checkout of this repo:

{
  "mcpServers": {
    "hydrilla": {
      "command": "node",
      "args": ["apps/frontend/plugins/mcp/dist/index.js"]
    }
  }
}

The path is relative to the folder that contains .mcp.json. The server reads mcp.env beside itself, so the key is not written into this file.

Tools

Tool What it does
hydrilla_me Plan and credit balance. Free.
hydrilla_text_to_3d Generate a GLB from a prompt. send_to places it in an open app.
hydrilla_image_to_3d Generate a GLB from an image URL. send_to places it in an open app.
hydrilla_get_task Waits up to ~45 s on one task, then returns status, progress and mesh URL. send_to places it in an app once ready.
hydrilla_list_tasks Recent models on the account. Free.
hydrilla_cancel_task Stop a running task; unused credits are refunded.
hydrilla_list_apps Which apps have their Bridge running right now.
hydrilla_send_to_app Put an existing model into Blender, Unity, Unreal, Godot, Maya or 3ds Max. Free.
hydrilla_blender_scene_info Objects in the open Blender scene with world location, rotation, scale and bounding-box size. Read-only.
hydrilla_blender_run_python Run Python (bpy) in the open Blender session and return what it printed. Needs the user's permission in the add-on.
hydrilla_blender_screenshot The Blender 3D viewport as an image. Read-only.
hydrilla_max_* (178) Read and edit the open 3ds Max scene. Only listed with Hydrilla for 3ds Max installed; see below.

Working in 3ds Max

On a Windows computer with Hydrilla for 3ds Max installed (hydrilla-3dsmax.mzp, from /integrations/3dsmax), this server also offers 178 hydrilla_max_* tools: scene query and patch, objects, modifiers, modeling, materials, lighting, controllers and animation, viewport, render, .max files, plugin introspection, and tyFlow, RailClone, Forest Pack, Pulze, Data Channel and Max Creation Graph. Everywhere else they are not listed at all.

How it works:

  1. The .mzp installs an application package in %APPDATA%\Autodesk\ApplicationPlugins\Hydrilla3dsMax (a C++ plugin and MAXScript listener inside Max, plus the Hydrilla menu), and the engine with its own Python in %LOCALAPPDATA%\Hydrilla\3dsmax, described by install.json there.
  2. This server sees install.json and registers the tools from catalog/max-tools.json.
  3. On the first hydrilla_max_* call it starts the engine (run_engine.py, a Python MCP server) and forwards calls to it; the engine talks to Max over the local named pipe. Progress is passed through; if the engine exits, the next call starts it again.

The engine is the open-source 3dsmax-mcp (MIT), kept in vendor/3dsmax-engine at the repo root (see UPSTREAM.md there). catalog/max-tools.json is generated from its source by plugins/max/gen_tool_catalog.py; do not edit it by hand.

Variable Purpose
HYDRILLA_MAX_TOOLS full (default with 3ds Max installed): every tool. progressive: only hydrilla_max_list_toolsets, hydrilla_max_describe_toolset and hydrilla_max_call_tool, for clients with a tool limit or small context. off: none
HYDRILLA_MAX_PYTHON, HYDRILLA_MAX_ENGINE Development: run the engine from a checkout instead of the installed copy

The agent guide is the resource hydrilla://3dsmax/guide (topics under hydrilla://3dsmax/guide/{file}).

Building a scene in Blender

With the Blender add-on 2.1+ and its Bridge running, the agent can also see and change the open scene, the same way the community mcp-for-blender server works, but through the one Hydrilla Bridge (no second server or port):

  1. hydrilla_blender_scene_info lists what is in the scene and how big it is.
  2. hydrilla_blender_run_python runs a script on Blender's main thread. Each script is one Ctrl+Z step.
  3. hydrilla_blender_screenshot returns the viewport so the agent can check the result.

Scripts only run after the user turns on Let AI edit this scene in the Bridge section of the add-on's Hydrilla tab (off by default). Reading the scene and the viewport needs no extra permission.

The command endpoint (POST /command) is stricter than /import:

  • It refuses every request that carries Origin or Sec-Fetch-Site, so no web page can send one, including Hydrilla's own sites.
  • Each request needs the X-Hydrilla-Token header. The add-on writes a fresh random token to ~/.hydrilla/bridge/blender.token (mode 600) each time the Bridge starts and deletes it when the Bridge stops. This server reads it on every call.

Sending models into an app

Each Hydrilla plugin has a Bridge (Run Bridge, or Run in Blender, where it also starts with Blender by default) that listens on its own local port (Blender 7345, Maya 7346, 3ds Max 7347, Unreal 7348, Unity 7349, Godot 7350). With the Bridge running, send_to: "blender" on a generate tool, or hydrilla_send_to_app, makes the plugin download the GLB and import it into the open scene. If the Bridge is off, the tool says which button to click and the model can be sent again without regenerating.

A model takes 10 to 20 minutes to generate. No tool call stays open longer than about a minute: a generate call returns the task id with the progress so far, and the agent calls hydrilla_get_task (which waits up to ~45 seconds per call) until the model is ready, telling the user the progress in between. Calls also send progress notifications to clients that ask for them. Hydrilla fails and refunds a task that runs longer than 20 minutes.