Understanding MiraBridge's architecture helps you get the most out of the platform.
The Orchestration Model
In MiraBridge, the developer is the orchestrator β not the coder. You give instructions, the AI writes code. You approve tool executions, the AI applies changes.
Gateway β The Central Hub
The Gateway is a NestJS backend that serves as the single connection point for all clients. It handles:
- AI processing β routing requests to Claude, GPT, or Gemini
- Tool execution β dispatching file, terminal, and git operations to VS Code
- Real-time sync β WebSocket-based message delivery between devices
- Authentication β JWT tokens with refresh, OAuth (GitHub/Google)
- Billing β prepaid credits, usage tracking, Stripe integration
Device Registry
The Gateway maintains a device registry tracking all connected clients:
- VS Code Extension β primary tool executor, runs code locally
- Mobile App β remote control and monitor
- Codex Bridge β translates between MiraBridge and Codex CLI
Tool Execution Flow
When the AI needs to perform an action:
- AI requests a tool execution (e.g., write a file)
- Gateway routes the request to VS Code
- VS Code shows an approval dialog
- You approve or reject
- Tool executes and result flows back through Gateway
WebSocket Communication
All real-time communication uses WebSocket with a custom message protocol. Messages are typed and versioned, supporting streaming, tool approval, plan mode, and more.
Next Steps
- Your First Session β see these concepts in action
- Tools & Commands β explore the 40+ available tools