p0stman

Agentic Web Architecture

The Four-Layer Framework for Agent-Ready Websites

Last updated: March 2026

Agentic web architecture is a four-layer framework that makes websites discoverable, understandable, and actionable by AI agents. The four layers — Discovery, Comprehension, Action, and Agent-to-Agent — transform a traditional website into one that AI tools like ChatGPT, Claude, and Perplexity can find, understand, interact with, and even delegate tasks to. Sites implementing all four layers see 2.3x higher AI citation rates and can handle automated workflows from AI agents.

The web was built for humans. HTML, CSS, JavaScript, links, buttons, forms — every layer of the web stack assumes a person is on the other side of the screen, reading content and clicking things. That assumption held for thirty years. It no longer holds.

As of early 2026, AI agents — autonomous software that can browse, read, reason, and act — account for a growing share of web traffic. OpenAI's ChatGPT, Anthropic's Claude, Google's Gemini, and Perplexity all send crawlers and real-time agents across the web. When a user asks ChatGPT "find me a web development agency that builds AI agents," the model doesn't search Google, click results, and read pages the way a human would. It dispatches agents that scan discovery files, parse structured data, call APIs, and compile answers from machine-readable sources.

If your website only speaks human, these agents walk past it. Agentic web architecture is the systematic approach to making your website fluent in both languages — human-readable for visitors, and machine-actionable for AI agents. This guide is the definitive technical reference for the four-layer framework that achieves this.

Why Do Websites Need an Agent-Ready Architecture?

The shift from a human-readable web to a machine-actionable web is not hypothetical. It is already measurable. Consider the data points:

  • AI Overviews now appear on 47% of US Google searches (SE Ranking, January 2026). Content that appears in AI Overviews gets clicked — but only if Google's AI can parse and cite it.
  • Pages with structured data are 2.3x more likely to appear in AI-generated answers. JSON-LD is no longer just a rich snippets play — it's how AI models understand what your page is about.
  • LLM-referred visitors convert at 4.4x the rate of organic search visitors (Adobe, 2025). They arrive with high intent because the AI already pre-qualified the answer.
  • MCP adoption has passed 10,000 registered servers (Smithery, February 2026). AI agents are actively looking for MCP endpoints to interact with.

The websites that will win the next decade are not the ones with the best design or the most content — they are the ones that AI agents can discover, understand, and use. Agentic web architecture is the systematic way to become one of those websites.

The Four-Layer Framework: An Overview

Agentic web architecture organises the work into four distinct layers, each building on the one before it. Think of them as concentric rings of capability: each layer makes your website more useful to AI agents.

Layer Purpose Key Files / Endpoints Effort Impact
1. Discovery AI agents find your site and understand what it offers robots.txt, llms.txt, agents.md, mcp.json, agent.json 1-2 hours High
2. Comprehension AI agents understand your content deeply JSON-LD schema, /api/ai/context, answer capsules 1-3 days Very High
3. Action AI agents interact with your services programmatically /api/mcp, WebMCP, data-mcp-tool attributes 2-5 days High (for SaaS)
4. Agent-to-Agent Other AI agents communicate with your agent directly /api/agent, .well-known/agent.json 1-3 days Medium (growing)

The layers are deliberately ordered by effort and prerequisite. You cannot meaningfully build Layer 3 (Action) without Layer 1 (Discovery) — an AI agent needs to find your MCP server before it can call your tools. Similarly, Layer 4 (Agent-to-Agent) builds on having both discoverable endpoints and actionable tools.

Most businesses should implement Layers 1 and 2 immediately — they cost almost nothing and have the highest return on effort. Layers 3 and 4 are where competitive differentiation starts, and they become essential as AI agent usage accelerates through 2026 and 2027.

1

Layer 1: Discovery

How AI agents find your website and learn what it offers

Before an AI agent can understand your content or use your tools, it needs to know you exist. Discovery is the foundation layer — the collection of files and signals that tell AI agents "this website is here, and here's what it does."

Traditional websites relied on Google indexing to be found. AI agents use a different set of discovery mechanisms. Some overlap with SEO (robots.txt, sitemaps), but many are entirely new protocols that emerged specifically for the agentic web.

robots.txt: Permitting AI Crawlers

The first gate is the oldest file on the web: robots.txt. Many websites inadvertently block AI crawlers because their default robots.txt only permits Googlebot and Bingbot. In 2026, there are at least 15 AI-specific crawlers that check your robots.txt before indexing your content.

If your robots.txt blocks these crawlers — or worse, uses a blanket Disallow: / for unknown user agents — your content is invisible to every AI model except those that ignore robots.txt (which is a declining minority as the industry self-regulates).

Here is the complete list of AI crawlers you should explicitly allow:

# AI Crawlers — Explicitly Allow
User-agent: GPTBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: OAI-SearchBot
Allow: /

User-agent: ClaudeBot
Allow: /

User-agent: anthropic-ai
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: Google-Extended
Allow: /

User-agent: Applebot-Extended
Allow: /

User-agent: Amazonbot
Allow: /

User-agent: cohere-ai
Allow: /

User-agent: Meta-ExternalAgent
Allow: /

User-agent: Bytespider
Allow: /

User-agent: Diffbot
Allow: /

User-agent: YouBot
Allow: /

User-agent: CCBot
Allow: /

User-agent: FacebookBot
Allow: /

# Point all agents to discovery files
# Sitemap: https://yourdomain.com/sitemap.xml

Key implementation detail: use explicit Allow: / rules rather than relying on the absence of Disallow. Some AI crawlers treat missing rules as "proceed with caution" rather than "allowed." Explicit permission is clearer.

Also allow API paths that agents might call directly:

# Allow agent-facing endpoints
Allow: /api/mcp
Allow: /api/agent
Allow: /api/ai/
Allow: /llms.txt
Allow: /agents.md
Allow: /context.md
Allow: /mcp.json
Allow: /.well-known/agent.json

# Disallow private areas
Disallow: /admin
Disallow: /api/admin
Disallow: /dashboard

llms.txt: The Plain-Text Summary for AI Models

llms.txt is a plain-text file at the root of your website that provides a concise summary of what your site does, what tools are available, and how to interact with it. Think of it as a README for AI models.

The standard was proposed by Jeremy Howard (fast.ai) in late 2024 and has seen roughly 10% adoption across commercial websites as of early 2026. Its adoption is growing because it solves a real problem: when an AI model lands on your site, it needs to quickly understand what it's looking at without parsing hundreds of pages of HTML.

The file sits at public/llms.txt and should contain:

  • What the site/product does (1-2 paragraphs)
  • Key features or capabilities
  • Available tools/APIs (if any)
  • Authentication method
  • Quick-start curl examples
  • Links to deeper documentation

Keep it under 100 lines. AI models have context windows, and a concise llms.txt that fits entirely in one context window is more useful than a sprawling document the model needs to summarise.

agents.md: Detailed Agent Instructions

Where llms.txt is a summary, agents.md is the full manual. This Markdown file at public/agents.md provides detailed instructions that AI agents use when interacting with your site.

While llms.txt tells an agent "here's what we do," agents.md tells it "here's exactly how to work with us." It should include:

  • Detailed tool schemas with parameter descriptions
  • Error handling instructions (what to do when a tool returns an error)
  • Rate limits and usage policies
  • Authentication flows (step-by-step)
  • Example workflows for common tasks
  • Data formats for requests and responses

This file becomes essential once you have Layer 3 (Action) tools. Without it, AI agents will attempt to use your tools through trial and error, which leads to poor user experiences and wasted API calls.

mcp.json: The Machine-Readable Manifest

mcp.json is a JSON file at your site root that provides a structured, machine-parseable manifest of your MCP capabilities. While llms.txt and agents.md are for AI models to read as context, mcp.json is for AI agent frameworks to parse programmatically.

{
  "name": "your-product",
  "description": "One-line description of what your product does",
  "endpoint": "https://yourdomain.com/api/mcp",
  "protocol": "mcp-http",
  "auth": {
    "type": "bearer",
    "header": "Authorization"
  },
  "tools": [
    {
      "name": "search_content",
      "description": "Search across all published content",
      "scope": "read",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": { "type": "string", "description": "Search query" }
        },
        "required": ["query"]
      }
    },
    {
      "name": "get_services",
      "description": "List available services and pricing",
      "scope": "read"
    }
  ]
}

The critical fields are endpoint (where to send MCP requests), auth (how to authenticate), and tools (what's available). Agent frameworks use this to auto-configure tool access without human intervention.

.well-known/agent.json: The A2A AgentCard

The AgentCard is the A2A protocol's discovery mechanism. Located at .well-known/agent.json, it tells other AI agents about your agent's capabilities, skills, and communication endpoint.

This is the Layer 4 discovery file — it's how your agent announces itself to other agents. Without it, no A2A communication is possible because other agents have no way to discover your agent's skills or endpoint.

{
  "name": "Your Agent Name",
  "description": "What your agent does — one line",
  "url": "https://yourdomain.com/api/agent",
  "provider": {
    "organization": "Your Company",
    "url": "https://yourdomain.com"
  },
  "version": "1.0.0",
  "capabilities": {
    "streaming": false,
    "pushNotifications": false
  },
  "authentication": {
    "schemes": ["bearer"]
  },
  "defaultInputModes": ["text"],
  "defaultOutputModes": ["text"],
  "skills": [
    {
      "id": "answer-questions",
      "name": "Answer Questions",
      "description": "Answer questions about our services and expertise",
      "tags": ["support", "information"],
      "examples": ["What services do you offer?", "Tell me about your AI agent capabilities"]
    }
  ]
}

Discovery Layer Implementation Priority

File Priority Effort Impact When to Add
robots.txt Critical 10 minutes Unblocks everything else Immediately
llms.txt High 30 minutes High — first thing AI reads Day 1
agents.md Medium 1-2 hours Medium — essential once you have tools When you build Layer 3
mcp.json Medium 15 minutes Medium — machine-readable discovery When you build Layer 3
.well-known/agent.json Low (for now) 15 minutes Low today, high by 2027 When you build Layer 4
2

Layer 2: Comprehension

How AI agents understand your content and capabilities

Discovery tells AI agents you exist. Comprehension tells them what you actually do, what you know, and whether your content is trustworthy. This is the layer that determines whether AI models cite you, recommend you, or ignore you.

Comprehension has the highest return on investment of any layer. The techniques here — JSON-LD structured data, answer capsules, and context endpoints — directly influence whether your content appears in AI Overviews, ChatGPT responses, and Perplexity citations.

JSON-LD Structured Data

JSON-LD (JavaScript Object Notation for Linked Data) is structured metadata embedded in your page's <head> section. It tells machines — search engines and AI models alike — the precise meaning of your content using a standardized vocabulary (Schema.org).

The impact is substantial: pages with proper JSON-LD structured data are 2.3x more likely to appear in AI Overviews (Authoritas study, 2025). AI models use structured data not just for ranking but for fact extraction — when a model needs to answer "how much does X cost?" it looks for Product schema with price properties before parsing free-text content.

The most impactful schema types for AI visibility, in order:

Schema Type AI Impact Best For Why AI Models Use It
FAQPage Highest Any page with Q&A content Direct question-answer pairs AI can cite verbatim
HowTo Very High Step-by-step guides, tutorials Structured steps AI can extract and present
Article High Blog posts, guides, documentation Establishes authorship, publication date, freshness
WebApplication High SaaS products, tools, calculators Identifies interactive tools AI can recommend
Organization Medium Homepage, about page Entity resolution — AI knows who you are
BreadcrumbList Medium All pages Helps AI understand site structure and hierarchy

Use the @graph pattern to combine multiple schema types on a single page. A guide page should include Article + FAQPage + BreadcrumbList in a single JSON-LD block. For a deep technical reference on implementation, see our dedicated guide on JSON-LD schema for AI visibility.

Answer Capsules: Front-Loading the Direct Answer

AI language models cite the first 30% of page content 44% of the time. This statistic — from research by Authoritas and confirmed by multiple SEO studies in 2025 — means that where you place your answer matters enormously.

An answer capsule is a 1-2 sentence direct answer to the page's core question, placed at the very top of the content, wrapped in a <div class="answer-capsule">. It serves three purposes:

  1. AI citation — Models pull from it when generating answers
  2. Featured snippets — Google uses it for position zero results
  3. Human UX — Visitors get their answer immediately (especially AI-referred visitors who already have context)

The answer capsule at the top of this page is an example. It directly answers "what is agentic web architecture" in two sentences, before the introduction expands on it. Every content page in your agentic web architecture should follow this pattern.

/api/ai/context: A Machine-Readable Context Endpoint

While JSON-LD is embedded in individual pages, the /api/ai/context endpoint provides a single, centralised, machine-readable summary of your entire business. AI agents call this endpoint to get a complete picture without crawling every page.

The response should be a JSON object containing:

{
  "company": {
    "name": "Your Company",
    "description": "What you do — 2-3 sentences",
    "founded": "2020",
    "url": "https://yourdomain.com"
  },
  "services": [
    {
      "name": "Service Name",
      "description": "What it includes",
      "pricing": "From £3,000"
    }
  ],
  "features": ["Feature 1", "Feature 2", "Feature 3"],
  "contact": {
    "email": "hello@yourdomain.com",
    "phone": null,
    "bookingUrl": "https://yourdomain.com/contact"
  },
  "tools": {
    "mcp": "https://yourdomain.com/api/mcp",
    "a2a": "https://yourdomain.com/api/agent"
  },
  "content": {
    "guides": "/guides",
    "caseStudies": "/case-studies",
    "blog": "/blog"
  }
}

This endpoint is public, requires no authentication, and should return a stable JSON structure. AI agents can cache it and use it as context when generating responses about your business. It's the Comprehension layer's equivalent of llms.txt, but structured for machine parsing rather than human reading.

Content Structure Optimization for AI

Beyond schema and answer capsules, how you structure your content affects how well AI models can extract and cite it. The principles:

  • Every H2/H3 should be a standalone answerable question. "How much does an MCP server cost to build?" is better than "Costs." AI models use headings to segment content and match questions to answers.
  • Use tables for comparative data. AI models extract table data more reliably than prose. If you're comparing features, pricing tiers, or options, use a table.
  • Include specific numbers and dates. "Costs £3,000-£8,000 and takes 1-2 weeks" is citable. "Costs vary and timelines depend on scope" is not.
  • Write declaratively. "Businesses implementing MCP servers see 15-40% increases in AI-referred traffic" is better than "You might see improvements in your traffic from AI sources."
  • Minimum 4,000 words for substantive pages. Thin content (under 2,000 words) is consistently outperformed in AI citations by comprehensive, authoritative pages.
3

Layer 3: Action

How AI agents interact with your services programmatically

Layers 1 and 2 make your website readable by AI. Layer 3 makes it usable. This is where the web shifts from a collection of documents to a collection of capabilities — and where the real business value of agentic web architecture begins.

Layer 3 is built on the Model Context Protocol (MCP), an open standard that lets AI models call tools exposed by your website. When a user asks ChatGPT "book a consultation with p0stman," the AI can call your MCP endpoint directly instead of navigating your website like a human would.

MCP Server: Your Website's Tool API

An MCP server is an API endpoint — typically at /api/mcp — that exposes your website's capabilities as callable tools. The endpoint responds to two types of requests:

  • GET — Returns server information: name, description, available tools, auth requirements. This is the discovery payload that AI agents read to understand what your server can do.
  • POST — Executes a tool or accesses a resource. The request body specifies which tool to call and with what parameters. Authentication is typically via Bearer token.

The tools you expose depend on your business. Here are examples across different business types:

Business Type Example Tools Auth Required
Agency / Consultancy get_services, search_case_studies, check_availability, request_consultation Public (read) / Bearer (write)
SaaS Product get_pricing, create_account, search_docs, get_status Public (info) / API key (actions)
E-commerce search_products, get_product_details, check_stock, add_to_cart Public (search) / Session (cart)
Content Publisher search_articles, get_article, get_author_bio, get_latest Public (all read)
Property / Real Estate search_listings, get_listing, check_availability, schedule_viewing Public (search) / Bearer (actions)

A basic MCP server implementation in Next.js:

// app/api/mcp/route.ts
import { NextRequest, NextResponse } from "next/server";

const tools = [
  {
    name: "get_services",
    description: "List all available services with pricing",
    inputSchema: { type: "object", properties: {} }
  },
  {
    name: "search_content",
    description: "Search published articles and guides",
    inputSchema: {
      type: "object",
      properties: {
        query: { type: "string", description: "Search query" }
      },
      required: ["query"]
    }
  }
];

// GET — Server info (public)
export async function GET() {
  return NextResponse.json({
    name: "your-product",
    version: "1.0.0",
    description: "Your product description",
    tools
  });
}

// POST — Tool execution
export async function POST(req: NextRequest) {
  const { tool, params } = await req.json();

  switch (tool) {
    case "get_services":
      return NextResponse.json({
        services: [
          { name: "Web Development", price: "From £3,000" },
          { name: "AI Integration", price: "From £5,000" }
        ]
      });
    case "search_content":
      // Implement your search logic
      return NextResponse.json({ results: [] });
    default:
      return NextResponse.json(
        { error: "Unknown tool" },
        { status: 400 }
      );
  }
}

WebMCP: Browser-Native Tool Registration

WebMCP is the client-side complement to your server-side MCP endpoint. It uses the navigator.modelContext API (previewed in Chrome 146) to register tools directly with AI models running in the browser.

The key distinction: server-side MCP is for AI agents making API calls. WebMCP is for AI assistants embedded in the browser (like Gemini in Chrome, or ChatGPT's browsing feature) that are already on your page and want to understand what actions are available.

What to register via WebMCP:

  • Lightweight, public, no-auth tools only. Things like "get_services" or "search_content" — never tools that require API keys or modify data.
  • 2-3 tools maximum. Browser AI models have limited context for tool registration. Register your most useful public capabilities.
  • Graceful degradation. WebMCP is Chrome-only as of March 2026. Your component must be a no-op on unsupported browsers.

data-mcp-tool: HTML Attributes for AI

The declarative approach to WebMCP. Instead of registering tools via JavaScript, you annotate HTML elements with data-mcp-tool and data-mcp-description attributes. Browser AI models scan the DOM for these attributes to understand what page elements do.

<form
  data-mcp-tool="contact_form"
  data-mcp-description="Submit a contact request to discuss a project"
  action="/api/contact"
  method="POST"
>
  <input name="email" data-mcp-param="email"
         data-mcp-description="Contact email address" />
  <textarea name="message" data-mcp-param="message"
            data-mcp-description="Project description" />
  <button type="submit">Send</button>
</form>

<a href="/services"
   data-mcp-tool="view_services"
   data-mcp-description="View all available services and pricing">
  Our Services
</a>

This is the lowest-effort way to make your website's interactive elements understandable to AI. Even without a full MCP server, adding these attributes to your forms, CTAs, and key navigation elements improves how browser AI models interact with your site.

Layer 3 Security Considerations

Exposing tools to AI agents introduces security surface area that doesn't exist on traditional websites. Key principles:

  • Separate public and authenticated tools. Read-only tools (get_services, search_content) can be public. Write tools (create_account, submit_form) must require authentication.
  • Rate limit aggressively. AI agents can call tools much faster than humans click buttons. Implement per-IP and per-token rate limits on your MCP endpoint.
  • Validate all inputs. AI agents may pass unexpected parameter types or values. Validate and sanitize every input, just as you would for a public API.
  • Never expose secrets in WebMCP tools. Client-side tool handlers run in the browser. Never include API keys, database credentials, or internal URLs in WebMCP-registered tools.
  • Log everything. Track which tools are called, by whom, and how often. This data is essential for understanding how AI agents use your site and detecting abuse.
4

Layer 4: Agent-to-Agent (A2A)

How other AI agents communicate with your agent directly

Layer 4 is the most forward-looking part of the framework. While Layers 1-3 optimise your website for AI models that serve human users, Layer 4 enables direct agent-to-agent communication — where an AI agent representing one business talks to an AI agent representing your business, without a human in the loop.

The protocol that enables this is A2A (Agent-to-Agent), developed by Google and adopted by a growing ecosystem of agent frameworks. It uses JSON-RPC 2.0 over HTTPS, making it straightforward to implement on any web server.

The /api/agent Endpoint

The A2A endpoint handles three types of HTTP requests:

  • GET — Returns the AgentCard (the same content as .well-known/agent.json), enabling discovery via the endpoint URL itself.
  • OPTIONS — CORS preflight. Essential because A2A requests come from different origins.
  • POST — Receives a task from another agent, processes it, and returns a response.

The A2A request/response format follows JSON-RPC 2.0:

// Incoming request from another agent
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tasks/send",
  "params": {
    "id": "task-uuid-here",
    "message": {
      "role": "user",
      "parts": [{ "type": "text", "text": "What services do you offer for AI integration?" }]
    }
  }
}
// Your agent's response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "id": "task-uuid-here",
    "status": { "state": "completed" },
    "artifacts": [{
      "parts": [{
        "type": "text",
        "text": "We offer three AI integration services: ..."
      }]
    }]
  }
}

A2A Task Lifecycle

A2A tasks follow a state machine with four possible states:

  1. submitted — The requesting agent has sent a task. Your agent acknowledges receipt.
  2. working — Your agent is processing the request. For streaming implementations, you can send partial updates during this state.
  3. completed — Your agent has finished processing and returns the result as one or more artifacts.
  4. failed — Processing failed. Return an error message explaining why.

For most implementations, the simple synchronous pattern (receive task, process, return completed) is sufficient. Streaming and push notifications are available for long-running tasks but add complexity that most businesses don't need initially.

Agent Session Logging

Every A2A interaction should be logged to a database table. This serves two purposes: understanding how other agents interact with your business, and debugging when things go wrong.

CREATE TABLE agent_sessions (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  task_id text,
  user_agent text,
  task_text text,
  response_text text,
  source text,
  status text DEFAULT 'completed',
  processing_time_ms integer,
  created_at timestamptz DEFAULT now()
);

CREATE INDEX idx_agent_sessions_created_at ON agent_sessions (created_at DESC);
CREATE INDEX idx_agent_sessions_source ON agent_sessions (source);

Review these logs regularly. They tell you what other AI agents are asking your agent, which skills are most used, and where your agent's responses could be improved.

Implementation Order: What to Build First

You do not need to implement all four layers at once. In fact, trying to build everything simultaneously is a mistake — each layer should be validated before moving to the next. Here is the recommended implementation sequence:

Phase 1: Foundation (Day 1)

Effort: 2-4 hours. Zero engineering required.

  • 1. Update robots.txt to allow all AI crawlers
  • 2. Create llms.txt with a concise site summary
  • 3. Add JSON-LD schema (@graph with Article + FAQPage + BreadcrumbList) to all content pages
  • 4. Add answer capsules to every content page

Phase 2: Deep Comprehension (Week 1)

Effort: 1-2 days. Light engineering.

  • 5. Build /api/ai/context endpoint
  • 6. Create context.md (deep context document)
  • 7. Restructure key content pages (question-based headings, tables, specific numbers)
  • 8. Set up bot crawl tracking in middleware

Phase 3: Action Layer (Week 2-3)

Effort: 3-5 days. Moderate engineering.

  • 9. Build MCP server (/api/mcp) with 2-3 public read tools
  • 10. Create mcp.json manifest
  • 11. Write agents.md with tool documentation
  • 12. Add WebMCP registration component
  • 13. Add data-mcp-tool attributes to key interactive elements

Phase 4: Agent-to-Agent (Week 3-4)

Effort: 2-3 days. Moderate engineering.

  • 14. Build A2A endpoint (/api/agent) with JSON-RPC 2.0
  • 15. Create .well-known/agent.json AgentCard
  • 16. Set up agent_sessions logging table
  • 17. Register on A2A directory (a2aregistry.org)

Reference Implementation: p0stman.com's Complete Stack

This framework is not theoretical — it's the architecture running on p0stman.com right now. Here is a walkthrough of every component:

Component File / Path Layer Status
robots.txt app/robots.ts Discovery Live — 17 AI crawlers allowed
llms.txt public/llms.txt Discovery Live — 80 lines
agents.md public/agents.md Discovery Live
mcp.json public/mcp.json Discovery Live
AgentCard public/.well-known/agent.json Discovery / A2A Live — registered on a2aregistry.org
JSON-LD schema Every content page Comprehension Live — @graph with Article + FAQPage + BreadcrumbList
Answer capsules Every content page Comprehension Live — div.answer-capsule at top of content
/api/ai/context app/api/ai/context/route.ts Comprehension Live
MCP server app/api/mcp/route.ts Action Live — 4 tools
WebMCP components/web-mcp-registration.tsx Action Live — 3 public tools
A2A endpoint app/api/agent/route.ts A2A Live — processes tasks via Gemini
Bot tracking middleware.ts Monitoring Live — 13 bots tracked to Supabase

The total implementation took approximately two weeks of focused development, starting from a standard Next.js site that had none of these capabilities. The bulk of the time was spent on Layer 3 (the MCP server) and Layer 4 (the A2A endpoint). Layers 1 and 2 were completed in the first day.

Since going live, the bot tracking data has shown consistent crawling from GPTBot, ClaudeBot, and PerplexityBot across all content pages, with MCP discovery requests appearing within the first week of deployment.

Monitoring and Analytics for the Agentic Web

Traditional web analytics (Google Analytics, Plausible, Vercel Analytics) track human visitors. Agentic web architecture requires a second analytics layer that tracks AI interactions separately.

Bot Crawl Tracking

The most basic monitoring: which AI crawlers visit your site, how often, and which pages they request. Implement this in your middleware or as a lightweight API endpoint.

CREATE TABLE bot_crawls (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  bot_name text,
  user_agent text,
  path text,
  method text,
  country text,
  created_at timestamptz DEFAULT now()
);

CREATE INDEX idx_bot_crawls_created_at ON bot_crawls (created_at DESC);
CREATE INDEX idx_bot_crawls_bot_name ON bot_crawls (bot_name);

Detect bots by matching user-agent strings in your middleware. Here are the patterns to match:

Bot User-Agent Contains Purpose
GPTBotGPTBotOpenAI content crawling
ChatGPT-UserChatGPT-UserChatGPT browsing feature
ClaudeBotClaudeBotAnthropic content crawling
PerplexityBotPerplexityBotPerplexity search crawling
Google-ExtendedGoogle-ExtendedGoogle AI training / Overviews
Applebot-ExtendedApplebot-ExtendedApple Intelligence features
AmazonbotAmazonbotAmazon AI assistant
BytespiderBytespiderByteDance/TikTok AI

MCP Call Logging

Log every MCP tool call to understand how AI agents use your tools. Track the tool name, input parameters, response time, and whether the call succeeded or failed. This data tells you which tools are most valuable and where to invest development effort.

A2A Session Analytics

The agent_sessions table captures every A2A interaction. Review it weekly to understand what other agents ask, which skills they use, and what questions your agent struggles to answer. This data directly informs improvements to your agent's knowledge base and skills.

LLM Referral Tracking

When AI tools like ChatGPT cite your content, they append ?utm_source=chatgpt.com (or similar) to the link. Track these UTM parameters to measure how much traffic AI citations drive. Our analytics show LLM-referred visitors have a 45% lower bounce rate and 4.4x higher conversion rate than organic search visitors.

Cost and Effort Estimates for Each Layer

Layer DIY Effort Agency Cost Ongoing Maintenance ROI Timeline
1. Discovery 2-4 hours £500-£1,000 Update when tools change Weeks (immediate crawling)
2. Comprehension 1-3 days £1,000-£3,000 Update schema with content 1-3 months (AI citations)
3. Action 3-5 days £2,000-£5,000 Maintain tools, monitor usage 2-6 months (agent interactions)
4. Agent-to-Agent 2-3 days £1,500-£3,000 Monitor sessions, improve responses 6-12 months (agent ecosystem growing)
All Four Layers 1-2 weeks £3,000-£8,000 1-2 hours/month Compounding

The most important insight from this table: Layers 1 and 2 cost almost nothing but deliver the highest immediate impact. A senior developer can implement both layers in a single day. Layers 3 and 4 require more engineering but provide competitive differentiation that will become increasingly valuable as AI agent traffic grows.

The infrastructure costs are negligible. Discovery files are static (free to serve). Comprehension endpoints add minimal server load. MCP and A2A endpoints process a fraction of the traffic that human-facing pages receive. The primary cost is developer time, not infrastructure.

Common Architecture Mistakes and How to Avoid Them

Having implemented this framework across multiple production sites, here are the mistakes we see most often:

1. Building Layer 3 Before Layer 2

Teams get excited about MCP servers and skip content optimization. An MCP server with great tools is useless if AI models don't know your site exists or understand what you do. Always establish Comprehension before building Action capabilities.

2. Exposing Too Many Tools

Some implementations expose 20+ MCP tools. AI models have limited context for tool selection — presenting too many tools degrades the quality of tool calls. Start with 2-3 core tools and expand based on usage data. Quality of tool descriptions matters more than quantity of tools.

3. Forgetting Authentication on Write Operations

We've seen MCP servers where tools like "create_order" or "submit_form" require no authentication. Any AI agent (or malicious script) can call these endpoints. Every tool that modifies data must require authentication.

4. No Monitoring

Building the infrastructure without tracking how it's used. You need bot crawl logs, MCP call logs, and A2A session logs to understand what's working. Without data, you're guessing.

5. Static llms.txt That Gets Stale

llms.txt should be updated whenever your site's capabilities change — new tools, new content sections, updated pricing. Treat it like a README that you maintain alongside your codebase.

6. Ignoring Answer Capsules

The single highest-impact change for AI citation is adding a direct answer at the top of every content page. It costs nothing, takes minutes per page, and directly affects whether AI models cite you. Yet it's the most commonly skipped step.

7. Missing CORS on A2A Endpoints

A2A requests come from different origins. If your /api/agent endpoint doesn't handle OPTIONS preflight requests and set appropriate CORS headers, other agents' requests will be blocked by the browser's same-origin policy.

The Future: Where Agentic Web Architecture Is Heading

As of March 2026, we're in the early adopter phase of the agentic web. Here's what's coming:

WebMCP Standardization (2026-2027)

Chrome 146's navigator.modelContext API is the first browser-native implementation of WebMCP. Firefox and Safari will follow with their own implementations. By late 2027, expect a W3C working group proposal for standardizing browser-to-AI-model communication. This will make WebMCP as standard as Service Workers or the Web Payments API.

MCP Registry Consolidation

Currently, MCP servers are listed across multiple directories (Smithery, mcp.so, PulseMCP). Expect consolidation into 1-2 dominant registries by 2027, similar to how npm won the JavaScript package registry war. Registering your MCP server early establishes presence.

A2A Maturity

The A2A protocol is currently at version 1.0, with limited adoption outside Google's ecosystem. As more businesses deploy AI agents that need to coordinate (travel booking, financial services, healthcare), A2A will become the standard for agent interoperability. Early implementations position you ahead of competitors who will scramble to add A2A support later.

Agentic Commerce

The most transformative shift: AI agents making purchasing decisions on behalf of users. "Find me the best web development agency for an AI project under £10,000" triggers an agent that evaluates multiple businesses by reading their llms.txt, calling their MCP tools, and comparing structured data. The businesses with full agentic web architecture will be evaluated. Those without it won't even be in the running.

AI-Native Websites

Eventually, some businesses will build websites that are agent-first and human-second. The primary interface will be tools and APIs for AI agents, with a human-readable UI as a secondary presentation layer. This sounds radical today, but it mirrors how many SaaS products already prioritise their API over their web UI for power users.

Frequently Asked Questions

What is agentic web architecture?

Agentic web architecture is a four-layer framework that makes websites discoverable, understandable, and actionable by AI agents. The four layers — Discovery, Comprehension, Action, and Agent-to-Agent — transform a traditional website into one that AI tools like ChatGPT, Claude, and Perplexity can find, understand, interact with, and delegate tasks to.

What are the four layers of agentic web architecture?

The four layers are: Layer 1 Discovery (how AI agents find your site — robots.txt, llms.txt, agents.md, mcp.json, agent.json), Layer 2 Comprehension (how agents understand your content — JSON-LD, answer capsules, context endpoints), Layer 3 Action (how agents interact with your site — MCP servers, WebMCP, data-mcp-tool attributes), and Layer 4 Agent-to-Agent (how agents communicate with your agent — A2A protocol, JSON-RPC endpoints).

How does agentic web architecture differ from traditional SEO?

Traditional SEO optimizes for search engine crawlers that index and rank pages. Agentic web architecture goes further by making websites machine-actionable — AI agents can not only read your content but interact with your services, execute tools, and coordinate tasks. SEO is a subset of the Comprehension layer, but agentic architecture adds Discovery files, Action endpoints, and Agent-to-Agent communication.

Which layer of agentic web architecture should I implement first?

Start with Layer 1 Discovery and Layer 2 Comprehension — they require the least engineering effort and have the highest immediate impact on AI visibility. Updating robots.txt, adding llms.txt, implementing JSON-LD schema, and adding answer capsules can be done in a single day and immediately improve how AI models cite your content.

What is the difference between MCP and A2A in agentic web architecture?

MCP (Model Context Protocol) sits in Layer 3 Action and lets AI models use your website's tools — booking appointments, querying data, performing calculations. A2A (Agent-to-Agent) sits in Layer 4 and lets other AI agents communicate with your agent directly, delegating complex tasks and receiving structured responses. MCP is tool-level, A2A is agent-level.

How much does it cost to implement agentic web architecture?

Layer 1 Discovery costs nothing — just static files. Layer 2 Comprehension is minimal (JSON-LD schema, content restructuring). Layer 3 Action requires engineering time to build an MCP server, typically 2-5 days of development. Layer 4 A2A is 1-3 days for a basic implementation. Total cost for all four layers on an existing site: roughly 1-2 weeks of senior developer time or £3,000-£8,000 at agency rates.

Do I need all four layers of agentic web architecture?

No. Layers 1 and 2 are essential for any website that wants AI visibility. Layer 3 (Action) is valuable for SaaS products, marketplaces, and any business with services that can be automated. Layer 4 (Agent-to-Agent) is currently most relevant for API-heavy businesses, platforms, and companies building their own AI agents. Implement the layers that match your business model.

What results can I expect from implementing agentic web architecture?

Sites with proper structured data are 2.3x more likely to appear in AI Overviews. Content with answer capsules gets cited 44% of the time when it appears in the first 30% of the page. MCP-enabled sites receive direct tool calls from AI assistants, converting AI interactions into actual business outcomes. Early adopters report 15-40% increases in AI-referred traffic within 60 days of implementation.

Make Your Website Agent-Ready

We implement the full four-layer agentic web architecture for businesses that want AI agents to find, understand, and interact with their services. From discovery files to MCP servers to A2A endpoints — the complete stack.