DC

device-context-protocol/dcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

62 stars 3 forks 质量 74 趋势 17MIT

设备上下文协议——桥接LLM代理到物理设备。小于50字节的帧,27.6KB闪存/0.6KB内存,ESP32测量,设计上具能力范围且安全。补充MCP。

概览

草案 v0.3 — 2026年5月 ·硬件验证,ESP32-WROOM-32 该协议允许LLM代理安全控制物理设备,甚至包括一美元级微控制器。意图级、传输无关、能力范围。紧凑的线缆格式(帧小于50字节)。自包含固件:内存不足1KB,闪存~28 KB。作为MCP的补充——参考桥接器将DCP ↔ MCP转换成任何MCP主机(Claude Desktop、Claude Code、IDE助手)都能零配置运行。 MCP 非常适合 SaaS 工具,但假设 JSON-RPC 而非 WebSocket 和运行时工具发现。在 32 KB 内存的 MCU 上,这根本行不通。 DCP保留了MCP的心理模型(manifest + tool 调用),但: - 编译为紧凑的CBOR线格式 - 使用静态意图表(无运行时协商) - 将安全执行转移到桥接进程 参考桥接器会转换 ,因此任何兼容MCP的LLM开箱即用。DCP是物理硬件的最后一公里。

概述(AI 翻译)

状态: 草案v0.3 — 2026年5月 ·硬件验证已通过ESP32-WROOM-32

一种允许LLM代理安全控制物理设备的协议, 到一美元级的微控制器。

意图层级、传输无关、能力范围范围。紧凑线缆格式 (小于50字节的帧)。自包含固件:内存容量低于1 KB, ~28 KB 的闪存。

MCP的补充——参考文献 Bridge会将DCP ↔ MCP转换成任意MCP主机(Claude Desktop、Claude Code, IDE 助手)零配置工作。

目录

  • 为什么是DCP?
  • 设计原则
  • 建筑学
  • 快速启动
  • 5步添加功能
  • 配方 — 五个即刻闪现的设备骨架
  • 线式格式 ·全套 SPEC.md
  • 清单
  • 路线图
  • 设计理由: docs/RATIONALE.md — 为什么 不是MCP对MCU,为什么不是《时光之轮》,为什么不是Matter。

为什么是DCP?

MCP非常适合SaaS工具,但假设使用JSON-RPC而非WebSocket和运行时 工具发现。在一个拥有32 KB内存的MCU上,这根本不可能。

DCP保留了MCP的心理模型(manifest + tool 调用),但:

  • 编译为紧凑的CBOR线格式
  • 使用静态意图表(无运行时协商)
  • 将安全执法转为桥接流程

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

DCP — Device Context Protocol

Status: Draft v0.3 — May 2026 · Hardware-validated on ESP32-WROOM-32

A protocol that lets LLM agents safely control physical devices, down to dollar-class microcontrollers.

Intent-level, transport-agnostic, capability-scoped. Compact wire format (sub-50-byte frames). Self-contained firmware: under 1 KB of RAM, ~28 KB of flash.

Complementary to MCP — a reference Bridge translates DCP ↔ MCP so any MCP host (Claude Desktop, Claude Code, IDE assistants) works zero-config.

Contents

Why DCP?

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.

DCP keeps MCP’s mental model (manifest + tool calls) but:

  • compiles to a compact CBOR wire format
  • uses a static intent table (no runtime negotiation)
  • moves safety enforcement to a Bridge process

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

Why this matters in one chart: the protocol’s schema decides how many 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.

Design principles

  1. Intent, not register. set_brightness(50%), not write_pwm(pin=5, duty=128).
  2. Units in the protocol. Every number declares a unit. No ambiguity.
  3. Static intent table. Manifest known at compile time; runtime is pure binary.
  4. Safety lives in the Bridge. Devices trust the Bridge; LLMs never see raw GPIO.
  5. Idempotent by default. Non-idempotent intents must declare themselves.
  6. Transport-agnostic. UART, BLE, MQTT, USB-CDC, WebSocket — one frame.

Architecture

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "smart-lamp": { "command": "dcp", "args": [ "serve", "C:/path/to/protocol/examples/lamp_manifest.yaml", "--simulator" ] } } }