---
title: "Should robots.txt Disallow Your MCP Endpoint? What 11,572 Requests to Our /mcp Show"
slug: robots-txt-disallow-mcp-endpoint
published: 2026-11-30T13:11:54.847844+00:00
updated: 2026-11-30T13:11:54.847844+00:00
author: "M Asif Rahman"
author_url: https://ar.bd
category: "AI Readiness"
tags: check:B2, check:D1, MCP, robots.txt, RFC 9309, Claude-User, AI crawlers
description: "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."
url: https://aiscan.site/blog/robots-txt-disallow-mcp-endpoint
---

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

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

The AIScan check that touches this is B2, explicit AI bot rules, in the [bot access dimension](/docs/checks/bot-access). 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 Nov | 23 Nov to 30 Nov 13:07 UTC | Status codes |
|---|---|---|---|
| Claude-User | 509 (53 IPs) | 11,045 (68 IPs) | 200, 401, 202 |
| meta-externalagent | 1 | 12 | 401 on `/mcp`, 405 on `/api/mcp` |
| Amazonbot | 0 | 2 | 401, 405 |
| GPTBot | 0 | 1 | 401 |
| OAI-SearchBot | 1 | 0 | 401 |
| PerplexityBot | 1 | 0 | 401 |
| **Crawlers, total** | **3** | **15** | **never 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](/blog/fake-ai-crawler-traffic-own-logs) shows why that caveat matters. The earlier period is covered in more depth in [60 days of usage on a public MCP server](/blog/public-mcp-server-usage-60-days).

## Why a Disallow line does less than you expect

**Robots.txt was never access control.** [RFC 9309](https://www.rfc-editor.org/rfc/rfc9309.html) 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](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler), "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](/blog/stealth-crawling-user-driven-fetching-debate).

**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").

| Bot | Group it obeys | `/mcp` | `/api/mcp` |
|---|---|---|---|
| GPTBot, meta-externalagent, Amazonbot, OAI-SearchBot, PerplexityBot, ClaudeBot | its own named group (`Allow: /`) | allowed | **allowed** |
| Claude-User, Googlebot, any unlisted bot | `*` | allowed | disallowed |

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](/blog/robots-txt-parsers-disagree-ai-crawlers), 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](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports) (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](https://www.rfc-editor.org/rfc/rfc9728.html#section-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](/blog/mcp-protected-resource-metadata-path-fix) 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](https://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header), 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](/blog/robots-txt-starter-for-ai-crawlers). On WordPress, [ThinkRank](https://thinkrank.ai) 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](https://aiscan.site/) or browse [every fix guide](/guides).

