Skip to content

Pack capability sitemaps to a URL budget, not a listing count - #68

Merged
lbesecker195 merged 1 commit into
mainfrom
fix/sitemap-url-budget
Sep 24, 2026
Merged

lbesecker195 merged 1 commit into
mainfrom
fix/sitemap-url-budget

Conversation

@lbesecker195

Copy link
Copy Markdown
Owner

Closes #67.

/sitemaps/resources-4.xml was serving 56,798 URLs against a hard limit of 50,000. A file over the limit is rejected without a message, so a seventh of the resources silo was invisible to search from the moment it shipped.

resources-1  30,187      resources-4  56,798   <-- rejected
resources-2  49,674      resources-5  33,294
resources-3  31,630      resources-6  32,891

resources-2 at 49,674 shows how little the old scheme had left.

Why a count could never work

One listing has 960 resources; most have a handful. With 300 listings per file, the URL count depends entirely on who lands in that file — 30,187 in one, 56,798 in the next. No fixed number is safe against that distribution, and picking a smaller one only moves the cliff.

Listings are now packed to a 40,000-URL budget, with 10,000 of headroom. The per-listing estimate uses 13 URLs per item, which is an upper bound (the widest client list), not an average — so a file can come in under budget but never over it.

This is the same failure that was fixed once for servers-*.xml, in a new place. A count that works today breaks the moment the data shifts; a budget does not.

Tests: 168 passing, including one that builds ten listings of 400 resources — past both the budget and the limit — and asserts every generated file stays under 50,000.


Pages affected:

🤖 Generated with Claude Code

resources-4.xml was serving 56,798 URLs against a 50,000 limit, so a
seventh of the resources silo was being rejected without a message.
resources-2.xml sat at 49,674, a whisker under.

Chunking by a fixed number of listings cannot work when the counts are not
uniform. One listing has 960 resources and most have a handful, so 300
listings a file came out at 30,187 URLs in one place and 56,798 in another
depending on who landed in it.

- Listings are packed to a 40,000-URL budget, leaving 10,000 of headroom
- 13 URLs per item is an upper bound, not an estimate, so a file can come
  in under budget but never over
- Chunk sizes are cached with the other catalogue figures

The same failure was fixed once for servers-*.xml. A count that works today
breaks the moment the distribution changes; a budget does not.

Closes #67

---

Pages affected:

- [MCP Harbor](https://ai.mcpharbor.dev/) -- registry home, search and recently added servers.
- [MCP server directory](https://ai.mcpharbor.dev/servers) -- the listings these files index.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lbesecker195
lbesecker195 merged commit bf763c9 into main Sep 24, 2026
1 check passed
@lbesecker195
lbesecker195 deleted the fix/sitemap-url-budget branch September 24, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resources-4.xml is over the 50,000-URL sitemap limit

1 participant