Device Context Protocol
Device Context Protocol — bridge LLM agents to physical devices. Sub-50-byte frames, <16KB MCU footprint, capability-scoped and safe by design. Complementary to MCP.
What is Device Context Protocol?
Device Context Protocol is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to device context protocol — bridge llm agents to physical devices. sub-50-byte frames, <16kb mcu footprint, capability-scoped and safe by design. complementary to mcp.
Device Context Protocol — bridge LLM agents to physical devices. Sub-50-byte frames, <16KB MCU footprint, capability-scoped and safe by design. Complementary to MCP.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Device Context Protocol — bridge LLM agents to physical devi
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx dcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Device Context Protocol
Device Context Protocol (DCP) is a lightweight protocol and Python MCP bridge that connects LLM agents to physical hardware — microcontrollers, IoT devices, and embedded systems — using sub-50-byte binary frames and a minimal (<16KB) MCU footprint. Device capabilities are declared in YAML manifests and automatically exposed as MCP tools that AI assistants can call, with capability-scoped tokens controlling what each agent is allowed to do. Embedded developers and IoT builders use it to let Claude or other AI agents control ESP32, Arduino, and similar hardware over Serial, MQTT, or BLE without writing custom server code.
Prerequisites
- Python 3.10+ and pip
- pydcp package (the PyPI name for DCP) with appropriate transport extras
- Target hardware: ESP32, Arduino, or compatible microcontroller flashed with DCP firmware
- An MCP-compatible client such as Claude Desktop or Claude Code
- A device manifest YAML file describing the hardware capabilities
Install pydcp with your required transports
Install the pydcp package from PyPI. Choose the extras matching your hardware connection: serial for USB/UART, mqtt for network-connected devices, ble for Bluetooth Low Energy. The mcp extra is always required.
# Basic install (serial + MCP bridge)
pip install "pydcp[mcp,serial]"
# All transports
pip install "pydcp[mcp,serial,mqtt,ble]"Create or obtain a device manifest
DCP devices are described by YAML manifests that declare capabilities (intents) with their parameters, types, and access modes. The project ships example manifests in the examples/ directory. You can also use the built-in simulator to test without hardware.
# Inspect an example manifest
dcp inspect examples/lamp_manifest.yaml
# Run with simulator (no hardware needed)
dcp serve examples/lamp_manifest.yaml --simulatorGenerate and mint capability tokens
DCP uses scoped capability tokens to control what an LLM agent can do. Generate a secret, then mint tokens with specific capability scopes and optional TTLs.
# Generate a secret (store this securely)
export DCP_SECRET=$(dcp token keygen)
# Mint a token with specific capabilities and 1-hour TTL
dcp token mint --caps lamp.write,lamp.read --ttl 3600Connect to your hardware and serve via MCP
Run dcp serve with the manifest and the appropriate transport flag. DCP translates between the MCP protocol and the compact DCP wire format, bridging your AI assistant to the physical device.
# Serial (USB) connection
dcp serve examples/lamp_manifest.yaml --serial /dev/ttyUSB0
# MQTT connection
dcp serve examples/lamp_manifest.yaml --mqtt broker.lan:1883 --mqtt-prefix dcp/lamp
# BLE connection
dcp serve examples/lamp_manifest.yaml --ble AA:BB:CC:DD:EE:FFAdd the DCP bridge to your MCP client configuration
Open claude_desktop_config.json and add a DCP server entry. Use --simulator for testing without hardware, then switch to --serial or --mqtt for production.
{
"mcpServers": {
"smart-lamp": {
"command": "dcp",
"args": ["serve", "/path/to/lamp_manifest.yaml", "--simulator"]
}
}
}Device Context Protocol Examples
Client configuration (simulator mode)
claude_desktop_config.json entry running DCP in simulator mode for testing without physical hardware. Replace with --serial, --mqtt, or --ble and the appropriate address for real hardware.
{
"mcpServers": {
"smart-lamp": {
"command": "dcp",
"args": ["serve", "/Users/yourname/dcp/examples/lamp_manifest.yaml", "--simulator"]
}
}
}Prompts to try
Example prompts for controlling a DCP-connected smart lamp device. Actual tool names depend on the intents defined in your manifest.
- "Set the lamp brightness to 75% with a 2-second fade"
- "Read the current brightness level of the lamp"
- "Turn the lamp off gradually over 5 seconds"
- "What capabilities does the connected device have?"
- "Set brightness to 100% immediately"Troubleshooting Device Context Protocol
dcp command not found after pip install
Ensure the Python scripts directory is on your PATH. On macOS/Linux: add `export PATH="$HOME/.local/bin:$PATH"` to your shell profile. On Windows: add the Python Scripts directory to the system PATH. Verify with `python -m dcp --version` as an alternative.
Serial connection fails with 'Permission denied' on Linux
Add your user to the dialout group to access serial ports: `sudo usermod -aG dialout $USER`. Log out and back in for the change to take effect. Verify port access with `ls -la /dev/ttyUSB0`.
Capability token validation errors when calling device intents
Ensure DCP_SECRET is set to the same value used when minting the token. Tokens are capability-scoped — if the tool calls lamp.write but the minted token only has lamp.read, access will be denied. Mint a new token with the required capability scope using `dcp token mint --caps lamp.write,lamp.read`.
Frequently Asked Questions about Device Context Protocol
What is Device Context Protocol?
Device Context Protocol is a Model Context Protocol (MCP) server that device context protocol — bridge llm agents to physical devices. sub-50-byte frames, <16kb mcu footprint, capability-scoped and safe by design. complementary to mcp. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Device Context Protocol?
Follow the installation instructions on the Device Context Protocol GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Device Context Protocol?
Device Context Protocol works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Device Context Protocol free to use?
Yes, Device Context Protocol is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Device Context Protocol Alternatives — Similar Developer Tools Servers
Looking for alternatives to Device Context Protocol? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Device Context Protocol in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Device Context Protocol?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.