AIScan fix guide cover: Should robots.txt block your MCP endpoint? Check B2, MCP and robots.txt cards, a broken page turning into a fixed one.
AIScan fix guide cover: Should robots.txt block your MCP endpoint? Check B2, MCP and robots.txt cards, a broken page turning into a fixed one.
AI Readiness

Should robots.txt Disallow Your MCP Endpoint? What 11,572 Requests to Our /mcp Show

Should robots.txt block your MCP endpoint? 18 of 11,572 requests to our /mcp came from crawlers. Why a 401 or 405 and noindex matter more than a Disallow.

30 Nov 2026 7 min read
#MCP#robots.txt#RFC 9309#Claude-User#AI crawlers

This guide covers B2 · Bot Access, D1 · Discoverability.

Table of contents

Mostly no. A Disallow line for your MCP endpoint keeps out the few search and training crawlers that wander onto it, and it does nothing about the traffic that endpoint exists to serve: a person's AI assistant calling tools through a connector. In our own log, 18 of 11,572 requests to aiscan.site's two MCP paths came from crawlers, and the protection that worked on every one of them was the HTTP status code, not robots.txt.

This guide shows the numbers, explains why a robots.txt rule for /mcp is weaker than it looks (ours turned out to apply to almost nobody), and gives the three response-level fixes that matter more. Budget about 15 minutes.

TL;DR

QuestionShort answerSource
Do crawlers hit MCP endpoints?Rarely: 18 of 11,572 requests on our two paths, 25 Aug to 30 Nov 2026our ai_crawler_hits log
Does Disallow: /mcp stop a user's connector?Not reliably; our connector traffic arrived on a disallowed path all quarterour log, RFC 9309 §1
What should a GET to /mcp return?401 with WWW-Authenticate and resource_metadata, or 405 with AllowMCP transports spec, RFC 9728 §5.1
Should the endpoint be indexed?No: send X-Robots-Tag: noindexstandard header
If you add a Disallow anywayRepeat it in every named bot group, or it applies only to unnamed botsRFC 9309 §2.2.1

The AIScan check that touches this is B2, explicit AI bot rules, in the bot access dimension. It asks for a named group per major AI crawler, and those named groups are exactly what cancels a Disallow written under *.

What 11,572 requests to our MCP paths show

aiscan.site runs two MCP endpoints. /mcp takes OAuth; /api/mcp is the older one that takes a bearer key. We log every request from a known AI user agent to a table called ai_crawler_hits. The query below groups requests to /mcp, /mcp/ and /api/mcp by user agent, status code and period, and counts distinct hashed IP addresses. We split the window at 23 November because our server was moved off Lovable that day and began logging every JSON-RPC message, so the two periods are not comparable and are never summed into one rate.

User agent (claimed)25 Aug to 22 Nov23 Nov to 30 Nov 13:07 UTCStatus codes
Claude-User509 (53 IPs)11,045 (68 IPs)200, 401, 202
meta-externalagent112401 on /mcp, 405 on /api/mcp
Amazonbot02401, 405
GPTBot01401
OAI-SearchBot10401
PerplexityBot10401
Crawlers, total315never a 200

Two things stand out. Claude-User is Anthropic's user-initiated fetcher, and here it is people running the AIScan connector inside Claude. That is 99.8% of the traffic. The crawlers, meanwhile, never received a 200: every one got a 401 or a 405 and nothing to index. These are user agents as claimed in the request header, not verified by reverse DNS, and our test of fake crawler traffic shows why that caveat matters. The earlier period is covered in more depth in 60 days of usage on a public MCP server.

Why a Disallow line does less than you expect

Robots.txt was never access control. RFC 9309 says so in its own words: "These rules are not a form of access authorization." Its security section adds that listing paths in robots.txt "exposes them publicly and thus makes the paths discoverable."

The traffic that matters is user-driven. According to Anthropic's crawler help page, "When individuals ask questions to Claude, it may access websites using a Claude-User agent," and disabling it "prevents our system from retrieving your content in response to a user query." A connector the user installed is a different thing: the user pointed Claude at your endpoint on purpose. Our robots.txt disallows /api/, which covers /api/mcp, and Claude-User has no group of its own in that file, so the * rule is the one that applies to it. Claude-User still made 5,253 requests to /api/mcp across both periods. Our log does not record fetches of /robots.txt, so we cannot say whether the connector read the file, only that the rule did not keep the connector out. The wider argument is in the debate over user-driven fetching.

A named group cancels your * rules. This was the surprise in our own file. RFC 9309 §2.2.1 says crawlers must find the group that matches their product token "and then obey the rules of the group," falling back to * only "if no matching group exists." Our file opens with User-agent: * and Disallow: /api/, then gives 17 named AI bots a group that says Allow: /. Those 17 never inherit the Disallow.

Our robots.txt, evaluated bot by bot

Fetched from aiscan.site on 30 November 2026 and evaluated with a short script that follows RFC 9309: the matching named group wins, and within it the longest path match wins (§2.2.2, "The most specific match is the match that has the most octets").

BotGroup it obeys/mcp/api/mcp
GPTBot, meta-externalagent, Amazonbot, OAI-SearchBot, PerplexityBot, ClaudeBotits own named group (Allow: /)allowedallowed
Claude-User, Googlebot, any unlisted bot*alloweddisallowed

That table explains the log. All 7 crawler requests to /api/mcp came from meta-externalagent and Amazonbot, and both were allowed there by our own file. Python's urllib.robotparser gives a different answer again: it uses the first matching rule rather than the longest, so it reports /api/mcp as allowed for every bot, including Googlebot. Robots.txt parsers disagree on more than this, so test with a parser that follows the RFC.

The fix: make the endpoint answer correctly

Step 1: return 401 or 405 to a plain GET, never an HTML page

According to the MCP transports specification (version 2025-06-18), for a GET to the endpoint "the server MUST either return Content-Type: text/event-stream in response to this HTTP GET, or else return HTTP 405 Method Not Allowed." If the endpoint needs authorization, answer 401 and point at your metadata. According to RFC 9728 §5.1, the resource_metadata parameter of WWW-Authenticate carries the URL of that metadata, which is how a client finds where to authorize. Our /mcp answers like this, verified on 30 November 2026:

HTTP/2 401
content-type: application/json
cache-control: no-store
www-authenticate: Bearer realm="mcp", resource_metadata="https://aiscan.site/.well-known/oauth-protected-resource"

If the metadata path is wrong, a client stalls. Fixing the protected resource metadata path covers the common mistakes.

Step 2: add X-Robots-Tag: noindex

Our /api/mcp sends x-robots-tag: noindex, nofollow with its 405 and Allow: POST, OPTIONS. /mcp does not, which is a gap in our own setup: if a link to it ever appeared somewhere a search engine trusts, nothing in the response asks it to stay out of the index. On nginx, add it inside the endpoint's location block:

location /mcp {
    add_header X-Robots-Tag "noindex, nofollow" always;
    # proxy_pass to your MCP server as before
}

always matters: according to the nginx add_header documentation, without it nginx adds the header only to 2xx and 3xx responses, so a 401 or 405 would go out without it.

Step 3: if you keep a Disallow, put it in every group

A Disallow: /mcp that sits only under User-agent: * reaches only bots you did not name. Repeat it in each named group, as in the robots.txt starter for AI crawlers. On WordPress, ThinkRank is the simplest place to keep that file: one plugin rather than three fighting over one robots.txt, and it migrates settings from Rank Math, Yoast, AIOSEO and SEOPress. Yoast and Rank Math also have file editors if you already run one.

Who can skip step 3: if your endpoint already answers 401 or 405 and sends noindex, a Disallow adds little. Leave it out rather than publish a path list that says where your tools live.

How to check it worked

Scan your site first. Check B2 reports which AI crawlers have a named group, which tells you where a Disallow must be repeated:

npx aiscan-cli yoursite.com

Then check the endpoint by hand:

curl -sI https://yoursite.com/mcp

Expected: 401 with a www-authenticate line containing resource_metadata=, or 405 with an allow: line, plus x-robots-tag: noindex. Failure looks like 200 with content-type: text/html: your framework's catch-all page is answering, and a crawler can index it. Fix the route before anything else.

For the next check, run a full scan on AIScan or browse every fix guide.

Frequently asked questions

Should I add Disallow: /mcp to robots.txt?

Usually it adds little. In aiscan.site's log only 18 of 11,572 requests to its MCP paths came from crawlers, and every one got a 401 or 405. A correct status code and an X-Robots-Tag: noindex header protect the endpoint; a Disallow only asks crawlers to stay away and publishes the path.

My MCP endpoint returns 200 with an HTML page on GET. What is wrong?

A framework catch-all route is answering before your MCP handler. The MCP transports specification says a GET must get either an event stream or a 405. Route GET on the endpoint to your MCP server, or return 405 with an Allow header, and send 401 with WWW-Authenticate if it needs authorization.

I disallowed /api/ but GPTBot still hits /api/mcp. Why?

Your file probably gives GPTBot its own group. Under RFC 9309 a bot obeys only the group that names it and falls back to * only when none does, so a Disallow under * never reaches it. Repeat the Disallow inside every named group.

Python's robotparser says my disallowed path is allowed. Which is right?

Trust a parser that follows RFC 9309. Python's urllib.robotparser applies the first matching rule, so an Allow: / above a Disallow: /api/ wins. RFC 9309 says the longest match wins, which makes /api/mcp disallowed for bots that use the * group.

Will a Disallow stop Claude from using my MCP server through a connector?

Do not count on it. Claude-User kept calling aiscan.site's /api/mcp, a path its robots.txt disallows for that agent, through the whole period we measured. The connector exists because a user pointed Claude at the endpoint; authorization is the control that applies.

My MCP endpoint answers 401 but clients cannot find where to log in. What is missing?

The WWW-Authenticate header needs a resource_metadata parameter pointing at your /.well-known/oauth-protected-resource document, as RFC 9728 section 5.1 defines. Check that the URL in it returns 200 with JSON.

Can my MCP endpoint show up in Google?

It can if a crawler finds a link to it and gets an indexable response. A 401 or 405 is not indexed as a page, and X-Robots-Tag: noindex on the endpoint removes the remaining doubt.

Does listing the MCP endpoint in robots.txt help agents find it?

It is a comment at best, and RFC 9309 notes that listing paths makes them discoverable. Agents find MCP servers through a server card at /.well-known/mcp/server-card.json or your docs, not through robots.txt.

M Asif Rahman

About the author

Entrepreneur, curious about AI

I have been building companies for a long time, and lately most of my curiosity goes to AI. AIScan is a small personal project I built on a flight from Dubai to Narita. I use it to understand how ready the web is for AI agents, and I share what the scans teach me.

Related guides

Browse every guide by check and platform