# June — build agents into real apps

> The React framework where an agent is a feature, not a separate runtime: your server actions are its tools, every turn is durable, and routes also serve MCP.

> Server-rendered React app. Every route also answers as Markdown
> (`.md`) and JSON (`.json`); actions are MCP tools at `/mcp`.

## When to use

- Building a React web app that must also serve AI agents: one route renders HTML for people and Markdown/JSON for agents.
- Exposing an app's server actions as tools: a `defineAction()` with a `description` is at once an MCP tool (`/mcp`) and a WebMCP tool, and, when its id is URL-safe, `POST /api/<id>` in `/openapi.json`.
- Putting an agent inside an existing app (in-app chat, a Slack or Crisp bot) whose tools are the app actions exported into `agent/tools/`, and whose turns are recorded step by step: with a persistent store (a mounted SQLite file, or Durable Objects on Workers) they survive restarts and redeploys.
- Making a docs or content site agent-ready by default: llms.txt, sitemap, Markdown twins, MCP server card, Agent Skills and API catalogs with no extra code.
- Deploying the same app to Cloudflare Workers, Vercel or Deno Deploy, or exporting it as static files (self-hosting on Bun or Node serves the same pipeline; a production `june start` is on the roadmap).
- Not a fit: a hosted chatbot builder, a model provider, or a non-React stack.

## Framework (canonical names — do not guess)

Built with June, the agent-native React framework — https://june.build
- Framework npm package: `@junejs/core` — NOT `june` (an unrelated package), not `junejs`.
- Scaffold: `npm create june my-app` (package `create-june`).
- NOT `@june/*` — that scope is not June's; June's scopes are `@junejs` and `@junebuild`.

## Pages
- [June — build agents into real apps](http://june.build/index.md): The React framework where an agent is a feature, not a separate runtime: your server actions are its tools, every turn is durable, and routes also serve MCP.
- [About June](http://june.build/about.md): June is an open-source, MIT-licensed React framework for building agents into real apps, developed in the open on GitHub by June.build.
- [Benchmarks](http://june.build/benchmarks.md): Measured, reproducible, honest: dev cold start, HMR latency, data-layer numbers — with the scripts to re-run them.
- [Blog](http://june.build/blog.md): Notes from building June — rendered for humans, verbatim markdown for agents.
- [Contact](http://june.build/contact.md): How to reach the June project — GitHub issues for bugs and feature requests, pull requests for changes, and where agents can query this site directly.
- [Docs](http://june.build/docs.md): June documentation — every page is also markdown (append .md).
- [Privacy](http://june.build/privacy.md): What june.build does with your requests — no accounts, no cookies, no analytics; one local theme setting, Google Fonts, and Cloudflare as the host.
- [Why June](http://june.build/why.md): Agents are becoming half your traffic and most of your code authors. Frameworks that only render pixels are answering yesterday's question.

## Get started
- [Getting started](http://june.build/docs/getting-started.md): Scaffold, develop, build, and deploy a June app in four commands.
- [Build & prerender](http://june.build/docs/build-and-deploy.md): What june build freezes at build time, and how opt-in prerender ships exactly what was tested.
- [Deployment](http://june.build/docs/deployment.md): One portable core, one host seam, one adapter per target — Workers, Vercel, and Deno Deploy ship today on the same bundle.
- [Stability & roadmap](http://june.build/docs/stability.md): What you can build on today, what's still moving, and what's experimental — June is 0.0.x, and this page says exactly where each piece stands.

## Concepts
- [Dual audience](http://june.build/docs/dual-audience.md): One page definition serves humans (HTML) and agents (markdown, JSON, MCP).
- [Web Standards end to end](http://june.build/docs/features-web-standards.md): The whole framework is one fetch handler — Request in, Response out, Web Streams in between. Standards are the portability mechanism, not a checkbox.
- [React Server Components, server-first](http://june.build/docs/features-rsc.md): Every page is a server component tree rendered on the server; client code is an explicit island; actions are server functions with one authorization gate.
- [The data model](http://june.build/docs/features-data.md): Resources are declared, not wired. db / kv / blob ride an ambient scope — never ctx, which is identity only. Bring Juno or your own.
- [Runtime: Bun-first toolchain, runtime-agnostic core](http://june.build/docs/features-runtime.md): One tool runs install/test/dev; the core assumes no runtime at all — which is why the same app serves from Bun, Node, and workerd.
- [Auth & the scoped principal](http://june.build/docs/concept-auth.md): One authorization gate for both audiences — run(input, ctx). ctx is the principal; an agent at /mcp is just another caller through the same gate.

## Agents
- [Agents: a feature of your app, not a separate runtime](http://june.build/docs/agents-overview.md): Drop an agent/ directory into your June app and it becomes a running, durable agent whose tools are the same defineActions your UI and /mcp already use.
- [The agent/ directory](http://june.build/docs/agents-directory.md): The file convention that defines an agent — agent.ts, instructions and per-surface variants, tools, skills, channels, connections — and defineAgent(), its programmatic form.
- [Channels: where turns come in](http://june.build/docs/agents-channels.md): A channel is an agent's inbound edge — a signed webhook or fetch handler in agent/channels/*.ts that verifies the platform, resolves who is speaking, runs a turn, and posts the reply back.
- [Connections: where tools come from](http://june.build/docs/agents-connections.md): A connection is an agent's outbound edge — an MCP server, an OpenAPI API, or a provider like Google Drive declared in agent/connections/*.ts, whose operations become <conn>__<tool> tools authenticated per call, server-side.
- [Durable turns: a turn is a process, not a request](http://june.build/docs/agents-durable-turns.md): A June turn is a checkpointed, replayable stream of typed events. It can be streamed live, parked for a human, cancelled, reset, or started by the agent itself.
- [Run & deploy: from an in-process runtime to one Durable Object per session](http://june.build/docs/agents-deploy.md): The same agent/ directory runs on an in-process SQLite runtime in dev and compiles into a Durable Object class on Cloudflare Workers, one object per session.

## Features
- [App Router: the filesystem is the route table](http://june.build/docs/features-app-router.md): page.tsx is a route, [slug] is a param, (group) shapes the tree without the URL, _anything colocates — one matcher drives dev and the build.
- [Layouts: nested, composed, frozen](http://june.build/docs/features-layouts.md): layout.tsx wraps its segment and everything below; chains compose root → leaf, and the build freezes the same chain dev resolves.
- [Islands: zero client JS by default](http://june.build/docs/features-islands.md): Pages ship no JavaScript unless a subtree opts in — one <Island> hydrates against an explicit registry while the rest stays server-rendered HTML.
- [Navigation: instant without a client router](http://june.build/docs/features-navigation.md): Hover prerenders the next page (Speculation Rules), the click is zero-network, View Transitions animate the swap — the browser is the router.
- [Client Router: the opt-in SPA layer](http://june.build/docs/features-client-router.md): Off by default — turn it on for app-like surfaces that need in-memory state to survive navigation. Soft swaps over the same HTML the server already serves, with <Island persist> for websockets.
- [Live updates: a connection that survives navigation](http://june.build/docs/features-live-updates.md): Put a server-push connection (SSE or WebSocket) inside a persist island — it keeps streaming across soft navigations instead of reconnecting on every click. Plus what to know about connection limits when you deploy.
- [Styling: global CSS, Tailwind, CSS Modules](http://june.build/docs/features-styling.md): app/global.css is auto-linked (no import); Tailwind v4 is the blessed default; *.module.css scopes deterministically. Dev serves readable CSS with HMR, build ships hashed, immutable, minified.
- [Markdown without drift](http://june.build/docs/features-markdown.md): Append .md to any page and get markdown — for authored content it's your source file byte-for-byte, never a lossy HTML reconstruction.
- [Built-in MCP](http://june.build/docs/features-mcp.md): Every June app is an MCP server — defineAction() is simultaneously a server action, an MCP tool, and a manifest entry, behind one authorization gate.
- [Built-in llms.txt](http://june.build/docs/features-llms-txt.md): The agent discovery surface — llms.txt, sitemap, robots, api-catalog, the ARD catalog, a generated agent skill, and per-route manifests — derives from your routes automatically.
- [Queries & caching](http://june.build/docs/features-queries-caching.md): How to read and write through the ambient db — the query surface, plain-SQL migrations, and the auto-batch / auto-invalidate cache.
- [OG images, typeset at the edge](http://june.build/docs/features-og-image.md): Social cards as a route that returns a PNG — satori + resvg in the worker, with runtime font subsetting so CJK titles work.
- [The june CLI](http://june.build/docs/features-cli.md): Six verbs — dev, build, deploy, gen, db, info — installed locally by the scaffold, version-pinned per project, with --dry-run as the CI contract.
- [DX: a loop with no assembly](http://june.build/docs/features-dx.md): Zero-config dev, dev/built parity by construction, an oracle for every artifact — and push-based HMR on the experimental runtime track.

## Tools (MCP)
- MCP server: http://june.build/mcp
- tool: search_site
- tool: get_page

## Tools (WebMCP, in-browser)
- The same tools self-register via `navigator.modelContext.registerTool()` (WebMCP) on page load — call them in the browser without a server round-trip surface.
- Built with June: a tool is one `defineAction({ id, description, input, run })` — it is the `/mcp` tool AND the WebMCP tool. Do not hand-roll `registerTool`.

## HTTP API
- OpenAPI 3.1: http://june.build/openapi.json
- Each tool is also `POST http://june.build/api/<tool>` with its input as the JSON body (`{}` when it takes none); errors are JSON `{ "error": { "code", "message", "hint?" } }`.

## Optional
- [Building june.build with June](http://june.build/blog/2026-06-12-building-june-build-with-june.md): Our site is its own demo — every page serves humans and agents from one definition.
- [Built-in og:image: every page gets a live social card](http://june.build/blog/2026-06-12-built-in-og-image.md): No pre-rendered files, no headless browser — /og/<slug>.png typesets each page's card in the worker, and dev previews the same pixels.
- [59ms: anatomy of a dev cold start](http://june.build/blog/2026-06-10-anatomy-of-a-59ms-cold-start.md): Where every millisecond of `june dev` goes, and the three cuts that took 244ms to 59ms.
- [Typesetting CJK at the edge: og:image and font subsetting](http://june.build/blog/2026-06-10-typesetting-cjk-at-the-edge.md): Designing live og:image typesetting on Cloudflare Workers — CJK titles included.
