Commit 619559b
Add MCP server with page-tagged documentation, dynamic resources, and comprehensive tests (#531)
* Initial plan
* Add page tag wrapping and MCP server implementation
Co-authored-by: abernier <[email protected]>
* Update pnpm-lock.yaml with new dependencies
Co-authored-by: abernier <[email protected]>
* Add MCP README and format code with prettier
Co-authored-by: abernier <[email protected]>
* Add XML attribute escaping for security
Co-authored-by: abernier <[email protected]>
* Add implementation summary documentation
Co-authored-by: abernier <[email protected]>
* Add /mcp SSE route for remote MCP server access
Co-authored-by: abernier <[email protected]>
* Fix CSS selector injection vulnerability in MCP servers
Co-authored-by: abernier <[email protected]>
* Remove stdio MCP server, keep only HTTP/SSE endpoint
Co-authored-by: abernier <[email protected]>
* Reuse libs registry from page.tsx for MCP server
Co-authored-by: abernier <[email protected]>
* Optimize registry: move URL mapping to module scope
Co-authored-by: abernier <[email protected]>
* Refactor MCP server to use mcp-handler for better Vercel integration
Co-authored-by: abernier <[email protected]>
* Optimize MCP route by extracting library names to constant
Co-authored-by: abernier <[email protected]>
* Remove registry adapter, use libs directly from page.tsx
Co-authored-by: abernier <[email protected]>
* Remove docs files, add MCP section to introduction, use xmlbuilder2
Co-authored-by: abernier <[email protected]>
* Optimize XML generation and clarify curl example
Co-authored-by: abernier <[email protected]>
* Remove hardcoded list of supported libraries from docs
Co-authored-by: abernier <[email protected]>
* Remove duplicate URL mapping, use library URLs directly
Co-authored-by: abernier <[email protected]>
* Support internal routes by prepending docs.pmnd.rs base URL
Co-authored-by: abernier <[email protected]>
* Rename MCP server to pmndrs-docs
Co-authored-by: abernier <[email protected]>
* Fix TypeScript errors and update pnpm-lock.yaml
Co-authored-by: abernier <[email protected]>
* Add dynamic export directive to exclude /mcp from static export
Co-authored-by: abernier <[email protected]>
* Exclude /mcp route from static export builds
Co-authored-by: abernier <[email protected]>
* Fix static export compatibility for /mcp route
Co-authored-by: abernier <[email protected]>
* Add prebuild script to remove /mcp route in static export mode
Co-authored-by: abernier <[email protected]>
* Revert MCP route to simpler version from commit 58ad8da
Co-authored-by: abernier <[email protected]>
* Add local MCP server for offline documentation access
Co-authored-by: abernier <[email protected]>
* Refactor MCP servers to share business logic via mcp-tools module
Co-authored-by: abernier <[email protected]>
* Convert all MCP code to TypeScript (.ts/.mts)
Co-authored-by: abernier <[email protected]>
* Revert to commit 16b4878: remove local MCP server and shared logic
Co-authored-by: abernier <[email protected]>
* Remove node-fetch dependency, use native fetch
Co-authored-by: abernier <[email protected]>
* Simplify prebuild script to use plain shell command
Co-authored-by: abernier <[email protected]>
* Update pnpm-lock.yaml after removing node-fetch dependency
Co-authored-by: abernier <[email protected]>
* Remove basePath option from mcp-handler configuration
Co-authored-by: abernier <[email protected]>
* Move MCP server to /api/[transport] route with basePath configuration
Co-authored-by: abernier <[email protected]>
* Remove unnecessary prebuild script - Next.js auto-excludes /api routes from static exports
Co-authored-by: abernier <[email protected]>
* Test and remove prebuild script - Next.js auto-excludes /api routes
Co-authored-by: abernier <[email protected]>
* Add postbuild script to restore API directory after static export
Co-authored-by: abernier <[email protected]>
* Replace prebuild/postbuild with unified build script using mv instead of rm
Co-authored-by: abernier <[email protected]>
* Replace external build script with oneliner in package.json
Co-authored-by: abernier <[email protected]>
* Simplify build script: use tmp/api-backup instead of complex trap logic
Co-authored-by: abernier <[email protected]>
* Fix build script to preserve next build exit status
Co-authored-by: abernier <[email protected]>
* Simplify build script by removing redundant || true statements
Co-authored-by: abernier <[email protected]>
* Fix CI: remove obsolete bin entry from package.json
Co-authored-by: abernier <[email protected]>
* build.sh
* .
* Rename build.sh to next-build.sh
Co-authored-by: abernier <[email protected]>
* Remove redundant .api-backup from .gitignore
Co-authored-by: abernier <[email protected]>
* Add explanatory header to next-build.sh script
Co-authored-by: abernier <[email protected]>
* Refactor next-build.sh to use if statements and IS_EXPORT variable
Co-authored-by: abernier <[email protected]>
* Update MCP config example to use @modelcontextprotocol/client-sse
Co-authored-by: abernier <[email protected]>
* Add skill.md manifest and register as MCP resource
Co-authored-by: abernier <[email protected]>
* Convert skill.md to dynamic route with libs integration
Co-authored-by: abernier <[email protected]>
* Replace list_pages tool with docs://{lib}/index resource template
Co-authored-by: abernier <[email protected]>
* Update MCP documentation to reflect resource templates
Co-authored-by: abernier <[email protected]>
* Update skill.md to reflect resource template architecture
Co-authored-by: abernier <[email protected]>
* Fix TypeScript errors in MCP resource registration
Co-authored-by: abernier <[email protected]>
* Add force-static directive to skill.md route
Co-authored-by: abernier <[email protected]>
* Remove .js extensions from TypeScript imports
Co-authored-by: abernier <[email protected]>
* Fix resource template registration API usage
Co-authored-by: abernier <[email protected]>
* Replace resource template with list_pages tool
Co-authored-by: abernier <[email protected]>
* Replace list_pages tool with dynamic resource registration
Co-authored-by: abernier <[email protected]>
* Add MCP server declaration to llms.txt
Co-authored-by: abernier <[email protected]>
* docs_url
* Add as const to libs and use SUPPORTED_LIBRARY_NAMES type
Co-authored-by: abernier <[email protected]>
* .
* Filter MCP server to only support pmndrs.github.io libraries
Co-authored-by: abernier <[email protected]>
* Support libraries with local paths (starting with /) in MCP server
Co-authored-by: abernier <[email protected]>
* Use current server URL for local paths instead of hardcoding
Co-authored-by: abernier <[email protected]>
* .
* Remove redundant library validation check (zod already validates)
Co-authored-by: abernier <[email protected]>
* Remove redundant URL validation in resource registration
Co-authored-by: abernier <[email protected]>
* doc
* doc
* debug
* debug
* baseUrl()
* .
* -type-fest
* Add comprehensive tests for MCP route using vitest and MSW
Co-authored-by: abernier <[email protected]>
* .
* -skill route
* .
* docs(changeset): mcp support
* get_page_content tests
* .
* .
* .
* .
* .
* .
* .
* .
* cache
* .
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: abernier <[email protected]>
Co-authored-by: Antoine BERNIER <[email protected]>1 parent 326dd2e commit 619559b
File tree
13 files changed
+1901
-78
lines changed- .changeset
- docs/getting-started
- src/app
- api/[transport]
- llms-full.txt
- llms.txt
13 files changed
+1901
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | | - | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
205 | | - | |
| 207 | + | |
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
| |||
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
297 | 305 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | | - | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments