AI agents are no longer just reading pages. They're clicking buttons, filling forms, completing purchases, and booking appointments. If your site doesn't expose a structured interface those agents can discover and use, you're leaving them to guess — and guessing fails.
The Model Context Protocol (MCP) gives you a standard way to say: here's what my site can do, here's how to call it, here's what you get back. This guide walks through exactly how to add that interface so agents can find and use it reliably.
What MCP Actually Is
MCP is an open protocol for exposing tools, resources, and prompts from a server to an AI agent. Think of it as an API contract written in a language LLMs already understand. Instead of an agent scraping your checkout page and hoping the DOM makes sense, it calls a declared tool like create_booking with typed parameters and gets a structured response.
The protocol covers three core primitives:
- Tools — callable functions the agent can invoke (search, add to cart, book a slot)
- Resources — data the agent can read (product catalog, availability, account state)
- Prompts — reusable templates that guide the agent through multi-step flows
Step 1: Create Your MCP Server
Your MCP server is the backend that handles agent requests. It can be a standalone service or a thin layer in front of your existing API.
You need to implement two things:
- A
tools/listendpoint that describes every tool you expose - A
tools/callendpoint that executes a tool when the agent calls it
A minimal tool definition looks like this:
{
"name": "search_products",
"description": "Search the product catalog by keyword and return matching items.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search term"
}
},
"required": ["query"]
}
}
The description field matters more than you think. Agents use it to decide whether to call the tool at all. Write it like documentation for a junior developer who has never seen your site.
Step 2: Publish a Discovery File
Agents need to find your MCP server before they can use it. The convention is a well-known URL:
https://yourdomain.com/.well-known/mcp.json
This file tells agents where your MCP server lives and what transport it uses. A minimal example:
{
"mcpServers": {
"your-site": {
"url": "https://yourdomain.com/mcp",
"transport": "http"
}
}
}
Serve this file with Content-Type: application/json and make sure it's publicly accessible — no auth, no redirects. Agents crawl it the same way they'd crawl robots.txt.
You can see a live example of this pattern at https://scovant.com/.well-known/mcp.json.
Step 3: Define Tools That Match Real Agent Tasks
Don't expose your internal API surface verbatim. Think about what tasks an agent actually needs to complete on your site and build tools around those tasks.
Good candidates:
search_products— keyword search returning structured resultsget_product— fetch full details for a single item by IDadd_to_cart— add an item with quantity, returning updated cart stateget_availability— check open slots for a bookable resourcecreate_booking— submit a booking with required fieldsget_order_status— look up an order by ID
Each tool should:
- Have a clear, unambiguous
description - Use a strict
inputSchemawith all required fields marked - Return a consistent, typed response
- Return a useful error message when something goes wrong — not a raw HTTP 500
Step 4: Handle Authentication
Most tools need some form of auth. MCP supports OAuth 2.0 as the standard mechanism. The flow:
- Your discovery file or server metadata advertises an authorization endpoint
- The agent (or the platform running it) completes the OAuth flow
- The agent passes a bearer token with every tool call
- Your server validates the token before executing anything
For tools that don't touch user-specific data — search, catalog browsing, availability checks — you can skip auth entirely. Keep the authenticated surface as small as possible.
Step 5: Test Against Real Agents
This is where most implementations fall apart. You can declare a perfectly valid MCP server and still have agents fail on it because:
- A tool description is ambiguous and the agent calls it with wrong parameters
- A flow works with one LLM but breaks with a cheaper model that interprets the schema differently
- A deploy changes a response shape and you don't catch it until an agent fails in production
Static checkers won't catch any of this. They verify that your discovery file exists and your schema is valid JSON. They can't tell you whether a real agent can actually complete a purchase flow end to end.
Scovant runs real AI agents against your site — including MCP-exposed tools — to verify that actual flows complete, not just that things are declared correctly. It tests across multiple LLM agents so you catch the cases where one model handles your tool descriptions fine and another gets confused. And it plugs into CI so regressions get caught before they reach production.
Step 6: Add Structured Data and Robots Hints
Not every agent will use MCP. Some still crawl. Cover both bases:
- Add
robots.txtrules that allow the crawlers you want and block the ones you don't - Keep a sitemap current so crawlers find your pages
- Use structured data (Schema.org) for products, events, and organizations so agents that read pages get typed data instead of raw HTML
These don't replace MCP — they complement it. An agent might use your MCP tools for transactional flows and fall back to crawling for discovery.
Common Mistakes
Vague tool descriptions. If your description says "gets stuff," the agent won't know when to call it. Be specific.
Missing error handling. Agents retry on failure. If your server returns an unstructured error, the agent has no way to recover gracefully. Return structured errors with a message field.
No versioning. Tool schemas change. Add a version field to your discovery file or server metadata so agents can detect breaking changes.
Testing only the happy path. Real agents hit edge cases — out-of-stock items, fully booked slots, invalid inputs. Test those paths explicitly.
Single-model testing. What works with one LLM may not work with another. The way you word a description, the way you structure a response — these affect how different models interpret your tools.
Checklist
- [ ] MCP server running and reachable
- [ ]
tools/listreturns all tools with clear descriptions and strict schemas - [ ]
tools/callexecutes tools and returns structured responses - [ ]
/.well-known/mcp.jsonis publicly accessible with correct transport info - [ ] OAuth 2.0 configured for tools that touch user data
- [ ] Structured errors returned on failure
- [ ] Real agent tests running against actual flows, not just schema validation
- [ ] CI regression detection so deploys don't break agent-readiness silently
- [ ] Multi-model testing across different LLMs
Where to Go From Here
The Scovant docs cover how agent-readiness testing works and what Scovant checks beyond static validation. The scoring methodology is public so you know exactly what's being measured and why. If you want to see what a real agent does on your site rather than what a checklist says it should do, that's the place to start.
The agentic web is moving fast. Getting your MCP interface right now means agents can use your site reliably instead of failing silently and routing users somewhere else.