Skip to main content

Module bridge

Module bridge 

Source
Expand description

The MCP stdio transport, wired straight into a world.

Serving the protocol blocks and runs on a thread of its own; the commands it receives are posted through a channel and drained by an event-loop behaviour, so a world โ€” which is not sendable โ€” is only ever touched on its own thread.

Re-exportsยง

use std::sync::Arc; ๐Ÿ”’
use std::sync::Mutex; ๐Ÿ”’
use async_channel::Receiver; ๐Ÿ”’
use async_channel::unbounded; ๐Ÿ”’
use unlit_ecs::mcp::McpCommand; ๐Ÿ”’
use unlit_ecs::mcp::WorldEntry; ๐Ÿ”’
use unlit_ecs::mcp::WorldId; ๐Ÿ”’
use unlit_ecs::sync; ๐Ÿ”’
use unlit_ecs::Bundle; ๐Ÿ”’
use unlit_ecs::Command; ๐Ÿ”’
use unlit_ecs::DynamicBundle; ๐Ÿ”’
use unlit_ecs::Entity; ๐Ÿ”’
use unlit_ecs::EntityAccessError; ๐Ÿ”’
use unlit_ecs::World; ๐Ÿ”’
use unlit_ecs::bundle; ๐Ÿ”’
use unlit3d::winit::event::OnAboutToWait; ๐Ÿ”’
use crate::world::WorldName; ๐Ÿ”’
use crate::world::WorldSender; ๐Ÿ”’
use crate::world::drain_all_stepped_worlds; ๐Ÿ”’

Structsยง

McpInbox ๐Ÿ”’
The commands the transport thread has posted for the host to run.
RunInHost ๐Ÿ”’
Run an MCP command against the host world itself.
RunInWorld ๐Ÿ”’
Run an MCP command against the world one entity carries.

Functionsยง

dispatch_command ๐Ÿ”’
Run one MCP command against the world it names.
drain ๐Ÿ”’
Drain the commands the transport posted.
drain_mcp ๐Ÿ”’
The event-loop behaviour that runs the commands the transport posted.
pump_mcp
Run one MCP turn without a window event loop.
reachable_worlds ๐Ÿ”’
Every world a tool can name through the host, with its name.
serve_mcp
Serve the MCP stdio transport against world.