Skip to content

Fix docs MCP content fetch on Vercel#711

Merged
bryantgillespie merged 6 commits into
mainfrom
bry/docs-mcp-403-pages
Jun 2, 2026
Merged

Fix docs MCP content fetch on Vercel#711
bryantgillespie merged 6 commits into
mainfrom
bry/docs-mcp-403-pages

Conversation

@bryantgillespie
Copy link
Copy Markdown
Member

@bryantgillespie bryantgillespie commented Jun 2, 2026

Changes

  • Pins Nuxt Content to the native SQLite connector for Vercel compatibility.
  • Makes get-doc read generated markdown first, with Nuxt Content query fallback for dev.
  • Makes list-docs read the generated static MCP docs index, with Nuxt Content query fallback for dev.
  • Adds parser coverage for MCP markdown metadata.

Potential Risks

  • Static docs/index fetches now depend on NUXT_PUBLIC_SITE_URL matching the deployed docs origin.

Review Notes

  • Verified with Vitest, Vercel build, node-server build, and local built MCP get-doc/list-docs calls.
  • Current docs frontmatter uses single-line title/description values; no block-style frontmatter found.
  • list-docs loads all dev fallback rows intentionally so pathPrefix filtering happens before limit.

@bryantgillespie bryantgillespie requested a review from a team as a code owner June 2, 2026 17:06
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 2, 2026 6:29pm

Request Review

@bryantgillespie
Copy link
Copy Markdown
Member Author

Updated after preview logs showed Nuxt Content SQLite still initializing in Vercel runtime.

Follow-up fix:

  • generate /docs/mcp-docs-index.json at build
  • make MCP get-doc fetch public static markdown by absolute same-origin URL
  • make MCP list-docs read the static index
  • keep Nuxt Content fallback dev-only

Verified: pnpm vitest run tests/server/mcpMarkdown.test.ts, git diff --check, NITRO_PRESET=vercel pnpm build, NITRO_PRESET=node-server pnpm build, local MCP get-doc + list-docs.

@bryantgillespie bryantgillespie marked this pull request as draft June 2, 2026 17:30
@bryantgillespie
Copy link
Copy Markdown
Member Author

Added native SQLite connector config for Nuxt Content.

Evidence:

  • Vercel output now uses node:sqlite / node-sqlite in Nitro.
  • No better_sqlite3.node load path in the generated Vercel function.
  • Vercel function runtime is nodejs22.x.
  • Direct better-sqlite3 dependency was removed from the final PR diff.

Verified locally:

  • pnpm vitest run tests/server/mcpMarkdown.test.ts
  • NITRO_PRESET=vercel pnpm build
  • NITRO_PRESET=node-server pnpm build
  • local POST /docs/__nuxt_content/content/query returns 200 with valid SQL
  • local POST /docs/mcp get-doc returns 200

Vercel check for 300c2ff9 is still pending as of this comment.

@bryantgillespie bryantgillespie marked this pull request as ready for review June 2, 2026 18:28
@bryantgillespie bryantgillespie merged commit 5f0b0b4 into main Jun 2, 2026
4 of 5 checks passed
@bryantgillespie bryantgillespie deleted the bry/docs-mcp-403-pages branch June 2, 2026 18:29
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.

1 participant