hud-python icon indicating copy to clipboard operation
hud-python copied to clipboard

Draft: --from-mcp in hud init

Open dylanbowman314 opened this issue 1 year ago • 2 comments

[!NOTE] Adds hud init --from-mcp to scaffold a controller/environment template from an external MCP server and auto-generate tool stubs, plus introduces the from_mcp_template environment.

  • CLI:
    • hud init now 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 accept from_mcp and choose template/branch accordingly.
  • Scaffolding/Template:
    • Adds environments/from_mcp_template/ with Dockerfile, 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(...) and analyze_external_mcp_server(...) to derive function signatures from tool schemas and append stubs to controller/tools.py.
  • Docs/UX:
    • Readmes for controller and template with usage/testing guidance; updated hud/cli/__init__.py init help/examples to mention --from-mcp.

Written by Cursor Bugbot for commit 5d7de3656fbcf7efe24af5fb2d7e064aedb9211c. This will update automatically on new commits. Configure here.

dylanbowman314 avatar Sep 30 '25 01:09 dylanbowman314

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?

dylanbowman314 avatar Sep 30 '25 01:09 dylanbowman314