Skip to content

feat: thunderbolt-stdio-bridge — bridge local stdio ACP agents and MCP servers#989

Closed
ital0 wants to merge 28 commits into
mainfrom
italomenezes/thu-601-acp-marketplace-acp-bridge-run-local-stdio-agents-in
Closed

feat: thunderbolt-stdio-bridge — bridge local stdio ACP agents and MCP servers#989
ital0 wants to merge 28 commits into
mainfrom
italomenezes/thu-601-acp-marketplace-acp-bridge-run-local-stdio-agents-in

Conversation

@ital0

@ital0 ital0 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Changes ACP/MCP routing to bypass the cloud proxy on loopback (intentional, tested); incorrect loopback detection could weaken proxy SSRF protections for remote URLs. The new bridge exposes a privileged local agent and relies on Origin/bearer gates.

Overview
Adds thunderbolt-stdio-bridge, a local CLI that relays a stdio ACP agent to a loopback WebSocket (--mode acp) or a stdio MCP server to Streamable HTTP at /mcp (--mode mcp), with Origin allowlisting, PII-safe logging, optional cloudflared tunnel + bearer for MCP only, and a GitHub Actions workflow that esbuild-bundles bridge.cjs and smoke-tests ACP/MCP boot.

So Thunderbolt can reach those endpoints from the web app, loopback targets skip the cloud proxy: new isLoopbackUrl / isLoopbackHost drives direct WebSocket for remote-acp (including in the browser) and native fetch for MCP via resolveMcpFetch, with tests that non-loopback routing stays proxied.

Settings UX for the bridge path: agent catalog cards get Connect via bridge (BridgeConnectDialog + registry-derived composeBridgeCommand), Add the agent hands off to Add Custom Agent; loopback URLs show a local network permission hint in that dialog.

Reviewed by Cursor Bugbot for commit aa4e5d9. Bugbot is set up for automated code reviews on this repo. Configure here.

@ital0 ital0 self-assigned this Jun 16, 2026
@github-actions

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +4904 / -21
JS bundle size (gzipped) 🟢 682.4 KB → 682.5 KB (+86 B, +0.0%)
Test coverage 🟢 78.20% → 78.70% (+0.5%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Tue, 23 Jun 2026 20:30:26 GMT · run #2018

@ital0
ital0 marked this pull request as ready for review June 16, 2026 15:47
Comment thread thunderbolt-acp-bridge/src/server.js Outdated
Comment thread thunderbolt-acp-bridge/src/server.js Outdated
Comment thread acp-bridge/src/server.js Outdated
Comment thread thunderbolt-acp-bridge/src/server.js Outdated
Comment thread thunderbolt-stdio-bridge/src/log.js
Comment thread acp-bridge/src/server.js Outdated
Comment thread thunderbolt-acp-bridge/src/server.js Outdated
Comment thread thunderbolt-acp-bridge/src/server.js Outdated
Comment thread thunderbolt-acp-bridge/src/server.js Outdated
@ital0 ital0 changed the title feat: acp-bridge — run local stdio ACP agents in Thunderbolt feat: thunderbolt-stdio-bridge — bridge local stdio ACP agents and MCP servers Jun 18, 2026
Comment thread thunderbolt-stdio-bridge/src/server.js
Comment thread thunderbolt-stdio-bridge/src/mcp-server.js
Comment thread thunderbolt-stdio-bridge/src/mcp-server.js
Comment thread thunderbolt-stdio-bridge/src/mcp-server.js
Comment thread thunderbolt-stdio-bridge/src/util.js
ital0 added 4 commits June 19, 2026 08:57
…dge-agent-link-outs' into italomenezes/thu-601-acp-marketplace-acp-bridge-run-local-stdio-agents-in
…acp-marketplace-acp-bridge-run-local-stdio-agents-in

# Conflicts:
#	src/components/settings/agents/add-custom-agent-dialog.tsx
Comment thread .github/scripts/review-orchestrator.mjs
…lace-browse-catalog-bridge-agent-link-outs' into italomenezes/thu-601-acp-marketplace-acp-bridge-run-local-stdio-agents-in

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 thunder-deep-review (advisory)

Reviewed the diff — no issues to report. ✅ Never approves, never requests changes, never gates merge.
head: 34bc20aab3d2 · mode: deep · deferred 15 item(s) already reported by other bots (best-effort dedup)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d841be2. Configure here.

else endJson(res, 503, jsonRpcError(JSONRPC_INTERNAL_ERROR, 'Agent process exited'))
}
openResponses.clear()
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MCP flush skipped on agent exit

Medium Severity

When the stdio MCP child exits, superviseChild’s exit listener runs first and calls process.exit after closeFace, which only invokes face.close() (server.close + transport.close). The MCP face’s second child.on('exit') handler that 503s tracked openResponses often never runs, so in-flight Streamable HTTP requests can hang instead of failing promptly.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d841be2. Configure here.

@ital0
ital0 force-pushed the italomenezes/thu-601-acp-marketplace-acp-bridge-run-local-stdio-agents-in branch from d841be2 to aa4e5d9 Compare June 23, 2026 20:24
Base automatically changed from italomenezes/thu-600-acp-marketplace-browse-catalog-bridge-agent-link-outs to main June 23, 2026 23:46
@ital0

ital0 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #1021, which delivers the full thunderbolt-stdio-bridge feature (package + curl|bash installer + catalog connect flow) as a single PR, rebuilt clean-room from the approved THU-601 design and verified end-to-end against the real app. Closing.

@ital0 ital0 closed this Jun 25, 2026
@github-actions

Copy link
Copy Markdown

Preview environment destroyed 🧹

Stack preview-pr-989 and its Cloudflare subdomain have been cleaned up.

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