fix(mcp): exclude .navigation paths from list-pages and get-page#1374
Merged
larbish merged 3 commits intoMay 27, 2026
Conversation
queryCollection().all() returns .navigation.yml entries alongside real pages. MCP clients see them as routes (e.g. /aandoeningen/.navigation), fetch returns the YAML stub or empty content. Extract isNavigationPath helper, filter at list-pages, 404 at get-page, dedupe sitemap.xml.ts.
|
@kjanat is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list-pagesandget-pageMCP tools return.navigation.ymlentries as if they were real pages.@nuxt/contentindexes.navigation.ymlfiles into the same collection as page docs, andqueryCollection().all()has no filter on stem/extension, so they ride straight through into the MCP response with paths ending in/.navigationand (often) empty titles.An LLM consuming
list-pageshappily suggests these as real routes, andget-pagereturns the YAML stub or empty content — looks valid, isn't.Fix
isNavigationPath(path)helper tolayer/server/utils/content.ts— matchesendsWith('.navigation')(covers/foo/.navigationand.navigation) plusincludes('/.navigation/')(mid-path case, matching prior intent insitemap.xml.ts).list-pages: filter results before the map step — perf win and bypasses the type-inference issue chaining.filterafter.map.get-page: short-circuit to 404 when a.navigationpath is requested directly.sitemap.xml.ts: replace the inline duplicated predicate with the helper (also tightens the original.includes('/.navigation')to/.navigation/so paths like/foo/.navigationthingdon't false-positive).Reproduction (before fix)
Any Docus site with
.navigation.ymlfiles anywhere in content. Calllist-pagesvia MCP — every directory containing a.navigation.ymlproduces an entry withpathending in/.navigation. Callget-pagewith one of those paths and it returns the YAML stub instead of 404.Try it out
If you want to verify the fix in your own Docus site before this lands, you can temporarily override the
docusdependency with a prebuilt tarball of this branch:(or the equivalent
overrides/resolutionsfield for your package manager)Notes
.includes('/.navigation/')branch may be unreachable in practice (.navigation.ymlis a leaf data file, no children) but I preserved the original sitemap author's defensive intent rather than silently narrowing behavior..Navigationetc.) —.navigation.ymlis a fixed Nuxt Content convention; uppercase variants aren't processed as navigation files anyway, so a case-insensitive check would only provide false safety.