A generic SQL query interface for MCAP robotics data via the Model Context Protocol
Project description
mcap-mcp-server
Query your robot's MCAP recordings with SQL — straight from your LLM.
Point Claude, Cursor, or any MCP client at your bag files. Ask questions in plain English. Get SQL-powered answers from DuckDB. No scripts, no pipelines, no BS.
MCAP files → mcap-mcp-server → DuckDB (in-memory) → SQL results → LLM
Supports JSON, Protobuf, ROS 1, ROS 2, and FlatBuffers out of the box.
Install
Requires uv (the Python package runner). If you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | sh
That's it — uvx handles the rest. No pip install needed.
Manual install (optional):
pip install mcap-mcp-server[all]
Configure Your MCP Client
Copy-paste the config below. That's it — no API keys, no setup, no database.
Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"mcap-query": {
"command": "uvx",
"args": ["mcap-mcp-server[all]"]
}
}
}
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"mcap-query": {
"command": "uvx",
"args": ["mcap-mcp-server[all]"]
}
}
}
Windsurf / VS Code / Other MCP Clients
Same JSON — check your client's docs for where to put it.
Recordings outside the project? Set
MCAP_DATA_DIR=/path/to/recordingsas an env var, or just give the LLM an absolute path — it handles that too.
What Can It Do?
Once configured, just talk to your LLM. It has 6 tools:
| Tool | What it does |
|---|---|
list_recordings |
Find MCAP files in your project (or any path) |
get_recording_info |
Metadata, channels, attachments for a file |
get_schema |
SQL table names & column types — for query planning |
load_recording |
Decode MCAP data into DuckDB |
query |
Run SQL (full DuckDB — including ASOF JOIN) |
get_statistics |
Quick stats (min/max/mean/std) for numeric fields |
Example Prompts
Just ask your LLM:
- "List all my recordings and show me what topics are in session_003.mcap"
- "Load the battery data and find all moments where voltage dropped below 22V"
- "Correlate IMU acceleration with motor current using an ASOF JOIN"
- "Compare average battery voltage across my last 5 runs"
Example SQL (under the hood)
-- Time-windowed stats
SELECT (timestamp_us / 1000000) as second,
AVG(voltage) as avg_v, MIN(voltage) as min_v
FROM battery GROUP BY second ORDER BY second
-- Cross-sensor correlation via ASOF JOIN
SELECT b.timestamp_us, b.voltage, i.linear_acceleration_x
FROM battery b ASOF JOIN imu i ON b.timestamp_us >= i.timestamp_us
-- Multi-recording comparison
SELECT 'run1' as run, AVG(voltage) FROM r1_battery
UNION ALL
SELECT 'run2', AVG(voltage) FROM r2_battery
Supported Encodings
| Encoding | Install |
|---|---|
| JSON | Built-in |
| Protobuf | pip install mcap-mcp-server[protobuf] |
| ROS 1 | pip install mcap-mcp-server[ros1] |
| ROS 2 (CDR) | pip install mcap-mcp-server[ros2] |
| FlatBuffers | pip install mcap-mcp-server[flatbuffers] |
| All | pip install mcap-mcp-server[all] |
Configuration (Optional)
Defaults work for most setups. Tune if needed:
| Variable | Default | Description |
|---|---|---|
MCAP_DATA_DIR |
. |
Root directory to scan for MCAP files |
MCAP_RECURSIVE |
true |
Scan subdirectories |
MCAP_MAX_MEMORY_MB |
2048 |
Max memory for loaded data (LRU eviction) |
MCAP_QUERY_TIMEOUT_S |
30 |
SQL query timeout |
MCAP_DEFAULT_ROW_LIMIT |
1000 |
Default result row limit |
MCAP_MAX_ROW_LIMIT |
10000 |
Max allowed row limit |
MCAP_TRANSPORT |
stdio |
stdio or sse |
Docker
docker run -d \
-v /data/recordings:/data:ro \
-e MCAP_DATA_DIR=/data \
-e MCAP_TRANSPORT=sse \
-p 8080:8080 \
ghcr.io/turkenberg/mcap-mcp-server:latest
Development
git clone https://github.com/turkenberg/mcap_mcp_server.git
cd mcap_mcp_server
git submodule update --init
pip install -e ".[dev]"
pytest
License
GNU General Public License v3.0 — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcap_mcp_server-0.4.0.tar.gz.
File metadata
- Download URL: mcap_mcp_server-0.4.0.tar.gz
- Upload date:
- Size: 79.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f72ce13b124a27e15df90d0de50f3a430a7134ff3278d3ddc2d1bc803b2a1f45
|
|
| MD5 |
92a3dff3db668185d03fd51bafe25175
|
|
| BLAKE2b-256 |
512fb0945c991fb3e35019c3d583c806755e41b7df15da484bf961f0d81a7e97
|
Provenance
The following attestation bundles were made for mcap_mcp_server-0.4.0.tar.gz:
Publisher:
ci.yml on turkenberg/mcap_mcp_server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcap_mcp_server-0.4.0.tar.gz -
Subject digest:
f72ce13b124a27e15df90d0de50f3a430a7134ff3278d3ddc2d1bc803b2a1f45 - Sigstore transparency entry: 1030097445
- Sigstore integration time:
-
Permalink:
turkenberg/mcap_mcp_server@0a240b1ccf6d7a468cadcfb440abe05ce6302f94 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/turkenberg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0a240b1ccf6d7a468cadcfb440abe05ce6302f94 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcap_mcp_server-0.4.0-py3-none-any.whl.
File metadata
- Download URL: mcap_mcp_server-0.4.0-py3-none-any.whl
- Upload date:
- Size: 44.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b6d3c7c657c06c6c85f0bd0bd3f65a213fb34b53f9e3e9333622b4c78bde716
|
|
| MD5 |
916ee69744fceedffc2e81cbc39ed905
|
|
| BLAKE2b-256 |
7e491d713d67a55e2e5ff461720c5b211e7e33c66fb4b083918d8f6768f31e1d
|
Provenance
The following attestation bundles were made for mcap_mcp_server-0.4.0-py3-none-any.whl:
Publisher:
ci.yml on turkenberg/mcap_mcp_server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcap_mcp_server-0.4.0-py3-none-any.whl -
Subject digest:
6b6d3c7c657c06c6c85f0bd0bd3f65a213fb34b53f9e3e9333622b4c78bde716 - Sigstore transparency entry: 1030097458
- Sigstore integration time:
-
Permalink:
turkenberg/mcap_mcp_server@0a240b1ccf6d7a468cadcfb440abe05ce6302f94 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/turkenberg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0a240b1ccf6d7a468cadcfb440abe05ce6302f94 -
Trigger Event:
release
-
Statement type: