Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Pi Serial BridgeNew to Visual Studio Code? Get it now.
Pi Serial Bridge

Pi Serial Bridge

Portalsbase

|
2 installs
| (0) | Free
Serial terminal to a Raspberry Pi (or any serial device) inside VS Code, plus an MCP server so Claude Code can run commands and move files over the same connection.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Pi Serial Bridge

VS Code extension: a serial terminal to a Raspberry Pi (or any serial device), plus an embedded MCP server so Claude Code can run commands on the same connection.

Run it

npm install
npm run compile

Then press F5 in VS Code (with this folder open) to launch an Extension Development Host.

Use it

  1. Set piSerial.port / piSerial.baudRate in settings if COM5 @ 115200 isn't right. The "Pi Serial Bridge" panel at the bottom of the Explorer sidebar has the same controls plus a password field, if you'd rather not hand-edit settings.json.
  2. Click Connect Pi (COM5) in the status bar (or the panel's Connect button). A terminal tab opens with a raw passthrough to the Pi — type as you would with plink. Reconnecting reuses this same tab rather than opening a new one each time.
  3. Claude Code's MCP tools (run_command, read_file, write_file, list_files) are now reachable at http://127.0.0.1:4756/mcp (port set by piSerial.mcpPort). The endpoint requires an Authorization: Bearer <token> header — run Pi Serial: Copy MCP Token (or the panel's "Copy MCP Token" button) to get the token, then add it as a header on the MCP server config. Without it the server replies 401 Unauthorized.
  4. For the MCP tools to work without a human watching the terminal to log in, turn on piSerial.autoLogin, set piSerial.username, and run Pi Serial: Set Login Password (stored in VS Code's encrypted secret storage, not settings.json). Auto-login retries up to 3 times if the Pi keeps reprinting its login prompt (e.g. a wrong password), then gives up and surfaces an error instead of looping forever.
  5. If the serial connection drops unexpectedly (Pi reboot, USB blip), the extension retries automatically every 5s for up to 6 attempts before giving up and asking you to reconnect manually. An intentional Disconnect never auto-reconnects.
  6. Pi Serial: Show Activity Log (or the panel's "View Activity Log" button) opens an output channel logging every MCP tool call — which tool, arguments, and a preview of the result — so you can see what Claude actually ran on the Pi.

Known rough edges

  • serialport is a native module. The npm install above fetches a prebuilt binary for your Node version; if you later package this with vsce/@vscode/vsce for distribution, you'll need to rebuild it against VS Code's Electron ABI (e.g. via @vscode/vsce + electron-rebuild, or ship per-platform prebuilds) — running it via F5 locally does not hit this.
  • Typing in the terminal while an MCP command is in flight can interleave with the __DONE__$? marker detection and confuse the result. Treat "human driving the terminal" and "Claude driving the MCP tools" as mutually exclusive at any given moment.
  • run_command/read_file/write_file interpolate paths into shell commands without escaping — acceptable here since run_command already allows arbitrary code execution on the Pi, but don't reuse this pattern somewhere that needs a real security boundary.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft