I think we can use both: https://docs.mitmproxy.org/stable/addons-scripting/
For mocking, and dump/replay for debugging for some of our projects.
https://docs.mitmproxy.org/stable/tute-clientreplay/