cd circuitpython-mcp
pip install mcp pyserial
# or with uv (recommended):
uv pip install mcp pyserialpython server.py
# Should hang silently — that means it's waiting for MCP input. Ctrl-C to stop.claude mcp add --scope user circuitpython-repl -- python /ABSOLUTE/PATH/TO/circuitpython-mcp/server.pyReplace /ABSOLUTE/PATH/TO/ with the actual path, e.g.:
claude mcp add --scope user circuitpython-repl -- python ~/projects/circuitpython-mcp/server.pyclaude mcp listYou should see circuitpython-repl in the list.
Type /mcp — you should see:
• circuitpython-repl: connected
Just talk naturally:
- "List the available serial ports"
- "Connect to /dev/tty.usbmodem14201"
- "Run
import board; print(dir(board))on the board" - "Execute this file on the board and show me any errors"
- "Soft reset the board"
- "The board seems stuck, interrupt it"
Permission denied on Linux:
sudo usermod -aG dialout $USER
# then log out and back inPort not found:
On macOS, CircuitPython boards usually appear as /dev/tty.usbmodem*
On Linux: /dev/ttyACM0 or /dev/ttyUSB0
On Windows: COM3, COM4, etc.
Use list_ports tool to discover the right port.
Server shows "failed" in /mcp:
Check the path is absolute and Python can import mcp and serial:
python -c "import mcp, serial; print('OK')"