← All guides

How We Built an Agent-Ready Website with MCP, llms.txt, and Markdown Endpoints

An agent-ready website is a site that AI assistants such as Claude and ChatGPT can read and use as easily as people can. fofefa.com is our reference implementation: every page has a Markdown twin, the site publishes llms.txt, an OpenAPI description, an API catalog, an MCP server, agent skills and WebMCP tools, and agents can sign up through OAuth 2.1. This guide explains how each piece works and why we built it that way.

What does "agent-ready" mean?

An agent-ready website lets software agents do three things without scraping HTML: discover what the site offers, read its content in a compact format, and act through documented interfaces. We used the checks from isitagentready.com as a public checklist, and we treat each check as something an agent actually needs, not as a box to tick.

One source of truth for people and agents

The most important design decision is that all content lives in a single JavaScript module, lib/content.js. The HTML pages, the Markdown versions, llms.txt, the JSON API, the MCP tools, the WebMCP tools and the JSON-LD structured data are all generated from it. When we change a sentence, every interface changes with it, so an agent never reads an older version of the truth than a person does.

// lib/content.js
export const services = [
  { id: 'agents-automation', title: 'AI agents and automation', short: 'Agents that do real work inside your tools.', ... },
  ...
];

How does Markdown content negotiation work?

Every HTML URL also answers in Markdown when the client sends Accept: text/markdown. In Next.js 16 this runs in proxy.js (formerly middleware). It parses the Accept header with q-values, so a browser that sends text/html first still gets HTML, and it adds Vary: Accept so caches keep the two versions apart.

// proxy.js (simplified)
export function proxy(request) {
  const md = prefersMarkdown(request.headers.get('accept'))
    ? markdownForPath(request.nextUrl.pathname)
    : null;
  if (!md) return NextResponse.next();
  return new NextResponse(md, {
    headers: {
      'Content-Type': 'text/markdown; charset=utf-8',
      Vary: 'Accept',
      'x-markdown-tokens': String(estimateTokens(md)),
    },
  });
}

Try it yourself:

curl -H 'Accept: text/markdown' https://fofefa.com/

The x-markdown-tokens header gives a rough token count, so an agent can decide whether the page fits in its context before it reads it.

llms.txt and llms-full.txt

/llms.txt is a short Markdown index: who we are, the main pages with one-line descriptions, and links to the machine interfaces. /llms-full.txt concatenates the Markdown version of every page, so an assistant can load the whole site in one request. Both are route handlers generated from the same content module.

robots.txt with named AI crawlers and Content Signals

Our robots.txt has a general group and a named group for each major AI crawler, including GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-User, Claude-SearchBot, PerplexityBot, Google-Extended and Applebot-Extended. Each group carries a Content Signals line that states how the content may be used:

User-agent: OAI-SearchBot
Content-Signal: search=yes, ai-input=yes, ai-train=yes
Allow: /

Naming each crawler explicitly removes any doubt about whether search and answer engines may cite the site.

Agents often start from a single HTTP response. Every response from fofefa.com carries Link headers that point to the API catalog, the OpenAPI description, llms.txt, the MCP server card, the agent skills index and the sitemap. The API catalog at /.well-known/api-catalog follows RFC 9727 and is served as application/linkset+json.

In Next.js we serve all /.well-known/* files from normal route handlers by rewriting them before the file system is checked:

// next.config.mjs
async rewrites() {
  return { beforeFiles: [{ source: '/.well-known/:path*', destination: '/wk/:path*' }] };
}

A public JSON API with OpenAPI

The read-only API under /api returns services, projects, contact details and full-text search results. /openapi.json describes it, so any agent framework that understands OpenAPI can call it without custom code.

An MCP server on the same domain

The MCP server at https://fofefa.com/mcp is a stateless Streamable HTTP endpoint that returns plain JSON responses, which fits serverless hosting well. It exposes read-only tools such as search_site, list_services, list_projects, get_project and get_contact, plus whoami and submit_request for agents that have signed in. We describe the architecture in detail in MCP Server Architecture: Connecting Your Business API to Claude and ChatGPT.

Agent skills and WebMCP

An agent skill is a SKILL.md file that teaches an assistant how to use a service. Ours is listed in /.well-known/agent-skills/index.json with a sha256 digest of the exact bytes we serve, so a client can verify it.

WebMCP brings the same tools into the browser. A small script registers tools with document.modelContext.registerTool, so an assistant running in the visitor's browser can search the site or open the sign-up form without guessing at buttons. The sign-up form is also marked up declaratively with toolname and tooldescription attributes.

OAuth 2.1 so agents can sign up

People sign up on /signup. Agents can do the same through OAuth 2.1: the authorization server metadata (RFC 8414) and protected resource metadata (RFC 9728) are published under /.well-known, clients register themselves with dynamic client registration (RFC 7591), and access tokens are ES256-signed JWTs. When an agent calls a protected MCP tool without a token, the server answers 401 with a WWW-Authenticate header that points to the protected resource metadata, which is how the agent finds out where to sign in. A plain-language auth.md explains the flow.

Structured data for search and answer engines

Every page carries JSON-LD: the organization as a ProfessionalService with address, phone and founder, an FAQPage, a Service for each service page, and Book, Movie and VideoGame entries for our own projects. Section headings are written as the questions people ask, and each section starts with a one-paragraph direct answer, which is the format answer engines quote.

What is still open

DNS-based discovery (DNS-AID) needs an SVCB record at _index._agents.fofefa.com, and our DNS provider does not support SVCB records yet. The record and the /ai/index.md file it points to are ready.

Want the same for your site?

We build agent-ready websites and MCP servers for businesses. See MCP servers and agent-ready websites or tell us what you want to build.