Skip to content

Mumm gateway SDK

Serve AI agentsfrom your own data.

Put the gateway in front of your website. Agents get clean markdown from your sources. People and search crawlers get your pages unchanged.

npm install @rebilder/gateway
On this page

What the gateway is#

@rebilder/gateway connects your existing website to AI agents using content-negotiation middleware. It classifies every request as AI agent, human, search crawler, or protocol client, and serves agents a clean markdown transformation of the canonical page, rendered from your source of truth. Humans and crawlers pass through untouched, as if the gateway weren’t there.

Mumm gateway

One connection.
The right response.

Incoming request → matching format

AI requestMarkdown from your sourcesMD
People and crawlersYour original websiteHTML
Protocol requestYour endpointAPI
Activity is recorded through your configured event handler.
  • Markdown path: an agent asking with Accept: text/markdown (or an identified agent platform) gets a text/markdown response rendered from your service descriptions, feature guides, product data and policies. Important facts come first, under 5KB by default.
  • Pass-through: humans and search crawlers get null from the gateway, so your HTML pipeline runs unchanged. Googlebot always receives canonical HTML.
  • Events: every handled request, including pass-throughs, emits one RebilderEventV0 to your onEvent hook: who asked, what they got, how long it took. That feed powers the Mumm for Business console.

In the captured demo, the same product request dropped from 91,226 bytes of PDP HTML to 1,315 bytes of markdown, a 98.6% reduction, with the price moving from character offset 23,185 to line 4. The capture includes the source page and both responses.

Install and verify the gateway#

Connect your business sources and event reporting, then verify serving and reporting separately. The scope depends on your website and the available sources:

  1. Install @rebilder/gateway, which has zero external runtime dependencies by policy. Our packages are published on npm under @rebilder, the company behind Mumm.
  2. Wire your source of truth: up to five optional resolver functions from URL to your own data. Three are commerce shaped (product, policies, catalog). Two are universal: document for any other page, such as a guide or a service, and collection for an index of them. Wire only the ones you have.
  3. Mount the adapter for your stack: Next.js middleware, Shopify app proxy, Express/Fastify, a Cloudflare Worker, or the fetch middleware for SvelteKit, Nuxt, Astro, React Router, Hono, Bun, Deno, Netlify and Vercel.
  4. Connect event reporting with your site-scoped key and the event sink. Use the runtime-specific flush or waitUntil instructions so events reach your Console.
  5. Verify with curl: same URL, markdown for agents, unchanged HTML for everyone else. Then confirm that the request appears in Console → AI visits.

For WordPress, use the free plugin. For a custom integration, start with Quickstart: Next.js end to end. On another stack? Jump straight to the Shopify, Node, Cloudflare, framework or runtime pages; the config object is identical everywhere.

Built for production stacks#

  • Zero external runtime dependencies. The gateway’s only runtime deps are internal workspace packages, and it re-exports their public types, so you install one package. No framework imports anywhere: the core is written against web-standard Request/Response.
  • Edge latency budget: p95 < 50ms compute, no network calls on the hot path. Classification is a handful of header string scans (well under 1ms); rendering is pure string assembly. Your source resolvers are the only variable, so back them with in-memory data or a fast cache.
  • The gateway passes unmatched requests and source or rendering failures through to your existing application.
  • Open source under Apache-2.0. The source, tests and ARS conformance corpus are on GitHub, where issues and pull requests are welcome.

Guarantees#

Key pages#

PageWhat it covers
QuickstartNext.js end to end: install, wiring, a complete catalog example, curl verification.
Next.js adapterproxy.ts / middleware.ts integration, the dedicated markdown route, matcher scope.
Shopify adapterApp-proxy setup in Partners, the HMAC security model, response semantics.
Node adapterExpress middleware, Fastify via @fastify/middie or an onRequest hook, structural types.
Cloudflare & edgeThe worker fetch handler, origin pass-through, Vercel Edge and other WinterCG runtimes.
FrameworksThe /fetch middleware, with recipes for SvelteKit, Nuxt, Astro, React Router, Remix and Hono.
RuntimesBun, Deno, Netlify Edge Functions and Vercel Routing Middleware.
SourcesThe GatewaySources contract: field-by-field types, resolution order, error containment.
ClassificationHow requests are detected: the five checks, the crawler guardrail, confidence semantics.
EventsRebilderEventV0 field reference, the wire protocol, the HTTP and console sinks.
llms.txtGenerate an llms.txt directory from your source configuration.
TroubleshootingReal failure modes with fixes.
API referenceEvery public export of @rebilder/gateway and @rebilder/events, with signatures.

Last updated