AgentBack Boundary Architecture

One DI context exposes REST, MCP, docs, clients, and extensions from shared schemas.

HTTP MCP middleware / dispatch hooks Apps browser / server OpenAPI clients Agents Claude / Cursor MCP clients RestServer controllers.* validation /openapi.json + /explorer MCPServer tool classes input / output schema stdio + /mcp-inspector Application Context Bindings services / config controllers / tools tag-based discovery Zod Schemas validator + z.infer single source HTTP Contract OpenAPI 3.1 Swagger UI MCP Contract tools/list schema Inspector Typed Client schema-shared no codegen Extension layer Auth / metering / tracing Legend REST / HTTP MCP Backend binding Schema / boundary Policy flow

Center

  • • Application is a DI Context
  • • Servers, services, config, and controllers are bindings
  • • Tags drive startup discovery

Contracts

  • • Zod schema validates runtime data
  • • z.infer gives handler and client types
  • • OpenAPI and MCP schema are emitted from the same artifact

Extensions

  • • Middleware handles HTTP cross-cutting behavior
  • • Dispatch hooks instrument REST and MCP calls
  • • Auth, metering, payments, and tracing compose around servers