With using the cli, you can use a config file to configure mcap.
ros2 bag record -s mcap --storage-config-file …
I want to change the MCAP storage options like compression, chunksize and so on with the rosbag2 API either python or c++
How can I do this with the API if I want to write to a bag from my node directly? Are there any good tutorials similar to this? Recording a bag from a node (Python) — ROS 2 Documentation: Humble documentation
Not sure if this is helpful, but the nml_bag package has an example (also as .py) that sets storage options and writes a bag programmatically in Python.