Skip to main content

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:

  1. create a bridge with IoMastraBridgeFactory(...)
  2. register bridge.createHonoRoutes() into the Mastra server
  3. place any auth or logging middleware around the resulting routes
  4. 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.