Skip to content

fix(mcp): make the docs corpus redirect-aware instead of indexing 21 empty pages #1100

Description

@rickylabs

Summary

The filesystem docs corpus indexes 181 Markdown documents, including 21 physical redirect stubs with no body, description, or headings. Those empty entries are 11.6% of the MCP corpus, appear in list_docs, and can win title-weighted searches. Conversely, the 28 canonical pages with oldUrl front matter do not expose those legacy slugs as aliases, so get_doc({ slug: <old-url> }) returns doc_not_found.

Exact empty documents

capabilities
capabilities/ai
capabilities/auth
capabilities/background-jobs
capabilities/database
capabilities/durable-sagas
capabilities/fresh-framework
capabilities/fresh-ui
capabilities/kv-queues-cron
capabilities/polyglot-tasks
capabilities/runtime-config
capabilities/sdk
capabilities/services
capabilities/streams
capabilities/telemetry
capabilities/triggers
tutorials/eis-chat
tutorials/eis-chat/01-scaffold
tutorials/eis-chat/02-message-contract
tutorials/eis-chat/03-deliver-worker
tutorials/eis-chat/04-live-stream

These correspond exactly to the 21 files whose front matter uses layout: layouts/redirect.vto. Separately, 28 real pages declare oldUrl: for build-time redirects.

Agent impact

list_docs advertises phantom documents, search_docs can rank an empty redirect above the canonical page, and get_doc returns empty content or rejects an old slug that the website itself resolves. The MCP therefore disagrees with the public site's routing contract.

Acceptance

  • Redirect-layout stubs are not returned as standalone searchable/listed documents.
  • oldUrl and/or redirectTo front matter produces a normalized slug-alias map to the canonical document.
  • get_doc resolves legacy aliases and returns the canonical slug/content with alias provenance.
  • search_docs returns the canonical result once, never both alias and target.
  • Duplicate aliases and alias cycles fail deterministically during corpus refresh.
  • Filesystem and embedded publish assets preserve the same alias behavior.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions