AgentBack — HTTP Hosts

One fetchHandler() — REST + MCP + OpenAPI — hosted by Node, Fastify, Hono, Bun, Deno, or Workers

HTTP hosts — own the TCP port RestApplication — one DI Context dispatch findByTag mountMcpHttpFetch · addFetchHandler / addFetchPrefix Client app · agent MCP client Node http listener: 'native' createNodeListener(fetchHandler()) Express default listener raw req/res routes supported here Fastify installFastifyHost(fastify, host) non-greedy wildcard fallback Hono hono.all('*', c => host.fetch(c.req.raw)) Node / Bun / Deno / Workers Bun Bun.serve({ fetch: host.fetch }) native fetch host — no adapter Deno · Workers export default { fetch } edge runtimes fetchHandler() fetch(Request) → Response REST · MCP OpenAPI · UIs /openapi.json · /llms.txt one Router, every host RestHandler auth → authz → confirm validate → DI invoke output validate → idem stream · upload · errors identical on every host @api controllers @get / @post + Zod [controller] tag @tool classes MCP over HTTP OAuth bearer · strategyAuth install* UIs explorer · console addFetchPrefix (static) framework routes /openapi.json /llms.txt Legend Host / runtime Core / REST MCP UI Client / framework routes Build-time registration

The single seam

  • RestServer.fetchHandler()fetch(Request): Response
  • • Same RestHandler pipeline as Express — full parity
  • addFetchHandler (exact paths) · addFetchPrefix (static)
  • listen: false hands the port to the host

The hosts

  • • Node native — rest.listener: 'native'
  • • Express — default; raw req/res routes live here
  • • Fastify — installFastifyHost (non-greedy)
  • • Hono · Bun · Deno · Cloudflare Workers

MCP on any host

  • mountMcpHttpFetch — Web Streamable HTTP transport
  • installMcpHttp auto-selects fetch vs Express
  • • OAuth bearer + strategy auth, session pinning
  • • REST + MCP + OpenAPI from one listener