Hosted agent interfaces
What it does
apps/site hosts the public documentation and agent interfaces.
A capability is one named action with shared input, output, and failure definitions and a server-side implementation.ΒΆ
- MCP means Model Context Protocol27. It lets an agent discover and call tools.ΒΆ
- A2A means Agent2Agent protocol. This site uses it to answer documentation questions through search and read.ΒΆ
- Discovery cards describe how to connect with each protocol.ΒΆ
- OpenAPI describes the HTTP API for the registered capabilities, including inputs, outputs, and errors.ΒΆ
- The agent guide explains connection, search, read, and following links between documentation pages.ΒΆ
- The hosted registry exposes
search,read,backlinks,neighbors,mentions,path, andexecute.ΒΆ
Run a program instead of several calls
Use POST /api/execute with a JSON code string. The MCP execute tool runs the same job.ΒΆ
Code mode21 runs several capability calls in one program inside a restricted environment. joinInterest cannot run there.ΒΆ
Source: callable definitions in apps/mischief/src/capabilities/index.ts at 445b1a20b51a5492f8e586daeb9306e8011b7673, lines 34β45.ΒΆ
const found = await tools.search({ query: "cartridges", limit: 1 });
const page = await tools.read({ id: found.matches[0].id });
return { title: page.title, id: page.id }; The program passes the search result directly to read.ΒΆ
MCP supports protocol versions 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26, and 2024-11-05. The newest is stateless. Older clients initialize sessions backed by a Durable Object, Cloudflareβs feature for persistent state and compute.ΒΆ
A2A answers documentation questions through search and read. RPC means remote procedure call: a client calls a named operation on the server. Browser RPC serves the browser separately.ΒΆ
The standard
- Application calls use shared capability value definitions and server-side implementations.ΒΆ
- Discovery and static pages handle routing. Domain calls stay in capability handlers.ΒΆ
- Public API access needs no account or access token.ΒΆ
- Interest signup12 has its own consent and email-confirmation rules.ΒΆ
executeruns an async function body in a fresh Dynamic Worker, a Cloudflare Worker loaded at runtime.ΒΆ- It sets
globalOutbound: nullto block outbound network access.ΒΆ - Imports, exports, and
fetchare unavailable.ΒΆ - The program can call only declared capabilities.ΒΆ
- API and MCP allow 120 requests per IP per 60 seconds.ΒΆ
- Execute also allows 6 per IP and 300 total per 60 seconds.ΒΆ
- Native Cloudflare counters apply separately per location.ΒΆ
These routes exist today. A reusable cartridge36 for agent interfaces remains planned. A cartridge is a package for one job, with its implementation and required infrastructure.ΒΆ
Content asset cache
ContentStore shares completed catalogs, search indexes, learning decks, and graph views within one Worker isolate.
Concurrent cold requests each perform their own asset reads.
The cache stores a value only after its read and validation succeed.
Failed or interrupted reads leave the cache empty.ΒΆ
Pending reads must not use a shared promise, fiber, latch, or response body. Those values can belong to the first requestβs runtime context. Warm requests reuse decoded data without new asset I/O.ΒΆ
test/cold-content-runtime.test.ts sends concurrent first requests through a fresh local Worker.
Its asset adapter adds a delay to make cold reads overlap.
The test uses workerd, production content routes, and the reader wrapper.ΒΆ
How to check
- Read the MCP connection card.ΒΆ
- Read the A2A card.ΒΆ
- Read OpenAPI.ΒΆ
- Compare the descriptions with
apps/site/src/capabilities/index.ts.ΒΆ - Use the
tools/listrequest in llms.txt.ΒΆ - Search for a public document.ΒΆ
- Read the document.ΒΆ
- Run
pnpm --filter @rat-stack/site testfor protocol routing, rate limiting, and sandbox behavior.ΒΆ - Confirm the live cards and capability list before advertising a new agent path.ΒΆ
- Run
pnpm --filter @rat-stack/site exec vitest run test/cold-content-runtime.test.tsto check cold-request isolation.ΒΆ
Check a new deploy live as well as running local tests.ΒΆ
Sources
- Hosted application routes. GitHub joelhooks/rat-stack. Discovery, content negotiation, and protocol routing. Accessed 2026-10-01.
- Agent discovery content. GitHub joelhooks/rat-stack. MCP versions, connection examples, and discovery cards. Accessed 2026-10-01.
- Hosted capability registry. GitHub joelhooks/rat-stack. The hosted content and execute capability list. Accessed 2026-10-01.
- Code-mode Worker loader. GitHub joelhooks/rat-stack. Isolated execution and outbound network limits. Accessed 2026-10-01.
- Native rate limits. GitHub joelhooks/rat-stack. Request counters and per-stage namespaces. Accessed 2026-10-01.
Last changed 2026-10-10 in 978dccc. Source on GitHub. Change log.
Linked from
- Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
Hosted agent interfaces β Discovery documents, HTTP, MCP, A2A, and bounded code mode expose the public reference to agents.
- Change log. What changed in the files served here, newest first.
Hosted agent interfaces β edited: docs: point live docs, skills and Brain pages at apps/site
- Full agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
- Rat Stack systems | rat-stack. The systems rat-stack ships, the standard each keeps, and how to check it.
Hosted agent interfaces β Discovery documents, HTTP, MCP, A2A, and bounded code mode expose the public reference to agents.
- rat-stack. An Effect stack so pure (aspirational) Kit Langton will blush.
The hosted agent interfaces run in Mischief; extracting them into a separate cartridge is still work to do.
- Source change history (log.md). The generated change log as Markdown.
Hosted agent interfaces β edited: docs: point live docs, skills and Brain pages at apps/site
Unlinked mentions (1)
- Purpose and boundaries of rat-stack (VISION.md) β Coming: extract the existing agent front door in apps/site (REST, MCP, A2A, code-mode sandbox, rate limits) into a cartridge that a project provides instead of inherits.