Skip to content

feat(bridge): keep the stdio bridge useful while the IDE is closed - #36

Merged
mixelpixx merged 1 commit into
mainfrom
bridge-offline-graceful
Oct 1, 2026
Merged

mixelpixx merged 1 commit into
mainfrom
bridge-offline-graceful

Conversation

@mixelpixx

@mixelpixx mixelpixx commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

The stdio bridge now stays useful while the Arduino Agent IDE is closed, instead of only reporting that the IDE isn't running.

  • Tool list: tools/list always returns the real tool list. That is the IDE's own list once the bridge has seen it, and otherwise the compiled definitions for the tool mode set in the IDE preferences.
  • Offline discovery: list_tool_categories, get_category_tools, search_tools and the prompts are answered locally. The server and the bridge now share runRouterDiscoveryTool (in mcp-tool-router.ts), so both give the same answers.
  • Auto-launch: with ARDUINO_AGENT_PATH set, a tool that needs the IDE starts it and waits for its MCP server. Without it, the call returns an "open the IDE" tool error instead of failing to connect.
  • Live refresh: a watcher sends notifications/tools/list_changed when the IDE comes up or restarts with a different tool list, so clients refresh without a restart.
  • Docs: the README, the bridge README and the skill are updated.

The server-side change is a pure extraction. The three router cases in mcp-server.ts moved into the shared function without changing behavior.

Test plan

  • npm run --prefix arduino-mcp-extension build (tsc) passes.
  • yarn test:bridge: the new node:test suite (11 tests) runs the bridge against mock servers on random ports with a temporary home directory.
  • Manual smoke test (test/manual/smoke-test.js) against a running IDE: all 14 checks pass, including the offline-parity checks (initialize instructions, tools/list and search_tools match the live server).
  • Live check through Claude Code with the IDE closed: search_tools and get_category_tools answered offline, and execute_tool arduino_context started the IDE through ARDUINO_AGENT_PATH and returned its state.
  • CI: Check MCP Extension passes.

🤖 Generated with Claude Code

- tools/list always returns the real tool list: the IDE's own once seen,
  otherwise the compiled definitions for the configured tool mode.
- The read-only router tools (list_tool_categories, get_category_tools,
  search_tools) and prompts are answered locally. The server and the
  bridge now share runRouterDiscoveryTool so both answer identically.
- With ARDUINO_AGENT_PATH set, a tool that needs the IDE starts it and
  waits for its MCP server; without it, the call returns an "open the
  IDE" tool error instead of failing to connect.
- A watcher sends notifications/tools/list_changed when the IDE comes up
  or restarts with a different tool list.
- Add a node:test suite (test/bridge, `yarn test:bridge`) and an
  offline-parity check to the manual smoke test; update the README,
  bridge README and skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mixelpixx
mixelpixx merged commit a805129 into main Oct 1, 2026
1 check passed
@mixelpixx
mixelpixx deleted the bridge-offline-graceful branch October 1, 2026 10:18
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.

1 participant