Skip to content

Add MCP server for AI-assisted development via Claude#56

Open
andrewleech wants to merge 2 commits into
vshymanskyy:mainfrom
andrewleech:feature/mcp-server
Open

Add MCP server for AI-assisted development via Claude#56
andrewleech wants to merge 2 commits into
vshymanskyy:mainfrom
andrewleech:feature/mcp-server

Conversation

@andrewleech
Copy link
Copy Markdown

This adds an MCP (Model Context Protocol) server that lets Claude Desktop and Claude Code
control ViperIDE remotely, connecting to devices, managing files, running code, and
interacting with the REPL. The user sees everything in the browser and can intervene at
any point.

Entirely optional, self-contained in mcp/ with minimal touchpoints to the main codebase:

  • src/control_client.js - new file, browser-side message handler for the MCP WebSocket
  • src/app.js - ~15 lines added, conditionally initialises the control client when
    launched with ?mcp=1
  • src/transports.js - one timeout constant changed (1s to 5s for WebREPL password prompt)

Everything else lives under mcp/ and doesn't affect normal ViperIDE usage.

Includes:

  • Local serial-to-WebSocket bridge so USB connections work without the browser permission picker
  • Claude Desktop extension bundles (.mcpb) and npm package for Claude Code
  • CI workflow for building and publishing on tag push
  • E2E test suite covering VM and hardware targets

I wrote up a walkthrough of how it works in practice:
https://notes.alelec.net/posts/claude-meets-micropython/

No pressure at all if you're not keen on AI integration or the maintenance/support
that might come along with it. Happy to keep this on my fork if you'd prefer.
I wanted to put it in front of you in case it's something you'd be interested in
having upstream. Either way, ViperIDE made this possible, the architecture and
transport abstraction were a great foundation to build on.

@andrewleech andrewleech force-pushed the feature/mcp-server branch 2 times, most recently from f446ea9 to 654eef3 Compare April 22, 2026 05:11
MCP (Model Context Protocol) server that lets Claude Code or Claude
Desktop programmatically control ViperIDE while the user interacts
with it in the browser simultaneously.

Core: the MCP server serves built ViperIDE on localhost, opens the
browser on first tool call, and bridges MCP tool calls over WebSocket
to a control client injected into the IDE. 23 MCP tools expose device
connection, file operations, editor control, code execution, terminal
I/O, and package management.

Serial bridge: Node.js opens USB serial ports directly and relays
data over WebSocket, faking a WebREPL handshake so ViperIDE's
existing transport works unchanged. Bypasses browser WebSerial
permission picker entirely.

Distribution: build-dist.sh produces per-platform .tar.gz and .mcpb
(Claude Desktop Extension) bundles with pre-built ViperIDE assets.
build-npm.sh stages a cross-platform npm package. CI workflow builds
all three platforms and publishes to npm + GitHub Releases on tag.

Also increases the WebREPL password prompt timeout from 1s to 5s
for slow embedded WiFi stacks.
- control_client: track connecting/connected state locally and snapshot
  deviceInfo on deviceConnected event. Fixes get_status reporting stale
  devInfo from a prior session because app.js never clears its module
  local on disconnect.
- mcp/index.js: drop 'usb' from connect_device enum and document
  connect_serial as the USB path, so Claude does not route USB connect
  requests to the browser click flow.
- mcp/index.js: expose the bundled ideUrl in get_status and add an
  open_ide tool so the model stops suggesting viper-ide.org when the
  browser tab is closed.
- rawmode: interruptProgram per retry failures now log to console.debug
  instead of popping a red toast; only the final 20s timeout surfaces
  as a user visible error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants