Hi NuttX devs,

I'd like to propose adding a small "mcpd" application to nuttx-apps: a
Model Context Protocol (MCP) server that exposes NuttX system capabilities
as MCP tools over HTTP + JSON-RPC 2.0.  This lets AI coding clients
(Cursor, Claude, etc.) inspect and control a NuttX device: read files,
list directories, run shell commands, enumerate tasks and query heap
usage.

Design points:

- JSON handling reuses the bundled cJSON library (CONFIG_NETUTILS_CJSON);
  no new JSON dependency is introduced.
- Transport is plain HTTP (POST + JSON), implemented with POSIX sockets
  and keep-alive support.
- 8 tools are always available: ping, system_info, read_file, list_files,
  run_command, list_tasks, task_info, meminfo.
- 2 dangerous tools (read_memory / write_memory) are gated behind
  CONFIG_SYSTEM_MCPD_DANGEROUS_TOOLS, default off, since raw memory
  access can crash or corrupt the device.
- The same sources also build on a POSIX host (Makefile.host) for quick
  protocol validation.

A few questions I'd appreciate feedback on before opening a PR:

1. Is an MCP server something the project is interested in hosting?
2. Is plain HTTP acceptable, or should I also add stdio/SSE transport?
3. Any preference on where it should live (system/ vs netutils/)?

Thanks,
hanzhijian



[email protected]

Reply via email to