Skip to content

hylo.codeagents.mcp

Package: hylo-code-agents · Core contracts

mcp

hylo mcp: any registered tool surface (group hylo.surfaces) as a Model Context Protocol server over stdio, so a coding agent (Claude Code, Codex, ...) can build and run robot worlds with the same tools a Hylo session uses.

hylo mcp --surface mujoco.world --param root=runs/stages --param stage=lab

# e.g. in a coding agent's MCP configuration:
{"command": "uv", "args": ["run", "hylo", "mcp", "--surface", "mujoco.world", "--param", "stage=lab"]}

JSON-RPC 2.0, one message per line (the MCP stdio transport). Implemented methods: initialize, ping, tools/list, tools/call (results as text content with the tool's JSON, plus PNG image content for images; a tool error is a result with isError true), and the initialized notification. Every call is appended to --log (JSON lines) when given. Standard library only, besides the surface itself.

PROTOCOL module-attribute

PROTOCOL = '2025-06-18'

MCPServer

MCPServer(surface: Surface, name: str = 'hylo', log: str | None = None)

handle

handle(msg: dict[str, Any]) -> dict[str, Any] | None

serve

serve(rd: TextIO = sys.stdin, wr: TextIO = sys.stdout) -> None

main

main(argv: Sequence[str] | None = None) -> int

serve a tool surface (e.g. mujoco.world) over MCP on stdio