MCP client, OpenRouter provider, Copilot bridge, and a storage fallback - one large bundled commit

wearefaces landed a 3,344-line commit that adds per-user MCP server federation, two new LLM providers (OpenRouter and a local Copilot bridge), and a storage fallback that makes R2 optional. Four threads, no separation.

integrationinfrastructure

The MCP client in backend/src/lib/mcp.ts speaks Streamable-HTTP JSON-RPC 2.0 (protocol 2025-06-18). It initialises per-user servers in parallel, prefixes tool names as mcp__<srvId>__<tool> to avoid collisions, and isolates failures per server. chatTools.ts splits dispatch on that prefix: MCP calls go to mcpRuntime.callTool, native calls use the existing path, results merge back by tool_call_id. A new Supabase table (user_mcp_servers) stores configs with masked auth tokens; a 652-line integrations page handles the frontend.

OpenRouter is a production provider sending to openrouter.ai/api. The Copilot adapter is explicitly local-only - it talks to an OpenAI-compatible proxy at COPILOT_BRIDGE_URL (default http://localhost:4141) and is gated behind a copilotEnabled flag. The storage change is quieter but more broadly consequential: storageEnabled is now always true and the backend silently uses .local-storage/ when R2 env vars are absent. Callers lose the ability to detect "no storage configured".

The same commit also drops ChatShortcuts.tsx, GherkinScenarioViewer.tsx, request-logging middleware, and a .mcp.json hardcoding this fork's Supabase project_ref=lonjaurpxqaaxswyzpbq. That file is fork-specific and must not be carried across.

None of the four threads were committed separately, so cherry-picking any one of them requires manual splitting.

So what The MCP client and OpenRouter provider are the most portable pieces - both are clean abstractions with no fork-specific data. The storage default flip is a behavior change worth evaluating on its own before adopting. The Copilot bridge is a local dev convenience. If you want any of this, plan for manual diff work: the commit cannot be cleanly cherry-picked as-is.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from wearefaces/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
9b0de8d1 Add MCP servers, Copilot bridge, OpenRouter provider, and assorted UI updates michael 2026-05-07 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-177.md from inside the repo you want the changes in.

⬇ Download capture-thread-177.md