Docs Updates #7 - MCP Server - #686
Merged
bryantgillespie merged 12 commits intoMay 29, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bryantgillespie
changed the base branch from
main
to
bry/dockem-6-typesense-search
May 26, 2026 20:08
bryantgillespie
force-pushed
the
bry/dockem-7-mcp-tools
branch
from
May 26, 2026 20:10
2592e27 to
9da3905
Compare
bryantgillespie
marked this pull request as ready for review
May 27, 2026 15:26
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates an MCP (Model Context Protocol) server into the Directus docs Nuxt site, adds MCP tools and public /api/docs/* endpoints for search/list/get operations, and introduces build-time generation + routing of cleaned Markdown outputs to support AI/IDE consumption.
Changes:
- Added MCP toolkit configuration plus multiple MCP tools for docs search/read and Directus GitHub code search/file fetch.
- Added public docs API endpoints with per-IP rate limiting.
- Added a Nuxt module + middleware to emit and serve cleaned
.mdsiblings for docs pages, plus UI deeplinks/copy actions for MCP/AI clients.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/server/get-directus-file.test.ts | Adds a Vitest covering UTF-8 chunk slicing behavior. |
| server/utils/sliceUtf8.ts | Introduces UTF-8 safe-ish byte slicing utility for chunked responses. |
| server/utils/mcp-rate-limit.ts | Adds in-memory rate limiting helper for MCP tools. |
| server/utils/docs-api-rate-limit.ts | Adds per-IP in-memory rate limiting for the public docs API. |
| server/utils/directus-repos.ts | Defines allowlisted Directus repos and GitHub code search qualifiers. |
| server/utils/contentToMarkdown.ts | Converts Nuxt Content/MDC pages into cleaner Markdown for AI consumption. |
| server/middleware/markdown-negotiation.ts | Redirects Accept: text/markdown/curl to emitted .md siblings. |
| server/mcp/tools/search-docs.ts | Adds MCP tool for Typesense-backed docs search. |
| server/mcp/tools/search-directus-code.ts | Adds MCP tool for GitHub Code Search across allowlisted repos with local throttling. |
| server/mcp/tools/list-docs.ts | Adds MCP tool to list docs pages from Nuxt Content collection. |
| server/mcp/tools/get-doc.ts | Adds MCP tool to fetch a single doc page by path. |
| server/mcp/tools/get-directus-file.ts | Adds MCP tool to fetch allowlisted GitHub repo files with chunking. |
| server/api/docs/search.get.ts | Adds public HTTP endpoint wrapper for docs search with rate limiting. |
| server/api/docs/index.get.ts | Adds public HTTP endpoint wrapper for listing docs with rate limiting. |
| server/api/docs/get.get.ts | Adds public HTTP endpoint wrapper for fetching a single doc with rate limiting. |
| modules/content-markdown.ts | Adds Nuxt module to emit cleaned .md versions of content into public output. |
| nuxt.config.ts | Enables MCP toolkit/module, registers content-markdown module, and sets MCP metadata + async context. |
| app/utils/agent-deeplinks.ts | Adds deeplink + MCP URL helpers for IDE integrations and prompt links. |
| app/components/CopyDocButton.vue | Expands copy/open actions (Markdown link, ChatGPT/Claude prompts, MCP URL, IDE deeplinks). |
| content/mcp-help.md | Adds end-user landing/help page for the docs MCP server. |
| content/guides/11.ai/2.mcp/0.index.md | Updates MCP guide title/nav metadata. |
| .env.example | Documents optional GITHUB_TOKEN for GitHub-based MCP tools. |
| package.json | Adds @nuxtjs/mcp-toolkit, h3, and zod dependencies + override. |
| pnpm-lock.yaml | Locks new deps and overrides (h3, zod, MCP toolkit and transitive deps). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LZylstra
self-requested a review
May 28, 2026 14:35
LZylstra
approved these changes
May 28, 2026
LZylstra
left a comment
Collaborator
There was a problem hiding this comment.
Just one thing in addition to the AI comments
Base automatically changed from
bry/dockem-6-typesense-search
to
bry/dockem-5-layout-changes
May 29, 2026 13:37
bryantgillespie
added a commit
that referenced
this pull request
Jun 1, 2026
* update all dependencies * add packageManager back * remove hardcoded url * wip * cleanup from review * cleanup again * switch to json for storing redirects * convert to ts * cleanup * ai cleanup * Update README.md * backfill all ids * feat(nav): rename Connect→APIs, Automate→Flows, Manage→Hosting * feat(llms): rename guide section titles to APIs and Flows * docs: replace branded "Directus Connect"/"Directus Automate" with APIs/Flows * docs(homepage): drop Data Engine/Data Studio framing * fix: fold 11.integrations into 12.integrations to clear numeric collision * fix sidebar * docs(nav): rename Guides→Guide, Hosting→Deploy * kill editor and explorer * initial moves * wippity * cleanup * fix nav * extract findNavNode * vanilla to vanilla js * fix claude bs * oops technologies is needed for the imaages * add chips to tutorials with framworks * more cleanup * All Frameworks * feat(layout): redesign docs experience * feat(layout): add prompt and shader debug components * fix(layout): restore reference content and skip API prerender * fix(build): stop masking prerender errors * feat(layout): use Directus docs typography * fix(build): inline unhead for preview * chore(layout): remove unused legacy helpers * Clean up docs navigation and icons * fix layous * Update Railway tutorial image * Skip base-prefixed API prerender * fix(build): lazy-load OAS spec to reduce prerender memory Move @directus/openapi import out of app.vue and into the api layout as a dynamic import. The 590KB spec no longer enters heap during content prerender; it's split into its own chunk loaded lazily at runtime on /api/* routes (which have prerender: false anyway). Delete the prerender module — it was already gated off by default and adds no value when API routes aren't prerendered. Also includes earlier nuxt.config tweaks: sourcemap off, llms-full.txt prerender skip, concurrency 1, icon serverBundle config. * increase concurrency * fix icon * feat(hero): painterly Kuwahara shader with fade-up painting layer * Fix suggestions * Docs Updates #6 - Add Typesense docs search (#685) * feat(search): add Typesense docs search * Add Typesense search refinements * Address search review feedback * Fix feedback --------- Co-authored-by: Lindsey Zylstra <lindseyzylstra@gmail.com> Co-authored-by: LZylstra <11338479+LZylstra@users.noreply.github.com> * Docs Updates #7 - MCP Server (#686) * feat(search): add Typesense docs search * Add Typesense search refinements * Address search review feedback * docs(mcp): clarify MCP overview title * feat(mcp): add docs MCP server and tools * Address MCP review feedback * Fix feedback * Fixes --------- Co-authored-by: Lindsey Zylstra <lindseyzylstra@gmail.com> Co-authored-by: LZylstra <11338479+LZylstra@users.noreply.github.com> * Fix pnpm setup in search workflow * Reduce prerender concurrency --------- Co-authored-by: Lindsey Zylstra <lindseyzylstra@gmail.com> Co-authored-by: LZylstra <11338479+LZylstra@users.noreply.github.com>
bryantgillespie
added a commit
that referenced
this pull request
Jun 1, 2026
* update all dependencies * add packageManager back * remove hardcoded url * wip * cleanup from review * cleanup again * switch to json for storing redirects * convert to ts * cleanup * ai cleanup * Update README.md * backfill all ids * feat(nav): rename Connect→APIs, Automate→Flows, Manage→Hosting * feat(llms): rename guide section titles to APIs and Flows * docs: replace branded "Directus Connect"/"Directus Automate" with APIs/Flows * docs(homepage): drop Data Engine/Data Studio framing * fix: fold 11.integrations into 12.integrations to clear numeric collision * fix sidebar * docs(nav): rename Guides→Guide, Hosting→Deploy * kill editor and explorer * initial moves * wippity * cleanup * fix nav * extract findNavNode * vanilla to vanilla js * fix claude bs * oops technologies is needed for the imaages * add chips to tutorials with framworks * more cleanup * All Frameworks * feat(layout): redesign docs experience * feat(layout): add prompt and shader debug components * fix(layout): restore reference content and skip API prerender * fix(build): stop masking prerender errors * feat(layout): use Directus docs typography * fix(build): inline unhead for preview * chore(layout): remove unused legacy helpers * Clean up docs navigation and icons * fix layous * Update Railway tutorial image * Skip base-prefixed API prerender * fix(build): lazy-load OAS spec to reduce prerender memory Move @directus/openapi import out of app.vue and into the api layout as a dynamic import. The 590KB spec no longer enters heap during content prerender; it's split into its own chunk loaded lazily at runtime on /api/* routes (which have prerender: false anyway). Delete the prerender module — it was already gated off by default and adds no value when API routes aren't prerendered. Also includes earlier nuxt.config tweaks: sourcemap off, llms-full.txt prerender skip, concurrency 1, icon serverBundle config. * increase concurrency * fix icon * feat(hero): painterly Kuwahara shader with fade-up painting layer * Fix suggestions * Docs Updates #6 - Add Typesense docs search (#685) * feat(search): add Typesense docs search * Add Typesense search refinements * Address search review feedback * Fix feedback --------- Co-authored-by: Lindsey Zylstra <lindseyzylstra@gmail.com> Co-authored-by: LZylstra <11338479+LZylstra@users.noreply.github.com> * Docs Updates #7 - MCP Server (#686) * feat(search): add Typesense docs search * Add Typesense search refinements * Address search review feedback * docs(mcp): clarify MCP overview title * feat(mcp): add docs MCP server and tools * Address MCP review feedback * Fix feedback * Fixes --------- Co-authored-by: Lindsey Zylstra <lindseyzylstra@gmail.com> Co-authored-by: LZylstra <11338479+LZylstra@users.noreply.github.com> * Fix pnpm setup in search workflow * Reduce prerender concurrency * content changes --------- Co-authored-by: Lindsey Zylstra <lindseyzylstra@gmail.com> Co-authored-by: LZylstra <11338479+LZylstra@users.noreply.github.com>
This branch was successfully deployed
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.
This pull request introduces a comprehensive integration of the Model Context Protocol (MCP) server into the Directus documentation site, enabling AI assistants and IDEs to natively search, read, and interact with the docs. It adds new endpoints, UI enhancements, and supporting utilities for seamless AI and IDE integration, along with supporting documentation and build improvements.
MCP Server Integration & API Endpoints:
@nuxtjs/mcp-toolkitmodule and configured the MCP server to expose the documentation as a live tool for AI assistants, with a browser redirect to/mcp-helpfor human visitors. [1] [2] [3]/api/docsfor listing docs, searching, and fetching individual pages, each with rate limiting. [1] [2] [3]get-directus-file, to securely fetch file contents from allowlisted Directus GitHub repositories, with chunking and sensitive path protection.UI Enhancements for AI/IDE Integration:
CopyDocButton.vueto provide one-click actions for copying Markdown links, opening pages in ChatGPT or Claude, and copying the MCP server URL. Also added quick links for installing the docs MCP server in Cursor and VS Code. [1] [2] [3]agent-deeplinks.tsto support deep linking and MCP server URL generation.Documentation & Guides:
/content/mcp-help.mdas a user-facing guide and landing page for the docs MCP server, with instructions for connecting AI clients and IDEs.Build & Output Improvements:
content-markdown, to emit clean.mdversions of all docs pages for use by the MCP server and AI tools. [1] [2]Dependency & Configuration Updates:
@nuxtjs/mcp-toolkit,h3, andzod, and ensured proper overrides for compatibility. [1] [2] [3]These changes collectively make the Directus documentation site a first-class MCP server, enabling advanced AI and IDE integrations while maintaining security and ease of use.