Overview
This section documents the public API exposed by @interopio/ai-mastra-bridge.
AI Mastra Bridge is centered around a small public surface:
IoMastraBridgeFactory(config?)- the returned
IoMastraBridge.API - route definitions produced by
createHonoRoutes() - request and response types for agents, threads, messages, and streaming
What This Reference Covers
The AI Mastra Bridge reference is organized into these pages:
- API Reference for the factory, bridge API, and public types
- Routes and Events for how AI Mastra Bridge implements the protocol route inventory and event behavior
- Examples for Mastra registration patterns
- Agent Protocol for the shared frontend-backend contract
Integration Model
Most host applications follow the same flow:
- create a bridge with
IoMastraBridgeFactory(...) - register
bridge.createHonoRoutes()into the Mastra server - place any auth or logging middleware around the resulting routes
- point the frontend assistant client to that backend base URL
Frontend Relationship
This package is primarily for backends serving:
Those frontend packages benefit from a consistent backend contract for runs, agents, threads, and thread messages. That shared contract is documented in Agent Protocol.
Related Resources
- Introduction for the package-selection overview
- AI Web Overview for custom frontend clients that consume the bridge
- io.Assist NG Overview for Angular clients that consume the bridge
- MCP Overview if those frontends also need application tools and prompts