From ac712b7032b75fa1f3fae15e5f0320af9c3079c3 Mon Sep 17 00:00:00 2001 From: Darshil Rathod <69842641+RathodDarshil@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:42:48 +0000 Subject: [PATCH] ci(agent-files): raise the llms-full.txt cap to 8 MB to match the MCP (LIN-5175) The docs check still capped llms-full.txt at 2,000,000 bytes, but the MCP's search_documentation has read up to 8,000,000 since mcp-server#36. main was 78 bytes under, so docs PRs that add text failed the build. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- scripts/check-agent-files.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 877f52bd..d29f326e 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ The Relay build writes the same agent files Mintlify serves |---|---| | `/.md` | Each page as Markdown, starting with a pointer to `llms.txt`. Pages link it with `` | | `/llms.txt`, `/.well-known/llms.txt` | Every page with its description, by sidebar section, after the agent instructions from docs.json `markdown.instructions` (synced into `nav.json` by `gen-nav.ts`) | -| `/llms-full.txt` | Every page in one file. The Linkrunner MCP `search_documentation` tool reads it: keep the `# Title` + `Source: ` header and stay under 2 MB | +| `/llms-full.txt` | Every page in one file. The Linkrunner MCP `search_documentation` tool reads it: keep the `# Title` + `Source: ` header and stay under 8 MB (the MCP's limit) | | `/skill.md`, `/.well-known/skills/` | A short skill: how to read these docs, the MCP server, `@linkrunner/skills` | | `/sitemap.xml`, `/robots.txt` | VitePress sitemap; robots allows crawling and AI use | diff --git a/scripts/check-agent-files.ts b/scripts/check-agent-files.ts index bd476e79..fa9a4836 100644 --- a/scripts/check-agent-files.ts +++ b/scripts/check-agent-files.ts @@ -3,7 +3,7 @@ * - every link in llms.txt is a built Markdown page, and every built page is listed, * - llms-full.txt parses with the Linkrunner MCP's parser (search_documentation, * linkrunner-labs/mcp-server src/tools/documentation.ts) into one entry per - * page, under its 2 MB cap, + * page, under its 8 MB cap (MAX_BUNDLE_BYTES), * - robots.txt, sitemap.xml, skill.md and the .well-known copies exist, * - pages link their Markdown copy. * Run after `DOCS_THEME=relay vitepress build` (part of build:relay). @@ -55,7 +55,10 @@ if (!llms.includes("> ## Agent Instructions")) fail("llms.txt: no agent instruct // llms-full.txt, parsed the way the MCP does (host check uses our SITE_URL). const full = read("llms-full.txt"); const bytes = Buffer.byteLength(full); -if (bytes > 2_000_000) fail(`llms-full.txt is ${bytes} bytes; the MCP reads at most 2,000,000`); +// The MCP's MAX_BUNDLE_BYTES (8,000,000 since mcp-server#36). It counts characters, which are never +// more than bytes, so a byte limit here can't let through a file the MCP refuses. +const MCP_MAX_BYTES = 8_000_000; +if (bytes > MCP_MAX_BYTES) fail(`llms-full.txt is ${bytes} bytes; the MCP reads at most ${MCP_MAX_BYTES.toLocaleString("en-US")}`); const host = new URL(SITE_URL).hostname; // The MCP cuts a page at the next header of any host, so count them all. const headers = [...full.matchAll(/^# (.+)\r?\nSource: (https:\/\/[^\s]+)\r?\n/gm)];