Skip to content

Process management ​

MCP Server Fuzzer supervises local processes used by stdio transports and other runtime integrations. The runtime layer is asynchronous and separates process state, watchdog policy, and signal delivery so each concern can be tested independently.

Responsibilities ​

ComponentResponsibility
ProcessManagerStarts, stops, waits for, and tracks managed subprocesses.
ProcessRegistryOwns the current process records shared by the manager and watchdog.
ProcessWatchdogDetects stale activity and applies the configured termination policy.
SignalDispatcherDelivers graceful, force, and interrupt signals through the platform strategy.
ProcessConfigDescribes the command, environment, working directory, timeout, and activity callback.
WatchdogConfigSets check interval, timeout thresholds, buffering, and auto-kill behavior.

The AsyncFuzzExecutor is a separate concurrency primitive for fuzz operations. It is not a process supervisor and is documented only on its architecture page.

Runtime wiring ​

text
ProcessConfig
     |
ProcessManager ---- ProcessRegistry ---- ProcessWatchdog
     |                                      |
     +------------ SignalDispatcher --------+

Use ProcessManager.from_config(...) for the standard runtime wiring. Pass explicit dependencies to ProcessManager when tests or integrations need a custom registry, signal strategy, or watchdog policy.

Process lifecycle ​

StateMeaning
UnregisteredThe process is not tracked by the runtime registry.
RegisteredAn existing process has been added to the registry.
RunningThe manager launched the process and recorded its start.
StoppingA graceful or forced stop has been requested.
StoppedThe process exited or was terminated and its result was recorded.
ShutdownThe manager stopped all tracked processes and the watchdog.

Observers can consume manager events such as started, stopped, signal, stopped_all, and shutdown.

Configuration ​

ProcessConfig ​

FieldDefaultDescription
commandrequiredExecutable and arguments as a list.
cwdNoneWorking directory for the child process.
envNoneEnvironment mapping for the child process.
timeout30.0Process timeout in seconds.
auto_killTrueWhether the watchdog may terminate a stale process.
name"unknown"Human-readable name for logs and events.
activity_callbackNoneSync or async callback returning the latest activity timestamp.

WatchdogConfig ​

FieldDefaultDescription
check_interval1.0Seconds between watchdog checks.
process_timeout30.0Inactivity threshold before a process is considered stale.
extra_buffer5.0Grace period before termination.
max_hang_time60.0Maximum allowed hang time.
auto_killTrueWhether stale processes are terminated automatically.

The CLI exposes these settings as --watchdog-* options. See the CLI reference for defaults and the process management guide for operational choices.

Safety and platform behavior ​

Process management is not a security boundary by itself. Run local targets in a disposable workspace, use --fs-root and --no-network where appropriate, and apply the safety system before starting an untrusted stdio server.

Signal behavior is platform-specific: Unix uses signals such as SIGTERM, SIGINT, and SIGKILL; Windows uses the supported process-group and terminate operations. A graceful stop may be followed by a force stop when the configured maximum hang time is exceeded.

Public API pointers ​

The implementation lives under mcp_fuzzer.fuzz_engine.runtime. The focused guidance page covers startup, timeouts, activity updates, shutdown, and troubleshooting. The API reference should be read alongside the source and tests when building an integration.

Released under the MIT License.