mcp_socket_bridge
mcp_socket_bridge
¶
Multiplexed Unix-socket bridge for stdio MCP servers.
The bridge owns one upstream stdio MCP server process and exposes a Unix socket for multiple MCP clients. Client request IDs are rewritten to bridge-unique upstream IDs, then restored on the way back to the originating client.
Classes¶
McpSocketBridge
¶
Expose one stdio MCP server process through a multiplexed Unix socket.
Source code in src/marianne/daemon/mcp_socket_bridge.py
Attributes¶
is_running
property
¶
Whether the upstream process, its reader and the socket server are all alive.
A live process whose stdout reader has stopped cannot answer anyone (GH #520): every forwarded request would wait forever. Such a bridge reports not running so the pool monitor restarts it under its policy.
Methods:¶
start
async
¶
Start the upstream process, initialize it, and bind the socket.
Source code in src/marianne/daemon/mcp_socket_bridge.py
stop
async
¶
Finish owned cleanup before propagating caller cancellation.