Context
Sub-issue of #568. Depends on #640 (MCP sandbox support). Future improvement over #640's "disable netns" approach.
Summary
Run MCP servers outside the sandbox and bridge communication via Unix sockets, providing full network isolation for the agent while MCP servers retain host network access.
Design
Architecture
Host Sandbox (Landlock + seccomp + cgroups + netns)
| |
MCP Server (jira) <--Unix socket--> Claude Code / Opencode
MCP Server (github) <--Unix socket--> (network namespace: loopback only)
| |
Host network No host network
How it works
- SODA starts MCP servers on the host side before launching the sandbox
- Each MCP server listens on a Unix socket in a temp directory
- The socket directory is added to the sandbox's read+write paths
- The
--mcp-config points to server entries with transport: "unix" socket paths
- Agent inside sandbox connects to MCP servers via the socket
- SODA manages MCP server lifecycle (start before phase, stop after)
Prerequisites
MCP server manager
New internal/mcp/ package:
type ServerManager struct {
servers map[string]*runningServer
}
func (m *ServerManager) Start(ctx context.Context, name string, cfg MCPServerConfig) (socketPath string, err error)
func (m *ServerManager) Stop(name string) error
func (m *ServerManager) StopAll()
func (m *ServerManager) HealthCheck(name string) error
Fallback
If Unix socket transport is not supported by the agent CLI, fall back to #640's approach (disable netns, run MCP inside sandbox). Log which mode is active.
Acceptance criteria
Estimated token budget
- Read: ~10K (sandbox, mcp protocol, go-arapuca)
- Write: ~15K (server manager, socket bridge, lifecycle, tests)
- Total: ~70K / 80K
Depends on
Context
Sub-issue of #568. Depends on #640 (MCP sandbox support). Future improvement over #640's "disable netns" approach.
Summary
Run MCP servers outside the sandbox and bridge communication via Unix sockets, providing full network isolation for the agent while MCP servers retain host network access.
Design
Architecture
How it works
--mcp-configpoints to server entries withtransport: "unix"socket pathsPrerequisites
NetworkProxySocketsupport (available since v0.3.0, feat(sandbox): enable network namespace isolation once go-arapuca implements socket bridge #340 closed)MCP server manager
New
internal/mcp/package:Fallback
If Unix socket transport is not supported by the agent CLI, fall back to #640's approach (disable netns, run MCP inside sandbox). Log which mode is active.
Acceptance criteria
internal/mcp/package with ServerManagerEstimated token budget
Depends on