Dcp

Device Context Protocol — bridge LLM agents to physical devices. Sub-50-byte frames, 27.6KB flash / 0.6KB RAM measured on ESP32, capability-scoped and safe by design. Complementary to MCP. Paper: arXiv:2605.26159

Internet of Things (IoT)PythonMIT

Abstract

Dcp is an open-source Internet of Things (IoT) project. Device Context Protocol — bridge LLM agents to physical devices. Sub-50-byte frames, 27.6KB flash / 0.6KB RAM measured on ESP32, capability-scoped and safe by design. Complementary to MCP. Paper: arXiv:2605.26159. A reference Bridge translates DCP ↔ MCP, so any MCP-compatible LLM works out of the box. DCP is the last mile to physical hardware. It is built using Python, Arduino, ESP32. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building an Internet of Things (IoT) mini project or final-year project.

1. Introduction

A reference Bridge translates DCP ↔ MCP, so any MCP-compatible LLM works out of the box. DCP is the last mile to physical hardware.

hallucinated or adversarial calls are stopped before any byte reaches a device. DCP catches all six categories at the wire layer; the others catch what their existing schema happens to cover.

MCP is excellent for SaaS tools, but assumes JSON-RPC over WebSocket and runtime tool discovery. On an MCU with 32 KB of RAM, that's a non-starter.

2. Objective

Device Context Protocol — bridge LLM agents to physical devices. Sub-50-byte frames, 27.6KB flash / 0.6KB RAM measured on ESP32, capability-scoped and safe by design. Complementary to MCP. Paper: arXiv:2605.26159

This project demonstrates how Python, Arduino, ESP32 can be applied to a real-world Internet of Things (IoT) problem.

4. Technology Stack

PythonArduinoESP32
  • 13/13 round-trip tests pass on each board (tools/test_uart_roundtrip.py)
  • 88/88 Python unit & conformance tests pass
  • Full lamp firmware: 295 KB flash, 22.7 KB globals on WROOM-32 — most
  • The DCP layer itself measures 27.6 KB of flash and 0.6 KB of RAM
  • The S3 run also exercises DCP over a native-USB CDC link rather

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later
  • pip / virtualenv for dependencies
  • VS Code, PyCharm or Jupyter Notebook
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/device-context-protocol/dcp.git
cd dcp
# As a user — install from PyPI:
pip install "pydcp[mcp,serial]"            # or [mcp,serial,mqtt,ble] for all transports
dcp inspect examples/lamp_manifest.yaml    # parsed manifest summary
dcp serve   examples/lamp_manifest.yaml --simulator
# As a contributor — editable install from source:
git clone https://github.com/device-context-protocol/dcp.git
cd dcp
pip install -e ".[mcp,serial,mqtt,ble,dev]"
pytest                                     # all 88 tests
python examples/lamp_demo.py               # in-process bridge ↔ fake lamp

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Add a mobile dashboard using Blynk or Firebase
  • Store readings in a cloud database for history charts
  • Add alerts via SMS / Telegram when thresholds are crossed

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. Which microcontroller / board and sensors are used and why?
  2. How does the device send data (Wi-Fi, MQTT, HTTP, Bluetooth)?
  3. Where is the sensor data stored and visualised?
  4. How is power consumption managed?
  5. How would you secure the device and its communication?

9. Source Code & License

This project is developed by device-context-protocol and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on an Internet of Things (IoT) project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Internet of Things (IoT) Internship