Table of contents
A 406 Not Acceptable on a discovery file means the server read the agent's Accept header, decided it could not match it, and refused to send anything. For a JSON or text file that an agent asks for by its own media type, the right answer is almost always to serve the file and label it correctly, or to send a plain 404 when the file is missing. We sent 200 requests to our own five sites on 28 November 2026 and found exactly one source of 406s: aiscan.site's fallback for paths that do not exist.
This guide shows what the 406 does to an agent, how to find the rule that sends it, and how to fix it on nginx, in an app route and at a static host. It takes about 15 minutes once you know where the rule lives.
Quick summary
| If you see | What it means | Fix | Time |
|---|---|---|---|
| 406 on a file that exists | A strict negotiation rule refuses the agent's Accept value | Ignore Accept for that file and send its default type | 10 min |
| 406 on a file that does not exist | A catch-all handler answers "HTML only" before it answers "not found" | Return 404 for unknown paths, whatever the Accept | 15 min |
200 but application/json on a card | The file works but is labelled with a generic type | Send application/mcp-server-card+json | 5 min |
200 application/octet-stream on /.well-known/api-catalog | The host does not know the extension-less file | Map it to application/linkset+json | 5 min |
The check IDs this touches are P2 (MCP server card), P1 (API catalog) and C1 (content negotiation), all listed under capabilities checks.
Why a discovery file should not refuse an Accept header
Agents now ask for discovery files by name. The MCP Server Card extension's discovery document, fetched from the extension repository on 28 November 2026, says in its own words that "A client requesting a Server Card SHOULD send Accept: application/mcp-server-card+json". According to RFC 9727 §6.2, verified on 28 November 2026, a /.well-known/api-catalog location "MUST support the Linkset format of application/linkset+json". So a well-behaved client sends a specific type, not */*.
HTTP gives the server two choices when it cannot match. According to RFC 9110 §12.4.1, the origin server "can either honor the header field by sending a 406 (Not Acceptable) response or disregard the header field by treating the response as if it is not subject to content negotiation". Section 15.5.7 adds that a 406 means the server "is unwilling to supply a default representation".
Think of it as a shop assistant who has the item in stock but refuses to hand it over because you asked for it by its brand name. For a file that exists in one format only, the 406 helps nobody. The agent gets an error body instead of the JSON it could have parsed, and nothing in the extension tells it to retry with */*.
A 406 on a missing file is worse. According to RFC 9110, a 404 means the server "did not find a current representation for the target resource". A 406 tells the agent something exists in another format, so a crawler may keep the URL, retry it, or report "not acceptable" where the real answer was "not here".
What our own five sites answer (28 November 2026)
We fetched five discovery paths on aiscan.site, xspeedcache.com, storeseo.com, bettershield.ai and thinkrank.ai with eight Accept values each: none, */*, application/json, application/mcp-server-card+json, application/linkset+json, application/ai-catalog+json, text/markdown and text/plain. That is 200 requests with curl and a browser user agent, 28 November 2026 around 13:15 UTC.
| File | Sites with the file | Refused any Accept value | Content-Type sent |
|---|---|---|---|
/.well-known/api-catalog | 5 of 5 | 0 | application/linkset+json on 4, application/octet-stream on 1 |
/.well-known/mcp/server-card.json | 3 of 5 | 0 | application/json on all 3 |
/.well-known/ai-catalog.json | 1 of 5 | 0 | application/json |
/llms.txt | 5 of 5 | 0 | text/plain |
/robots.txt | 5 of 5 | 0 | text/plain |
All 19 files that exist ignored Accept and sent their default, which is what RFC 9110 allows. None of the three cards used the card media type, so a client that checks Content-Type against what it asked for will see a mismatch.
The 406s came from paths that do not exist. On aiscan.site, /mcp/server-card (the location the extension reserves for a card), /.well-known/agent-card.json and any made-up path answered as follows:
| Accept sent | aiscan.site (missing path) | The other four sites (missing path) |
|---|---|---|
none or */* | 404 text/html | 404 text/html |
text/html | 404 text/html | 404 text/html |
application/json | 406 {"error":"Only HTML requests are supported here"} | 404 |
application/mcp-server-card+json | 406 | 404 |
text/markdown or text/plain | 406 | 404 |
A browser never sees this, because it sends text/html. An MCP client following the extension does. We filed it with the site team.
Find the rule that sends the 406
- Reproduce it with one header:
curl -s -o /dev/null -w '%{http_code}\n' -H 'Accept: application/json' https://yoursite.com/does-not-exist. A 406 here and a 404 without the header confirms anAcceptrule. - Read the response's
Serverheader and body. On aiscan.site it wasserver: nginxwith a JSON error, so the rule sits in front of the app. - Search your config for the message or for
$http_accept:grep -rn 'http_accept\|406' /etc/nginx/. In an app, search route handlers for406orreq.accepts(.
Fix it
nginx. Keep any HTML-only rule away from discovery paths and from the 404 fallback, and serve the files with explicit types. A .json file takes its type from nginx's types map, so default_type alone does nothing for it. According to the nginx core module docs, fetched from nginx.org on 28 November 2026, an empty types { } block followed by default_type makes one location emit one type for every request.
location = /.well-known/api-catalog {
types { }
default_type application/linkset+json;
}
location = /.well-known/mcp/server-card.json {
types { }
default_type application/mcp-server-card+json;
}
location / {
try_files $uri $uri/ =404;
}
If you have a check such as if ($http_accept !~ "text/html") { return 406; }, move it inside the one location that needs it, never above the file lookup.
An app route (Express, Next.js, Hono, a Supabase or Lovable edge function). Check for the file before you look at Accept. If the path is unknown, return 404. If it is known, send the one representation you have with its real Content-Type, and add Vary: Accept only if you really serve more than one.
A static host. The other four sites sent no 406 at all, for files that exist or files that do not. Static hosts usually guess the type from the file extension instead. The risk there is the label, as in the application/octet-stream row above, so set the header in your host's own headers configuration and confirm it with the curl loop below.
A localhost lab with two Python handlers, one strict and one lenient, showed the difference on the same card. With the card Accept, Node's fetch() got 200 from both for the real card, and 406 against 404 for a missing one. curl and fetch() both send */* by default, so a quick manual test without the header hides the bug.
Verify the fix
Run the scan first: npx aiscan-cli yoursite.com. Check P2 should read the card, and P1 should find the API catalog. Then check by hand:
for a in 'application/mcp-server-card+json' 'application/json' 'text/markdown'; do
curl -s -o /dev/null -w "%{http_code} %{content_type}\n" -H "Accept: $a" \
https://yoursite.com/.well-known/mcp/server-card.json
done
Expected output is three lines of 200 application/mcp-server-card+json. Repeat against a made-up path; every line should read 404.
Who can skip this
If your site has no discovery files and no catch-all handler, there is nothing to fix. If your only problem is a text/markdown request on a page, read how to serve text/markdown to AI agents, because there negotiation is the feature. For the card itself, start with publishing an MCP server card; for status codes on robots.txt, see robots.txt status and content type. Cross-origin errors on the same files are in CORS for agent discovery files.
Next step
Scan your site at AIScan, look at P2 and P1, then pick the next fix from the guides.
Frequently asked questions
What does 406 Not Acceptable mean on a discovery file?
The server read the Accept header, found no representation it was willing to match, and refused to send a default. RFC 9110 §15.5.7 defines it that way. For a JSON or text file with one format, sending the file is the better answer.
My MCP server card returns 406 when the client sends Accept: application/mcp-server-card+json. Why?
A negotiation rule in front of the file accepts only the types it knows, often application/json or text/html. Remove the rule for that path, or add the card type to it, and send the card with Content-Type: application/mcp-server-card+json.
A missing file returns 406 instead of 404. Is that a problem?
Yes. A 406 tells the client a representation exists in another format, while RFC 9110 reserves 404 for 'did not find a current representation'. Agents may keep or retry the URL. Make the catch-all return 404 for unknown paths whatever the Accept header says.
curl shows 200 but the agent reports 406. What is different?
curl and Node's fetch() send Accept: / by default, so a strict rule lets them through. Repeat the request with the agent's header, for example curl -H 'Accept: application/mcp-server-card+json', to see what the agent sees.
My /.well-known/api-catalog comes back as application/octet-stream. Is that a 406 problem?
No, the file is served, but RFC 9727 says the location MUST support application/linkset+json. The host does not know the extension-less file, so set its Content-Type explicitly in your server or host headers configuration.
Should a server ever send 406 to an AI agent?
Rarely. RFC 9110 lets a server ignore Accept and send its default instead. A 406 fits only when sending the wrong format would cause harm, which is not the case for a public JSON or text discovery file.
Does AIScan check for 406 responses?
AIScan's P2 check reads the MCP server card and P1 reads the API catalog, so run npx aiscan-cli yoursite.com and look at both. The scan does not try every Accept value, so test the header your agent sends by hand with curl, as in the verification step.
Do I need Vary: Accept on discovery files?
Only if the same URL really returns different formats for different Accept values. A file with one representation does not vary, so leave the header off and send the one correct Content-Type.

About the author
M Asif Rahman
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
Publish an MCP Server Card and AI Catalog So Agents Find You
To make an MCP server findable from your domain, publish an AI Catalog at /.wellknown/aicatalog.json with one entry that points at a server card, and host that card at your MCP endpoint's URL plus…
Why /.well-known/ files return 404 or 403 on your host, and how to fix it
Your /.wellknown/ file is returning 404 or 403 because something between your repository and the browser treats a folder that starts with a dot as private. In our tests on 26 October 2026, a default…
AI readiness setup guide by platform (2026)
Verified 17, 18, 20 and 22 October 2026. Updated on 22 October 2026. An AIready site needs six things: a robots.txt that names AI crawlers D1, B2, a sitemap D2, a declared feed E5, an llms.txt C2,…
