Conversation
|
@sanny-io is attempting to deploy a commit to the ZenStack Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughAdds MCP documentation support: a new Vercel API handler at Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
api/docs/mcp.ts (1)
11-11: Consider using an environment variable forbaseUrl.The production URL is hardcoded, so any local dev or staging deployment will advertise the wrong base URL to MCP clients. A fallback default keeps it simple.
♻️ Suggested change
- baseUrl: 'https://zenstack.dev/docs', + baseUrl: process.env.DOCS_BASE_URL ?? 'https://zenstack.dev/docs',🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api/docs/mcp.ts` at line 11, Replace the hardcoded baseUrl value in the exported docs config (the baseUrl property in api/docs/mcp.ts) with an environment-driven value: read from a specific env var (e.g., process.env.MCP_DOCS_BASE_URL or similar) and fall back to 'https://zenstack.dev/docs' if the env var is not set; update any initialization or export so the config uses that resolved value so local/staging deployments can override the advertised base URL.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api/docs/mcp.ts`:
- Around line 8-9: The docsPath and indexPath currently use path.join(__dirname,
'../build/mcp/...') which resolves to api/build/... because this file is
api/docs/mcp.ts; update both to point two levels up to the project root by
adding an extra '../' so they become path.join(__dirname,
'../../build/mcp/docs.json') and path.join(__dirname,
'../../build/mcp/search-index.json') so the Docusaurus build artifacts in the
root build/ directory are correctly found.
---
Nitpick comments:
In `@api/docs/mcp.ts`:
- Line 11: Replace the hardcoded baseUrl value in the exported docs config (the
baseUrl property in api/docs/mcp.ts) with an environment-driven value: read from
a specific env var (e.g., process.env.MCP_DOCS_BASE_URL or similar) and fall
back to 'https://zenstack.dev/docs' if the env var is not set; update any
initialization or export so the config uses that resolved value so local/staging
deployments can override the advertised base URL.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
package.jsonis excluded by!**/*.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!**/*.yamlvercel.jsonis excluded by!**/*.json
📒 Files selected for processing (2)
api/docs/mcp.tsdocusaurus.config.js
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| ], | ||
| [ | ||
| 'docusaurus-plugin-mcp-server', | ||
| { |
There was a problem hiding this comment.
It seems by default the mcp generation include all files, including blog and 2.x docs. Shall we limit it to only 3.x docs?
| import path from 'path'; | ||
| import { fileURLToPath } from 'url'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
There was a problem hiding this comment.
Currently the doc project is CJS and it seems the server function crashes when I hit the "/docs/mcp" endpoint.
I'm not sure how much work it is to migrate to ESM, but maybe it's simpler to have this file as CJS instead?
Adds an MCP server for the docs at
https://zenstack.dev/docs/mcpSummary by CodeRabbit