kill_process
Terminate a running process by its ID using the Frida MCP server. Specify the process ID to stop execution and manage system resources.
Instructions
Kill a process by ID.
Returns:
Status information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | The ID of the process to kill. | |
| device_id | No | Optional ID of the device where the process is running. Uses smart selection when omitted. |
Implementation Reference
- src/frida_mcp/cli.py:416-436 (handler)The implementation of the kill_process tool handler. It is registered via the @mcp.tool() decorator. The function resolves the target device using _resolve_device_or_raise, calls the Frida device's kill method on the specified PID, and returns a success dict or raises a ValueError on failure. The Field annotations define the input schema.@mcp.tool() def kill_process( pid: int = Field(description="The ID of the process to kill."), device_id: Optional[str] = Field( default=None, description="Optional ID of the device where the process is running. Uses smart selection when omitted.", ), ) -> Dict[str, Any]: """Kill a process by ID. Returns: Status information """ try: device = _resolve_device_or_raise(device_id) device.kill(pid) return {"success": True, "pid": pid} except Exception as e: raise ValueError(f"Failed to kill process {pid}: {str(e)}")