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