feat(mcp): expose every documentation page as a resource - #48
benjamincanac wants to merge 1 commit into
Conversation
◈ PR Lens
Architecture 2 components touched across 3 lanes. Data flow
View
Tip The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change. 🪧 More tips
Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds MCP support for listing and reading discovered documentation pages. It introduces URI helpers for page resources, validates routes, returns Markdown content, and adds Vitest coverage. ChangesMCP documentation page resource
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant MCPClient
participant pageResource
participant DocumentationDiscovery
MCPClient->>pageResource: list page resources
pageResource->>DocumentationDiscovery: read discovered pages
DocumentationDiscovery-->>pageResource: return routes and metadata
pageResource-->>MCPClient: return page resource list
MCPClient->>pageResource: read docs://page route
pageResource->>DocumentationDiscovery: resolve documentation route
DocumentationDiscovery-->>pageResource: return Markdown or redirect
pageResource-->>MCPClient: return Markdown or not-found error
Merge Risk: ⚪ Minimal · up to No concrete merge-blocking risk is established by the available evidence. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Comment |
commit: |
What
The MCP server now exposes every documentation page as a resource. A
docs://page{+route}template lists one resource per page, with the page title, description andtext/markdown, and reading one returns the same document/raw/<path>.mdserves, resolved throughgetAgentDocumentlike theget-pagetool.@modelcontextprotocol/sdkbecomes a direct dependency forResourceTemplate.Why
The toolkit advertises the
resourcescapability in the initialize handshake, butresources/listcame back empty on every site built on the layer, which agent readiness audits score as a failure. Pages are the one thing these sites have to offer as resources, and listing them through the template keeps the list in sync with the content without a static resource per page.Summary by CodeRabbit
New Features
Tests