M16 follow-up: MCP for agent blocks in a VM (host-side relay) #59

Closed
opened 2026-10-02 11:19:30 +00:00 by jhgaylor · 1 comment
Owner

Found during #55 (M16, #5).

M16 gives every local agent block illogical's MCP server, scoped to its tab (http on loopback with a per-block token, or illogical mcp on stdio). Agent blocks running in a wisp VM don't get it yet: a guest can't reach any host address (S14), so PLAN.md's M16 section plans a host-opened relay:

  • the daemon opens a non-TTY exec in the VM running a small relay on a guest Unix socket (python3, as S14's vm.sh relay);
  • it pipes that exec into its MCP server (rmcp over the exec's stdin/stdout) under the block's token (McpServer's fallback caller is there for this);
  • the agent's mcpServers gets a stdio entry connecting to the socket (nc -U, or illogical mcp --socket if the binary is in the image);
  • the relay has to accept again when the agent restarts its MCP client, which means one MCP session per connection (frame connections, or open a new exec per connection).

Fountain agents can't reach the tailnet and stay without it (by design).

Code: crates/daemon/src/agent/mod.rs (Inner::servers), crates/daemon/src/mcp/mod.rs.

Found during #55 (M16, #5). M16 gives every local agent block illogical's MCP server, scoped to its tab (http on loopback with a per-block token, or `illogical mcp` on stdio). Agent blocks running in a wisp VM don't get it yet: a guest can't reach any host address (S14), so PLAN.md's M16 section plans a host-opened relay: - the daemon opens a non-TTY exec in the VM running a small relay on a guest Unix socket (python3, as S14's `vm.sh relay`); - it pipes that exec into its MCP server (rmcp over the exec's stdin/stdout) under the block's token (`McpServer`'s fallback caller is there for this); - the agent's `mcpServers` gets a stdio entry connecting to the socket (`nc -U`, or `illogical mcp --socket` if the binary is in the image); - the relay has to accept again when the agent restarts its MCP client, which means one MCP session per connection (frame connections, or open a new exec per connection). Fountain agents can't reach the tailnet and stay without it (by design). Code: `crates/daemon/src/agent/mod.rs` (`Inner::servers`), `crates/daemon/src/mcp/mod.rs`.
Author
Owner

Done: merged into main. The daemon opens a relay exec into the VM for each VM agent block. A python3 relay there listens on a Unix socket, and each connection becomes its own tab-scoped MCP session on the host. No token goes into the VM. The agent's mcpServers entry is a python3 stdio client that reconnects after daemon restarts. The relay waits for the machine to exist, which fixed CI's race. A VM agent's first run/start_agent makes its machine the tab's machine. Test: an_agent_block_in_a_vm_gets_mcp_through_the_relay (wisp-gated), plus unit tests for the relay. CI green on both runners (712, 713). PLAN.md: "M16 follow-up: agent blocks in a VM (#59)".

Done: merged into main. The daemon opens a relay exec into the VM for each VM agent block. A python3 relay there listens on a Unix socket, and each connection becomes its own tab-scoped MCP session on the host. No token goes into the VM. The agent's mcpServers entry is a python3 stdio client that reconnects after daemon restarts. The relay waits for the machine to exist, which fixed CI's race. A VM agent's first run/start_agent makes its machine the tab's machine. Test: an_agent_block_in_a_vm_gets_mcp_through_the_relay (wisp-gated), plus unit tests for the relay. CI green on both runners (712, 713). PLAN.md: "M16 follow-up: agent blocks in a VM (#59)".
jhgaylor referenced this issue from a commit 2026-10-02 15:54:55 +00:00
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jhgaylor/illogical#59
No description provided.