Draft: --from-mcp in hud init
[!NOTE] Adds
hud init --from-mcpto scaffold a controller/environment template from an external MCP server and auto-generate tool stubs, plus introduces thefrom_mcp_templateenvironment.
- CLI:
hud initnow supports--from-mcp <URL>to scaffold from an external MCP server.- Updates flow to fetch tools via MCP, then generate controller tool stubs; adjusts
create_environment(...)to acceptfrom_mcpand choose template/branch accordingly.- Scaffolding/Template:
- Adds
environments/from_mcp_template/withDockerfile,pyproject.toml, controller package (controller/__init__.py,__main__.py,tools.py), example.env.example,tasks.json,test_env.ipynb,test_task.py, and README instructions.- Codegen:
- New utilities in
hud/cli/init.py:_generate_tool_stubs(...)andanalyze_external_mcp_server(...)to derive function signatures from tool schemas and append stubs tocontroller/tools.py.- Docs/UX:
- Readmes for controller and template with usage/testing guidance; updated
hud/cli/__init__.pyinithelp/examples to mention--from-mcp.Written by Cursor Bugbot for commit 5d7de3656fbcf7efe24af5fb2d7e064aedb9211c. This will update automatically on new commits. Configure here.
Can test with hud init --from-mcp https://mcp.deepwiki.com/mcp. Not sure if we want to add any nice handling to try multiple paths (e.g. /, /mcp, /sse) to make the cli more accommodating here?
📝 Documentation updates detected!
New suggestion: Add documentation for hud init --from-mcp feature Updated existing suggestions: