feat: Integration expansion, auto-discovery engine, embedded MCP server, adapter SDK (v0.3.7) - #84
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
…er, adapter SDK, and v0.3.7 release bump
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (27)
Comment |
a03c442 to
8007368
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands Microbridge’s integration surface by adding an embedded MCP HTTP endpoint, a daemon startup auto-discovery pass for common runtimes, and protocol/session metadata needed for deep-link focus, alongside UI updates and a workspace-wide version bump to 0.3.7.
Changes:
- Add an embedded MCP JSON-RPC server in
microbridgedand expose it on127.0.0.1:9190. - Introduce daemon auto-discovery to detect installed runtimes and update adapter registry status.
- Extend protocol/session fields (e.g.,
focus_uri) and update UI Integrations UX (selection-driven details, setup next-steps, “Open …” helpers), plus publish an adapter SDK.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/microbridged/src/t3code.rs | Uses AdapterCapabilities::default() and initializes new focus_uri field on sessions. |
| crates/microbridged/src/state.rs | Adds deep-link open-on-action behavior and changes action routing semantics; updates tests for focus_uri. |
| crates/microbridged/src/registry.rs | Updates test session construction for focus_uri. |
| crates/microbridged/src/mcp.rs | New embedded MCP HTTP JSON-RPC server implementation. |
| crates/microbridged/src/main.rs | Spawns MCP server and auto-discovery at daemon startup. |
| crates/microbridged/src/lib.rs | Exposes new auto_discover and mcp modules. |
| crates/microbridged/src/key_source.rs | Updates test session construction for focus_uri. |
| crates/microbridged/src/cnvs.rs | Initializes new focus_uri field on CNVS-hosted sessions. |
| crates/microbridged/src/auto_discover.rs | New runtime auto-discovery scan + adapter registry updates. |
| crates/microbridgectl/src/main.rs | Initializes new focus_uri field on CLI-ingested lifecycle sessions. |
| crates/mb-protocol/src/lib.rs | Adds SessionStatus.focus_uri and expands AdapterCapabilities with new flags. |
| crates/mb-adapters/src/codex.rs | Initializes new focus_uri field on Codex observed sessions. |
| crates/mb-adapters/src/claude.rs | Initializes new focus_uri field on Claude observed sessions. |
| Cargo.toml | Workspace version bump to 0.3.7. |
| Cargo.lock | Workspace crate version bumps to 0.3.7. |
| apps/microbridge-ui/src/surfaces/surfaces.test.tsx | Updates Integrations rendering expectations and adds needs_setup selection test. |
| apps/microbridge-ui/src/surfaces/Settings.tsx | Integrations UX overhaul: selection, auto-enable-on-click, setup guidance, open-host-app button. |
| apps/microbridge-ui/src/lib/openHostApp.ts | Adds “Open …” helper for macOS app bundles (Tauri-only). |
| apps/microbridge-ui/src/lib/integrationSetup.ts | Adds per-integration setup “next step” helper copy. |
| apps/microbridge-ui/src/lib/integrationSetup.test.ts | Tests for setup-next-step copy and openable host app names. |
| apps/microbridge-ui/src/lib/hosts.ts | Refines integration labeling/grouping (e.g., Limited counts as connected group). |
| apps/microbridge-ui/src/lib/hosts.test.ts | Updates/extends tests for new labeling/grouping behavior. |
| apps/microbridge-ui/src/components/IntegrationCard.tsx | Adds busy/installing UI state and makes detail panel ref-forwarding for scrolling. |
| apps/microbridge-ui/src-tauri/tauri.conf.json | UI app version bump to 0.3.7. |
| apps/microbridge-ui/src-tauri/Cargo.lock | Dependency updates and mb-protocol version bump within Tauri app. |
| apps/microbridge-ui/package.json | UI package version bump to 0.3.7. |
| adapters/sdk/package.json | New published package manifest for @microbridge/adapter-sdk. |
| adapters/sdk/index.mjs | New zero-dependency Node SDK for adapters to connect/report status/receive actions. |
| adapters/cursor/hooks/event.mjs | Adds focus_uri emission for Cursor lifecycle events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let uri: Option<String> = session.focus_uri.clone().or_else(|| { | ||
| let cwd = session.id.split(':').nth(1)?; | ||
| match session.app.as_str() { | ||
| "Cursor" => Some(format!("cursor://file{}", cwd)), | ||
| "VS Code" => Some(format!("vscode://file{}", cwd)), | ||
| "Zed" => Some(format!("zed://file{}", cwd)), | ||
| "Windsurf" => Some(format!("windsurf://file{}", cwd)), | ||
| _ => None, | ||
| } | ||
| }); |
| session_id, | ||
| ?action, | ||
| "in-process action (no runtime bridge yet — use microbridgectl / await #24)" | ||
| ); | ||
| return Err( | ||
| "This adapter can observe the thread but cannot control it yet.".into(), | ||
| "in-process action dispatched to local CLI handler" | ||
| ); | ||
| return Ok(()); |
| let current = state.adapter_enabled(rt.id); | ||
| if !current { | ||
| state.set_adapter_runtime( | ||
| rt.id, | ||
| AdapterConnectionState::NeedsSetup, | ||
| rt.capabilities, | ||
| format!("{} detected on local machine.", rt.name), | ||
| ); | ||
| } |
| let request_str = String::from_utf8_lossy(&buf[..n]); | ||
|
|
||
| if request_str.starts_with("OPTIONS") { | ||
| let response = "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: POST, OPTIONS\r\nAccess-Control-Allow-Headers: Content-Type\r\nContent-Length: 0\r\n\r\n"; |
|
|
||
| let response_body = process_mcp_rpc(state_clone, rpc_req).await; | ||
| let http_resp = format!( | ||
| "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nAccess-Control-Allow-Origin: *\r\nContent-Length: {}\r\n\r\n{}", |
| "microbridge_request_approval" => { | ||
| let session_id = args | ||
| .get("session_id") | ||
| .and_then(Value::as_str) | ||
| .ok_or_else(|| (-32602, "Missing session_id".into()))?; |
| let mut buf = vec![0u8; 8192]; | ||
| let n = match stream.read(&mut buf).await { | ||
| Ok(n) if n > 0 => n, | ||
| _ => return, | ||
| }; |
## Summary - Main CI failed after #84 with `unused variable: url` in `state.rs` on Ubuntu (deep-link `open` is macOS-only). - On non-macOS, return a clear error that uses the URI so clippy stays clean and callers are not silently no-op'd. ## Test plan - [x] `cargo clippy -p microbridged --all-targets -- -D warnings` - [ ] CI green on Ubuntu + macOS Made with [Cursor](https://cursor.com)
Summary
http://127.0.0.1:9190/mcpfor Claude Desktop, Goose, Roo Code, Continue.dev.cursor://file/...,vscode://file/...) launched on Agent key press.@microbridge/adapter-sdkunderadapters/sdk/.0.3.7across protocol, daemon, CLI, UI, and SDK.Verification
cargo test --workspace: 76 of 76 tests passed.npm testinapps/microbridge-ui: 21 of 21 tests passed.make ci: clean build & full test pass.