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.
- RunIn
Host ๐ - Run an MCP command against the host world itself.
- RunIn
World ๐ - 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.