mcp_pool
mcp_pool
¶
Shared MCP server pool manager for the conductor.
The conductor manages a pool of MCP server processes as shared infrastructure. One process per MCP server type, shared across all agents. Each server is started as a subprocess and tracked for health. Agents access servers via Unix sockets (bind-mounted into sandboxes).
Lifecycle:
- start_all() — starts all configured servers on daemon startup
- stop_all() — terminates all servers on daemon shutdown
- health_check(name) — verifies a server process is alive
- get_socket_path(name) — returns the socket path for agent access
The manager does NOT handle stdio-to-socket proxying — that is a future enhancement. Currently it manages process lifecycle only, and the socket path is stored for reference by the technique router.
Classes¶
McpServerState
¶
Bases: str, Enum
State of a managed MCP server process.
McpPoolManager
¶
Manages MCP server process lifecycle for the conductor.
Reads McpPoolConfig and starts/stops server processes. Tracks state per server and provides socket path lookups for agent sandboxes.
Usage::
manager = McpPoolManager(config.mcp_pool)
await manager.start_all()
# During operation
if await manager.health_check("github"):
path = manager.get_socket_path("github")
# Bind-mount path into agent sandbox
# On shutdown
await manager.stop_all()
Source code in src/marianne/daemon/mcp_pool.py
Functions¶
server_names
¶
is_running
¶
Check if a server is currently running.
get_status
¶
get_socket_path
¶
Get the Unix socket path for a server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Server name. |
required |
Returns:
| Type | Description |
|---|---|
Path | None
|
Path to the Unix socket, or None if the server is not configured. |
Source code in src/marianne/daemon/mcp_pool.py
get_all_socket_paths
¶
Get socket paths for all configured servers.
start_all
async
¶
Start all configured MCP server processes.
Each server is started as an asyncio subprocess. Failures are logged and the server is marked as FAILED — other servers still start.
Source code in src/marianne/daemon/mcp_pool.py
stop_all
async
¶
Stop all running MCP server processes.
Sends SIGTERM and waits up to _STOP_TIMEOUT_SECONDS for each process. Already-exited processes are handled gracefully.
Source code in src/marianne/daemon/mcp_pool.py
health_check
async
¶
Check if a server process is alive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Server name. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the server process is running, False otherwise. |