MCAP

MCAP (pronounced "em-cap") is an open-source, serialization-agnostic container file format for storing timestamped, heterogeneous, multimodal data in a single file. Built for pub/sub and robotics, it is the default recording format for ROS 2 and is widely used to log synchronized sensor streams.

What is MCAP?

MCAP is a container format, which means it does not care how the individual messages inside it are encoded. It can hold data serialized as ROS 1, ROS 2, Protobuf, JSON, FlatBuffers, and more, and it can bundle many different streams, camera video, LiDAR point clouds, proprioceptive state, transforms, and their metadata, all in one self-contained file. It was developed by Foxglove to end the proliferation of custom, incompatible logging formats across robotics teams, and it has since become the default storage format for ROS 2 bag recording. Because each file embeds all the message definitions (like JSON Schema or Protobuf schemas) it needs, an MCAP file can be read by third-party tools without the original robot software stack.

Key takeaways

  • MCAP is a serialization-agnostic container: it stores messages regardless of how they were encoded, and can hold many heterogeneous streams in one file.
  • It is optimized for high-performance, append-only writing and for fast indexed reading by topic and timestamp.
  • It is the default bag format for ROS 2 and is self-contained, so files stay usable outside the original robot environment.

What MCAP provides

The properties that make MCAP a practical logging format for robotics.
The properties that make MCAP a practical logging format for robotics.
FeatureWhat it means
Serialization-agnosticStores ROS 1, ROS 2, Protobuf, JSON, FlatBuffers, and other encodings
Append-only writingData streams straight to disk or network without seeking backward
Indexed readingReaders pull a given topic and time range without scanning the whole file
Self-containedEmbeds message definitions, so files are readable without the original stack
Optional compressionChunks can be compressed with LZ4 or Zstd to trade speed against size

How it works

An MCAP file is organized into chunks of messages written in roughly the order they were recorded, along with schema and channel records that describe each stream, and index records that enable fast seeking. Writers can compress chunks with LZ4 or Zstd and write message and chunk indexes so that a reader can jump directly to the messages it wants. Foxglove maintains official reader and writer libraries in C++, Python, Go, Rust, Swift, and TypeScript.

Why it matters

Robot data is multimodal and sequential, and for years teams stored it in bespoke formats that did not travel between tools or organizations. MCAP matters because it gives that data a common, self-describing home: synchronized sensor streams in one indexed file that many tools can open. As it becomes the default for ROS 2, it is increasingly the format robot logs actually arrive in, making it a practical starting point for anyone working with real-world robot data at scale.

Frequently asked questions

What is MCAP used for?

Recording and storing timestamped, multimodal robot data, such as synchronized camera, LiDAR, and robot state streams, in a single self-contained file.

Is MCAP tied to ROS?

No. MCAP is serialization-agnostic and works outside ROS, though it is also the default bag format for ROS 2 and fully supports ROS data.

How is MCAP different from a ROS bag?

MCAP is a modern, serialization-agnostic successor to older ROS bag formats (replacing SQLite3 as the default in ROS 2). It is not limited to ROS message types and is now the default storage format that ROS 2 bag recording writes.

Related terms

Episode, RLDS, LeRobot, Teleoperation, Proprioception.
Last updated July 7, 2026

Building visual or physical AI?

Let's talk.