feat: add Tactility MCP Screen foundation

This commit is contained in:
Adolfo Reyna
2026-06-24 23:48:21 -04:00
parent fb800bb5bd
commit ac9d6dc0d3
9 changed files with 1057 additions and 1 deletions
+61
View File
@@ -0,0 +1,61 @@
# MCP Screen
Native Tactility port of the MicroPython MCP Screen firmware.
The current Phase 1 slice provides:
- JSON-RPC 2.0 over `POST /api/mcp` on port 80
- `tools/list`
- `get_capabilities`
- `clear_screen`
- `draw_text`
See `IMPLEMENTATION_PLAN.md` for the full roadmap.
UDP discovery is temporarily unavailable to an external app because the
Tactility 0.7.0-dev firmware does not export `lwip_recvfrom` and
`lwip_sendto`. The existing MicroPython bridge remains compatible through its
HTTP subnet-scan fallback.
The HTTP worker uses a non-blocking listener and is explicitly stopped and
deleted during `onDestroy`. This is required because Tactility unloads the
external ELF after the app closes.
## Build
```bash
. /Users/adolforeyna/esp/esp-idf/export.sh
export TACTILITY_SDK_PATH=/Users/adolforeyna/.gemini/antigravity/scratch/tactility/release/TactilitySDK
python3 tactility.py Apps/McpScreen build esp32s3 --local-sdk
```
## Direct smoke test
Replace the IP address with the device address:
```bash
curl -s http://DEVICE_IP/api/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```
```bash
curl -s http://DEVICE_IP/api/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"draw_text","arguments":{"text":"Hello from MCP","x":20,"y":30,"size":2}}}'
```
The existing MicroPython host bridge can also be used unchanged:
```bash
python3 /Users/adolforeyna/Projects/MicroPython/test1/Screen/mcp_bridge.py
```
Or run the included Phase 1 smoke test:
```bash
python3 Apps/McpScreen/tools/smoke_test.py --ip DEVICE_IP --draw
```
The `--ip` argument is required until UDP discovery is available to external
apps.