Cotton Blog via Pycoders points out the easiest way to run a script under uvx:

Note the shebang line: #!/usr/bin/env -S uv run –script. It is important to specify uv run with the –script flag when used on the shebang line.