utilities
POSIX-specific functionality for stdio client operations.
terminate_posix_process_tree
async
terminate_posix_process_tree(
process: Process, timeout_seconds: float = 2.0
) -> None
Terminate a process and all its children on POSIX systems.
Uses os.killpg() for atomic process group termination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
Process
|
The process to terminate |
required |
timeout_seconds
|
float
|
Timeout in seconds before force killing (default: 2.0) |
2.0
|
Source code in src/mcp/os/posix/utilities.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |