有没有试过让ChatGPT控你桌上的LED小灯?要么得写几百行JSON适配,要么大模型瞎输出把硬件干烧——现在有个狠活:用0.6KB RAM就能让大模型安全控10块钱的ESP32,还能直接接Claude Desktop,连改功能都只要5步!虽然现在GitHub只有36星,但实测数据硬到离谱。

它一句话是什么 桥接LLM代理与物理硬件的轻量通信协议,专门补全MCP(模型上下文协议)在低成本单片机(MCU)上的适配短板,让大模型能安全、低资源消耗地控制实物硬件。

为什么值得看 1. 资源省到离谱:ESP32上仅占0.6KB RAM,比IoT-MCP的74KB RAM峰值省两个数量级,10块钱的ESP32就能跑; 2. 安全到离谱:协议层直接拦截6种大模型幻觉/恶意调用(比如超范围参数),不会烧硬件,还有dry-run模拟功能; 3. 兼容到离谱:自带DCP↔MCP桥,Claude Desktop、IDE助手等现有MCP工具零配置可用,还有arXiv论文背书(arXiv:2605.26159)。
最有意思的3个功能 1. 超轻量硬件兼容(实测有效) ESP32-WROOM-32上DCP层仅占27.6KB Flash、0.6KB RAM,连ESP8266这种老单片机都能编译运行;串口通信包仅19字节(同功能MCP要180字节),BLE、MQTT、USB都能传;13/13的串口往返测试通过,不是纸上谈兵。 2. 协议级防大模型“搞破坏” 所有调用必须过Bridge的能力校验(比如亮度范围0-100%、单位必须是百分比),大模型输出150%直接拦截;还有dry-run功能(先模拟执行不碰硬件);对比MCP、WoT、Matter,它能拦截6种幻觉/恶意调用,其他协议只能碰运气(有论文图表佐证)。 3. 零代码改桥接,5步加新功能 自带DCP↔MCP桥,改硬件功能只要5步:改manifest(比如加blink意图)、加C++ handler、重编译、刷固件、重启MCP服务器,不用改Bridge代码,大模型自动识别新工具(官方有完整的blink示例教程)。
可以怎么玩/怎么用
① 零硬件摸鱼玩(5分钟搞定)
复制以下命令直接跑模拟,连硬件都不用买:
# As a user — install from PyPI:pip install "pydcp[mcp,serial]" # or [mcp,serial,mqtt,ble] for all transportsdcp inspect examples/lamp_manifest.yaml #parsed manifest summarydcp serve examples/lamp_manifest.yaml --simulator
# As a contributor — editable install from source:git clone https://github.com/device-context-protocol/dcp.gitcd dcppip install -e ".[mcp,serial,mqtt,ble,dev]"pytest # all 88 testspython examples/lamp_demo.py # in-process bridge ↔ fake lamp
打开Claude Desktop,直接说「把客厅灯调到50%亮度,1000ms渐变」,就能看到模拟输出。
② 10块钱硬件复刻(动手党必玩)
- 淘宝10块钱买ESP32-WROOM-32,接LED到GPIO5;
- 刷官方examples里的lamp固件(还有5个现成的固件骨架,直接用);
- 用
dcp serve examples/lamp_manifest.yaml --serial /dev/ttyUSB0(Linux)或COM3(Windows)连接; - 直接让Claude控LED亮度、触发 motion 事件。
③ 进阶DIY(加传感器)
改manifest加read_temp意图,加DHT11的C++ handler,5步就能让大模型读温湿度数据,做个AI控的温湿度计。
适合谁 1. DIY硬件玩家:想给小硬件加AI控制,不想写复杂代码; 2. LLM Agent开发者:想把Agent和物理世界连接,不用搞复杂的IoT协议; 3. 教育从业者:用低成本硬件教AI+IoT结合的课程; 4. 怕大模型瞎搞硬件的强迫症玩家:需要严格的安全校验。
GitHub 地址 https://github.com/device-context-protocol/dcp
🔍 发现更多好玩的开源项目
专注于 Arduino、开源硬件与端侧 AI 技术分享

长按二维码关注「arduino」
Ever wanted ChatGPT to control the LED lights on your desk? Normally, you'd need to write hundreds of lines of JSON or risk the model hallucinating and burning out the hardware. But now, there's a game-changer: a 0.6KB RAM-based protocol that lets large models safely control ESP32 devices for just $10, and integrates directly with Claude Desktop. While it only has 36 stars on GitHub, the real-world data is impressive.

What is it? It's a lightweight communication protocol bridging LLM agents and physical hardware, specifically designed to fill the gap in MCP (Model Context Protocol) support for low-cost MCUs. It allows large models to control real hardware safely and with minimal resource consumption.

Why is it worth checking out? 1. It's insanely resource-efficient: uses only 0.6KB RAM on ESP32, a fraction of the 74KB required by IoT-MCP, making it affordable on $10 chips; 2. It's extremely safe: the protocol layer actively blocks 6 types of model hallucinations/malicious calls (like out-of-range parameters), preventing hardware damage, and includes a dry-run simulation feature; 3. It's widely compatible: comes with a built-in DCP↔MCP bridge, so existing MCP tools like Claude Desktop and IDE assistants can use it immediately, with backing from a refereed arXiv paper (arXiv:2605.26159).
Top 3 Cool Features 1. Ultra-lightweight hardware compatibility (proven effective): On ESP32-WROOM-32, the DCP layer takes only 27.6KB flash and 0.6KB RAM, even compatible with ancient ESP8266; serial packets are just 19 bytes (vs. MCP's 180 bytes), and it passed all 13/13 round-trip tests, proving it's not vaporware. 2. Protocol-level protection against model "sabotage": All calls must pass capability validation (e.g., brightness 0–100%, units must be percentage); attempt 150% and it gets blocked. Also includes a dry-run mode to test before hardware execution. Unlike MCP, WoT, or Matter, it explicitly blocks 6 known failure modes, not just hoping for the best. 3. Zero-code bridge upgrades: Adding new features requires only 5 steps — update the manifest (e.g., add blink intent), add C++ handler, recompile, flash, restart MCP server. No need to touch the bridge code, and the model auto-detects new tools. A full blink example is provided.
How to Use/Play with It
① Lazy Man's Simulation (5 mins): Copy-paste the following command to run a simulation without any hardware:
Tell Claude Desktop, "Set living room light to 50% brightness with a 1000ms fade," and watch the simulated output.
② DIY Hardware Clone (for tinkerers): Buy a $10 ESP32-WROOM-32, hook up an LED to GPIO 5, flash the official lamp firmware (or any of the 5 ready-made templates), connect via dcp serve examples/lamp_manifest.yaml --serial /dev/ttyUSB0 (Linux) or COM3 (Windows), and directly control the LED or trigger motion events.
③ Advanced Sensor Hacking: Modify the manifest to add a read_temp intent, add DHT11 C++ handler in 5 steps, and let the model read temperature/humidity — turning your ESP32 into an AI-controlled sensor logger.
Who's It For? 1. DIY hardware enthusiasts wanting AI control without complex coding; 2. LLM agent developers needing a reliable hardware interface; 3. Educators teaching AI+IoT on low-cost hardware; 4. People paranoid about models frying their gear — strict validation is key.
GitHub: https://github.com/device-context-protocol/dcp
🔍 Find more cool open-source projects
Follow "Arduino" for Arduino, open hardware, and edge AI updates!

Scan QR code to follow "arduino"
Who is it for? 1. DIY hardware enthusiasts: Want to add AI control to small devices without writing complex code; 2. LLM Agent developers: Want to connect Agents to the physical world, without dealing with complex IoT protocols; 3. Educators: Use low-cost hardware to teach AI+IoT integration courses; 4. OCD players afraid of models messing up hardware: Require strict safety verification.
GitHub 地址 https://github.com/device-context-protocol/dcp
🔍 Discover more fun open-source projects!
Focused on Arduino, open hardware, and edge AI technology sharing.

长按二维码关注「arduino」