Bagel
MCP server for chatting with physical-world data from robotics, drones, automotive, and IoT sources using natural language. It generates auditable SQL queries over Apache Arrow/DuckDB to let you analyze, summarize, and build data pipelines.
README
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./doc/assets/bagel_logo_dark_mode.png"> <img src="./doc/assets/bagel_logo_light_mode.png" width="400"> </picture> </p>
<h1 align="center"> <a href="https://github.com/Extelligence-ai/bagel/blob/main/LICENSE"> <img src="https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square"> </a> <a> <img src="https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square"> </a> <a href="https://github.com/Extelligence-ai/bagel/actions/workflows/publish.yaml"> <img src="https://img.shields.io/github/actions/workflow/status/Extelligence-ai/bagel/publish.yaml?branch=main&label=publish&style=flat-square"> </a> <a href="https://discord.gg/QJDwuDGJsH"> <img src="https://img.shields.io/discord/1392632504908906506?label=Discord&style=flat-square"> </a> </h1>
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./doc/assets/hero_dark_mode.png"> <img src="./doc/assets/hero_light_mode.png" width="100%"> </picture> </p>
Unlike cat videos, most data are trapped in the physical world. Bagel unlocks them and lets you chat with your physical dataβjust like you do with ChatGPT. For example:
Is my IMU sensor overheating?
Canβt wait to try it out? π Check out the Quickstart.
π₯― Key Features
- Ask in plain language: No deep domain expertise needed.
- Transparent calculations: Deterministic SQL queries. No black-box LLM math.
- Natural-language pipelines: "Keep 10s around every hard brake, drop the rest" β one sentence becomes an auditable pipeline: previewed before a byte is written, then run once, across a fleet, or standing at the edge.
- Broad LLM support: Claude Code, Gemini, Cursor, Codex, and more.
- Dockerized environments: No local dependencies required.
- Extensible capabilities: Bagel can learn new tricks.
- Wide format coverage: Missing your data format? Open a ticket.
β Supported Data Formats
| Industry | Formats |
|---|---|
| Robotics | ROS1, ROS2, MCAP (any profile), ROS text logs (~/.ros/log) |
| Drones | PX4, ArduPilot, Betaflight |
| Automotive | ASAM MDF4 (.mf4), CAN captures (.blf/.asc + DBC) β beta |
| IoT | MQTT (live, Sparkplug B), PostgreSQL / TimescaleDB, InfluxDB 3 |
π Bagel vs. the Tools You Already Use
You already have ros2 *, PlotJuggler, and grep. Bagel doesn't replace them β it
answers the questions they make you work for, then hands off to them:
| You do this today | Ask Bagel instead |
|---|---|
ros2 bag info for metadata |
"Summarize this bag" β same prompt works on PX4, ArduPilot, MCAP, MQTT, Postgres |
ros2 topic echo /imu and eyeball raw values |
"What's the peak z-deceleration in /imu? Running average over 5 s?" β real SQL underneath: peaks, running averages, percentiles, cross-topic correlations |
| Scrub PlotJuggler timelines hunting for the event | "Find every deceleration under β10 m/sΒ² and cut Β±30 s snippets" β then open the result in PlotJuggler with a pre-framed layout |
rqt_console, or grep ~/.ros/log |
"Read the ERRORs from ~/.ros/log and tell me what went wrong" β tracebacks included, no bag needed |
| Echo two topics in two terminals, correlate in a spreadsheet | "What's the correlation between current and voltage?" β topics live in one SQL relation, so joins and corr() are one question |
ros2 bag record -a and babysit the disk |
A standing edge pipeline: record continuously, keep only event windows, drop the rest |
| A bash loop over 200 bags | "Run this pipeline on every bag in the folder" β one pipeline, whole fleet, with a combined report |
scp/aws s3 sync scripts to ship data off the robot |
Upload to S3, GCS, or Azure as a pipeline step, checksum-skipping files already there |
| A different viewer per format: FlightPlot for PX4, MAVExplorer for ArduPilot, Blackbox Explorer for Betaflight | The same conversation for all of them β and ROS, MCAP, MQTT, Postgres, InfluxDB |
| Write a one-off pandas script per question | Ask the question; Bagel writes and runs the query |
One sentence of plain language, one answer β instead of a pipeline of commands and a script you'll delete tomorrow. Here's a sentence becoming a data pipeline that reduces a bag around detected events:
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./doc/assets/nl_reduction_dark_mode.gif"> <img src="./doc/assets/nl_reduction_light_mode.gif" width="80%"> </picture> </p>
π¬ What Can I Prompt?
You can ask Bagel almost anything. For example:
Whatβs the correlation between current and voltage in the
/spot/status/battery_statestopic?
I think the robot hit a pothole. Can you check for sudden deceleration on the z-axis to confirm?
Can you help me tune the PID of my drone?
Time to put Bagel to the test: can it catch a drone doing barrel rolls? Spoiler: π It totally can.
<p align="center"> <picture> <img src="./doc/assets/drone_rolls.gif" width="80%"> </picture> </p>
π‘ How Bagel Works
When you ask a question, Bagel analyzes your data sourceβs metadata and topics to build a high-level understanding.
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./doc/assets/high_level_dark_mode.png"> <img src="./doc/assets/high_level_light_mode.png" width="80%"> </picture> </p>
Based on your prompt, if further inspection is needed, Bagel identifies the most relevant topics and interprets their meaning and structure. Bagel then writes the relevant topic messages to an Apache Arrow file and uses DuckDB to generate and execute queries against it.
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./doc/assets/llm_math_dark_mode.png"> <img src="./doc/assets/llm_math_light_mode.png" width="80%"> </picture> </p>
This process is repeated as needed, running new queries until Bagel finds the best answer to your question.
LLMs excel at language but struggle with math. Bagel overcomes this by generating deterministic DuckDB SQL queries. These queries are displayed for you to audit, and you can guide Bagel to correct any errors.
β‘οΈ Quickstart
Three commands. Thatβs it.
[!TIP] Already have Claude Code? Just paste the link to this repo and tell Claude what environment you want:
Set up https://github.com/Extelligence-ai/bagel for ROS2 Kilted.
Claude will clone the repo, start Docker, and wire up the MCP connection for you.
π Prerequisites
Install Docker Desktop and Claude Code (or another MCP-enabled LLM).
1. Clone and start Bagel
git clone https://github.com/Extelligence-ai/bagel.git && cd bagel
docker compose run --service-ports ros2-kilted
Pick the service that matches your environment:
| Service | Use case |
|---|---|
ros2-kilted |
ROS2 Kilted (latest) |
ros2-jazzy |
ROS2 Jazzy |
ros2-iron |
ROS2 Iron |
ros2-humble |
ROS2 Humble |
ros1-noetic |
ROS1 Noetic |
ros1-noetic-cv |
ROS1 Noetic + CV |
px4 |
PX4 flight logs |
ardupilot |
ArduPilot flight logs |
betaflight |
Betaflight flight logs |
iot |
IoT / MQTT (live) |
[!TIP] To give Bagel access to your local files, edit
compose.yamlbefore starting Docker: uncomment and update thevolumessection under your chosen service.
Wait for this output:
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
2. Connect Claude Code
In a new terminal:
claude mcp add --transport sse bagel http://0.0.0.0:8000/sse
3. Prompt
claude
Summarize the metadata of the ROS2 bag "./data/sample/ros2/mcap".
Thatβs it β youβre chatting with your data.
π Prefer fully offline?
Swap step 2 for a local model β your data and your LLM stay on the machine:
brew install ollama && ollama serve & # or ollama.com
ollama pull qwen3:8b
uvx ollmcp --mcp-server-url http://localhost:8000/sse --model qwen3:8b
Model picks, expectations, and troubleshooting: Local LLMs guide.
<details> <summary>π Using a different LLM?</summary>
Bagel works with any MCP-enabled LLM. Setup runbooks for tested alternatives:
- Claude Code (detailed guide)
- Gemini CLI
- Codex
- Cursor
- Copilot
Canβt find your LLM? Open a ticket.
</details>
π Claude Code plugin
Bagel ships a Claude Code plugin: four skills that teach Claude when and how to drive the server (log triage, pipeline authoring, live sinks, visualization export) plus the MCP connection, wired automatically.
/plugin marketplace add Extelligence-ai/bagel
/plugin install bagel@bagel
Then start the container for your data format (see Quickstart): the plugin
connects to http://localhost:8000/sse by default. Any other MCP client can
discover the same workflows server-side via the list_agent_capabilities tool.
πΆ Teach Bagel a New Trick
Bagel learns new capabilities through POML filesβa structured set of instructions that describe a βtrick,β such as computing latency statistics.
βοΈ Create a .poml file
For example, letβs define ./src/agent/examples/woof.poml.
<poml>
<task>
Count the topics in the data source.
If the count is odd, say "woof", else say "meow".
</task>
<output-format>
Return the sound, the topic count, and a few cute emojis. Nothing else.
</output-format>
</poml>
π£οΈ Use the capability
Prompt Bagel:
Run the POML capability "./src/agent/examples/woof.poml" on the ROS2 bag "./data/sample/ros2/mcap".
Result:
meow π± 4 topics π±π€π―
π Guides
- Natural-language pipelines β the model: a cadence, gates, and tasks; preview β run β save β batch β standing at the edge
- Event-driven data reduction β detect events, keep windows around them (snippets or one reduced bag), batch across fleets, upload to the cloud
- Live ROS2 robots over rosbridge β a step-by-step tutorial
- ROS text logs β inspect
~/.ros/logerrors and warnings without opening a bag - MQTT β live IoT topics, Sparkplug B, edge recording
- PostgreSQL / TimescaleDB β every table is a topic
- InfluxDB 3 β every measurement is a topic
- Automotive MDF4 & CAN (beta) β channel groups and DBC messages are topics; units ride along
- Local LLMs β fully offline with Ollama: your data and your model never leave the machine
π¦ Integrations
- Rerun β "show me that event in Rerun": any time window as a ready-to-open recording
- Lichtblick / Foxglove β event windows as MCAP + pre-framed layouts for either viewer
- PlotJuggler β open Bagel's MCAP outputs directly; one-sentence pre-framed sessions, flattened CSV/Parquet exports
- Cloudini β Decode cloudini-compressed pointcloud data in pipelines
- Slack β pipelines post to your ops channel when they fire: "π¨ hard brake on {asset}"
- LeRobot (beta) β detected events become training episodes: a LeRobotDataset v3.0
π«Ά Contributing
Weβd love your help! The easiest way to support the project is by giving it a β on GitHub.
Other great ways to contribute:
- Request new features
- Report bugs
- Improve documentation
- Add new capabilities
Before contributing, please review the guidelines.
Join the conversation in our Discord server β we hang out there regularly.
π License
Bagel is open source under the Apache License 2.0.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.