Decoders
The server uses a pluggable decoder system to support any MCAP message encoding. Decoders are resolved at load time by matching the channel’s (message_encoding, schema_encoding) pair.
Supported encodings
Encoding |
Schema encoding |
Install extra |
Decoder |
|---|---|---|---|
|
|
(built-in) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Install all decoders with pip install mcap-mcp-server[all].
Decoder protocol
Every decoder implements three methods:
Method |
Purpose |
|---|---|
|
Returns |
|
Decodes raw message bytes into a flat |
|
Extracts field names and DuckDB types from the schema definition |
Type mapping
Fields are mapped to DuckDB column types based on the source schema. JSON fields use JSON Schema types; binary encodings use native type information.
Source type |
DuckDB type |
|---|---|
bool |
BOOLEAN |
int8 |
TINYINT |
uint8 / byte / char |
UTINYINT |
int16 |
SMALLINT |
uint16 |
USMALLINT |
int32 / int |
INTEGER |
uint32 |
UINTEGER |
int64 / long |
BIGINT |
uint64 |
UBIGINT |
float / float32 |
FLOAT |
double / float64 |
DOUBLE |
string |
VARCHAR |
bytes |
BLOB |
time / duration |
BIGINT |
array / repeated |
VARCHAR (JSON-serialized) |
nested message |
Flattened with |
Discovery
At startup, the DecoderRegistry:
Registers the built-in
JsonDecoderAttempts to import each optional decoder (Protobuf, ROS1, ROS2, FlatBuffer) and registers those whose dependencies are installed
Loads any third-party decoders registered via the
mcap_mcp_server.decodersentry-point group
Custom decoders
Third-party packages can register decoders via entry points in their pyproject.toml:
[project.entry-points."mcap_mcp_server.decoders"]
my_encoding = "my_package:MyDecoder"
The class must implement the MessageDecoder protocol defined in decoders/base.py.