Migration from STDIO to In-Memory Transport
Issue
The video generation orchestrator failed during initialization due to two critical issues:
- Connection errors when using STDIO transport, caused by subprocesses not inheriting the required virtual environment and dependencies.
- Tool registration errors where specific tools, such as
split_code_into_segments, were not recognized by the MCP (Microservice Communication Protocol), preventing workflow execution.
Culprit
The STDIO transport environment was mismatched, as subprocesses failed to inherit the correct Python virtual environment and dependencies. Additionally, the split_code_into_segments function was not decorated with the @mcp.tool() decorator, rendering it invisible to the MCP tool registry.
Solution
The system was updated to use in-memory transport instead of STDIO transport, allowing server instances to be imported directly and executed within the same Python process. This eliminated subprocess overhead and ensured consistent access to dependencies and the virtual environment. Additionally, the missing @mcp.tool() decorator was added to expose the split_code_into_segments function to the MCP registry, enabling it to be called and used in workflows.