Skip to content

fix: Resolve Houdini MCP server connection and startup issues#10

Open
Limbicnation wants to merge 4 commits intocapoomgit:mainfrom
Limbicnation:fix/houdini-mcp-startup
Open

fix: Resolve Houdini MCP server connection and startup issues#10
Limbicnation wants to merge 4 commits intocapoomgit:mainfrom
Limbicnation:fix/houdini-mcp-startup

Conversation

@Limbicnation
Copy link
Copy Markdown

This commit addresses multiple issues preventing the Houdini MCP server from starting and connecting correctly with Claude Desktop.

Problem Description:
The Houdini MCP server failed to start due to several factors:

  1. Missing Python Dependencies: The module and other required libraries (, , ) were not consistently installed or found, leading to .
  2. Mandatory RAPIDAPI_KEY Check: The server would exit if was not configured in , even if OPUS API features were not intended for use.
  3. Windows-style Path in Venv: The virtual environment path ( vs ) was incorrect for Linux systems, causing issues with manipulation.
  4. Conflicting Venv Path Manipulation: Manual modification in interfered with Provide a command or script to invoke with uv run <command> or uv run <script>.py.

The following commands are available in the environment:

  • dotenv
  • httpx
  • jsondiff
  • jsonpatch
  • jsonpointer
  • markdown-it
  • mcp
  • normalizer
  • pygmentize
  • python
  • python3
  • python3.12
  • typer
  • uvicorn

See uv run --help for more information.'s
automatic virtual environment handling.
5. PySide Compatibility: The Houdini-side TCP server () used , which is incompatible with newer Houdini versions (e.g., Houdini 21.0) that use .
6. Incorrect Working Directory for Claude Desktop: Claude Desktop was launching the Provide a command or script to invoke with uv run <command> or uv run <script>.py.

The following commands are available in the environment:

  • dotenv
  • httpx
  • jsondiff
  • jsonpatch
  • jsonpointer
  • markdown-it
  • mcp
  • normalizer
  • pygmentize
  • python
  • python3
  • python3.12
  • typer
  • uvicorn

See uv run --help for more information. command from an incorrect working
directory, preventing from finding and the
virtual environment.

Solution Implemented:

  1. Updated : Added , , and as dependencies. was run to install them.
  2. Made OPUS API Optional: Modified to change the check from a critical exit to a warning. OPUS API features are now gracefully disabled if keys are missing, allowing the server to start.
  3. Removed Manual Venv Path Manipulation: Deleted the problematic modification logic from , allowing Provide a command or script to invoke with uv run <command> or uv run <script>.py.

The following commands are available in the environment:

  • dotenv
  • httpx
  • jsondiff
  • jsonpatch
  • jsonpointer
  • markdown-it
  • mcp
  • normalizer
  • pygmentize
  • python
  • python3
  • python3.12
  • typer
  • uvicorn

See uv run --help for more information. to handle the virtual environment correctly.
4. Flexible PySide Import: Modified to dynamically import first, falling back to , ensuring compatibility across different Houdini versions.
5. Configured in Claude Desktop: (User-applied change to ) Added the property to the server configuration in Claude Desktop, pointing to the project root (). This ensures Provide a command or script to invoke with uv run <command> or uv run <script>.py.

The following commands are available in the environment:

  • dotenv
  • httpx
  • jsondiff
  • jsonpatch
  • jsonpointer
  • markdown-it
  • mcp
  • normalizer
  • pygmentize
  • python
  • python3
  • python3.12
  • typer
  • uvicorn

See uv run --help for more information. executes in the correct context.

Impact:
The Houdini MCP server now starts reliably, connects to Claude Desktop, and provides core Houdini functionalities. OPUS API features are optional and can be enabled by configuring the .

Fixes: #<issue_number> (if applicable)

This commit addresses multiple issues preventing the Houdini MCP server
from starting and connecting correctly with Claude Desktop.

Problem Description:
The Houdini MCP server failed to start due to several factors:
1.  **Missing Python Dependencies:** The  module and other required
    libraries (, , ) were not
    consistently installed or found, leading to .
2.  **Mandatory RAPIDAPI_KEY Check:** The server would exit if
     was not configured in , even if OPUS API
    features were not intended for use.
3.  **Windows-style Path in Venv:** The virtual environment path
    ( vs ) was incorrect for Linux systems, causing issues
    with  manipulation.
4.  **Conflicting Venv Path Manipulation:** Manual
    modification in  interfered with Provide a command or script to invoke with `uv run <command>` or `uv run <script>.py`.

The following commands are available in the environment:

- dotenv
- httpx
- jsondiff
- jsonpatch
- jsonpointer
- markdown-it
- mcp
- normalizer
- pygmentize
- python
- python3
- python3.12
- typer
- uvicorn

See `uv run --help` for more information.'s
    automatic virtual environment handling.
5.  **PySide Compatibility:** The Houdini-side TCP server ()
    used , which is incompatible with newer Houdini versions
    (e.g., Houdini 21.0) that use .
6.  **Incorrect Working Directory for Claude Desktop:** Claude Desktop
    was launching the Provide a command or script to invoke with `uv run <command>` or `uv run <script>.py`.

The following commands are available in the environment:

- dotenv
- httpx
- jsondiff
- jsonpatch
- jsonpointer
- markdown-it
- mcp
- normalizer
- pygmentize
- python
- python3
- python3.12
- typer
- uvicorn

See `uv run --help` for more information. command from an incorrect working
    directory, preventing  from finding  and the
    virtual environment.

Solution Implemented:
1.  **Updated :** Added , , and
     as dependencies.  was run to install them.
2.  **Made OPUS API Optional:** Modified  to
    change the  check from a critical exit to a warning.
    OPUS API features are now gracefully disabled if keys are missing,
    allowing the server to start.
3.  **Removed Manual Venv Path Manipulation:** Deleted the problematic
     modification logic from ,
    allowing Provide a command or script to invoke with `uv run <command>` or `uv run <script>.py`.

The following commands are available in the environment:

- dotenv
- httpx
- jsondiff
- jsonpatch
- jsonpointer
- markdown-it
- mcp
- normalizer
- pygmentize
- python
- python3
- python3.12
- typer
- uvicorn

See `uv run --help` for more information. to handle the virtual environment correctly.
4.  **Flexible PySide Import:** Modified  to dynamically
    import  first, falling back to , ensuring
    compatibility across different Houdini versions.
5.  **Configured  in Claude Desktop:** (User-applied change to
    ) Added the  property to the
     server configuration in Claude Desktop, pointing to the
    project root ().
    This ensures Provide a command or script to invoke with `uv run <command>` or `uv run <script>.py`.

The following commands are available in the environment:

- dotenv
- httpx
- jsondiff
- jsonpatch
- jsonpointer
- markdown-it
- mcp
- normalizer
- pygmentize
- python
- python3
- python3.12
- typer
- uvicorn

See `uv run --help` for more information. executes in the correct context.

Impact:
The Houdini MCP server now starts reliably, connects to Claude Desktop,
and provides core Houdini functionalities. OPUS API features are
optional and can be enabled by configuring the .

Fixes: #<issue_number> (if applicable)
- Remove auto-start on import in __init__.py (was causing port conflicts)
- Make start_server/stop_server idempotent with proper state guards
- Add restart_server() utility and cleanup helpers in server.py
- Rename self.socket to self.server_socket for clarity
- Handle BrokenPipeError/ConnectionResetError on client disconnect
- Detect stale sockets in HoudiniConnection via getpeername()
- Increase Houdini comm timeout to 5min for render operations
- Use 127.0.0.1 consistently instead of localhost
- Add langchain_classic fallback import
- Add shelf tool scripts for start/stop
- Add ZipSlip protection to _unzip_file() with realpath validation
- Implement 4-byte length-prefix TCP framing protocol on both sides
- Fix zip_filepath possibly-unbound bug in OPUS import
- Fix hou.nodeType crash in MCP bridge (replace with URL-derived name)
- Add .gitignore entries for *.env, IDE files, .claude/
- Untrack urls.env from git (API key leak prevention)
- Delete dead main.py scaffold
- Update pyproject.toml description
- Add ping command for protocol version detection
- Add protocol handshake in send_command() to prevent silent hangs
When the running Houdini plugin doesn't recognize the ping command
(older version), it returns a valid framed JSON error response instead
of a pong. The handshake now treats this as a successful framing
protocol verification rather than a hard failure, allowing the MCP
bridge to proceed with normal commands.
@Limbicnation Limbicnation force-pushed the fix/houdini-mcp-startup branch from d318f1b to 7dd64e6 Compare April 14, 2026 04:21
@DonLoquacious
Copy link
Copy Markdown

+1 — independently verified on macOS 15 / Apple Silicon (Houdini 21.0.671):

  • Item 1 (missing deps): hit ModuleNotFoundError: requests on first uv run because pyproject.toml only declared mcp[cli]>=1.4.1. Adding requests and python-dotenv to [project].dependencies resolves cleanly.
  • Item 2 (RAPIDAPI mandatory check): same crash; making OPUS optional is the right call. The current behavior breaks the bridge entirely for users who don't intend to use OPUS at all.
  • Item 3 (Windows-style .venv/Lib/site-packages): confirmed broken on Unix — uv lays the venv out at .venv/lib/python3.12/site-packages. A glob over .venv/lib/python*/site-packages covers Unix, falling through to the existing Windows path covers Windows.
  • Item 5 (PySide compat): hard blocker on Houdini 21. Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages-forced/ ships only PySide6 — from PySide2 import ... raises ImportError immediately, so the in-Houdini server never starts. The PySide6→PySide2 fallback pattern in this PR is the right approach; QtCore.QTimer API used by server.py is stable across both versions, so no further code changes were needed beyond the import block.

Independent fork applied the same five fixes locally and the bridge + TCP server (verified via raw socket round-trip of get_scene_info) work end-to-end.

Adds a Mac Apple Silicon Houdini 21 data point to the existing test coverage. Hope this helps land it.

@Limbicnation
Copy link
Copy Markdown
Author

@DonLoquacious — thank you for the thorough independent verification on macOS 15 / Apple Silicon / Houdini 21.0.671. This is exactly the kind of cross-platform validation that helps land these fixes with confidence.

Really appreciate you confirming all five items end-to-end, especially:

  • Item 3 (venv path) — good catch on the .venv/lib/python*/site-packages glob for Unix. The Windows fallback path staying intact is the right balance.
  • Item 5 (PySide6 fallback) — this was the biggest unknown for me since I don't have a Mac Houdini 21 setup to test. Your confirmation that QtCore.QTimer API stability holds across PySide2→PySide6 is reassuring.

The raw socket round-trip verification of get_scene_info is a solid smoke test — bridge + TCP server working end-to-end is what matters.

I'll ping the maintainer to see if we can get this merged. Thanks again for taking the time to test and document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants