Skip to main content

Module spawn

Module spawn 

Source
Expand description

MCP server spawn validation policy hook.

The SDK owns the SpawnValidator trait + NoopSpawnValidator reference impl. Consumers (oxicode-cli, oxios) own the policy — i.e. which commands are safe to spawn, which environment variables must be stripped, and which paths are allowed.

See docs/oxicode-sdk-ownership.md §2 (MCP transport / MCP spawn validation policy split).

§Why a trait and not a config

Spawn validation involves multi-step logic (command parsing, shell-metachar scanning, env var whitelisting/blacklisting, path resolution) that varies per consumer. A trait lets each consumer express its own policy without the SDK prescribing a checklist. A NoopSpawnValidator is provided for the default case where no policy is needed (preserves existing behavior).

Structs§

NoopSpawnValidator
Default no-op validator — preserves current behavior (no validation, no env scrubbing). Use this when no consumer-supplied policy is registered.

Traits§

SpawnValidator
Validates MCP server spawn commands and environment.