You can add a hook to your Claude Code settings to find and stop Docker containers. But it's risky since it might stop containers being used by another CC session.
Another option is to manually clean up Docker containers periodically, for instance by searching for all containers using a particular image:
docker ps --filter ancestor=crystaldba/postgres-mcp