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