Ephemeral Workers
The most critical security feature of the Linux MCP Daemon is its Ephemeral Worker architecture.
When an AI requests a tool execution, the Master daemon never executes that logic itself. The Master daemon runs as root so it can orchestrate network connections and spawn processes, but running AI-generated paths directly in the root process could lead to devastating Path Traversal vulnerabilities.
How it works
- The Master daemon receives an MCP
tools/callJSON-RPC message. - It authenticates the user via their Bearer token.
- Instead of running the tool, the Master uses
os/execto spawn a new instance of itself (./mcpd worker <tool> <json>). - Critically, it attaches a
syscall.Credentialto theCmd.SysProcAttrobject containing the exact UID and GID of the authenticated user. - The operating system drops all privileges and starts the worker process securely.
- The worker executes the tool, prints the result to
stdout, and immediately dies. - The Master captures the stdout via an
io.Pipeand sends it back to the AI.
This guarantees that the AI can only ever access files that the human user actually has permission to access on the host operating system!