A serial terminal for AI agents: letting Claude Code and Codex use your serial port
Give the agent a tool that holds the port for it. Three setups work: a serial terminal with its own MCP server, such as NeuroTerm or NinjaTerm; a serial MCP server, such as serial-mcp-server; or a daemon that shares the port, such as Serial Tether. An agent that opens the port itself with screen, cat or a Python script tends to hang, because a serial port never reaches the end of its output. NeuroTerm is a serial and SSH terminal for embedded developers who work with Claude Code and Codex. It is free for individuals, at work too, and runs on Windows and Linux.
Why the agent should not open the port itself
Ask Claude Code to check the board and it reaches for the port with cat /dev/ttyUSB0, screen, idf.py monitor or a short pyserial script. Reading a file stops at its end; reading a serial port waits for the next byte, so the tool call does not come back. And while your terminal has the port open, the agent’s open fails as busy, or the agent’s holds it and yours fails. A tool that owns the port and answers the agent in bounded calls fixes both. Claude Code and Codex on your serial port · ESP32: the agent hangs on the serial monitor
Three setups that work
A serial terminal with its own MCP server
You keep the console open in a desktop terminal, and the agent connects to that terminal over MCP: it reads what the board printed and sends to the port the terminal already holds. You see everything it does. NeuroTerm and NinjaTerm work this way. NeuroTerm also puts SSH, WSL and local shell tabs in the same window and shows each write in the tab for your Allow. NinjaTerm also does Bluetooth LE and graphs, and runs on macOS, where NeuroTerm has no build yet.
A serial MCP server
A server with no window opens the port for the agent and gives it tools such as read, write, read until a prompt and pulse DTR. serial-mcp-server is one; it can mirror the port to a PTY so screen or minicom sees the same stream, on macOS and Linux. It suits test rigs and CI, where nobody watches a terminal.
A daemon that shares the port
A daemon owns the port and lets several clients use it at once: you in a shell, scripts, and the agent through a command-line client. Serial Tether works this way, on macOS and Linux; its tether exec returns a command’s output and exit status, and a remote board is reachable over TCP. The agent uses it through its shell, not MCP.
What to check before you pick
- Can you watch the port while the agent works? A board is easier to trust when you see the boot log the agent is reading.
- Who approves a write? A line sent to a board can erase flash or start a motor. Most tools rely on your agent’s own tool prompt; NeuroTerm asks in the tab, showing what will be sent.
- Can the agent flash and reset? Flashing needs the port free for esptool, west or pio, and a reset needs DTR, RTS or a break.
- Does it run on your computer? Windows support differs most: Serial Tether has no Windows backend yet, and serial-mcp-server’s mirror is not on Windows.
- What else is on the board? An embedded Linux board often needs SSH next to its serial console.
serial-mcp-server, Serial Tether, NinjaTerm and NeuroTerm, compared answers these for each tool, with a link to each project’s own page.
How it works in NeuroTerm
Claude Code or Codex started in a NeuroTerm Local or WSL tab works in your serial, SSH, WSL, Local and TCP tabs through Terminal Use, NeuroTerm’s MCP server. It reads a tab’s new output as plain text, with the errors, warnings and boot stages NeuroTerm marked, and runs a command at a U-Boot or shell prompt and waits for the prompt to come back.
Reading needs no approval. Before the agent types, runs a command, resets the board or borrows the port to flash, the tab shows the request and waits for Allow or Deny; no answer in 45 s means no. To flash, NeuroTerm closes the port for the agent’s own esptool, west or pio and reopens it in the tab when the agent gives it back. Agents in SSH tabs are not supported.
To set it up, open Settings → Coding agents → Connect a coding agent, choose Connect… in the row of the host where your agent runs and keep Terminal Use on; NeuroTerm registers its MCP server with Claude Code and Codex for you. Then start claude or codex in a Local or WSL tab and ask, for example, “Read the boot log in my serial tab”. Terminal Use (MCP) setup and tools
Other projects
- serial-mcp (PyPI
pyserial-mcp): a serial MCP server that finds USB adapters by VID and PID and changes the baud rate live. - UART MCP Server: several serial sessions at once, text and binary modes.
- terminal_mcp: one MCP tool for serial, SSH, Telnet, TCP and Bluetooth, part of the MCP-Link bundle.
- term-cli: lets an agent drive interactive programs, serial consoles through
screenorpicocomincluded, in tmux, and hands control to you for passwords; macOS and Linux. - dbgprobe-mcp-server: a J-Link debug probe for the agent, to flash, halt and read memory, next to any of the above.