Skip to content

Comments

feat: docs mcp server#568

Open
sanny-io wants to merge 4 commits intozenstackhq:mainfrom
sanny-io:feat/docs-mcp-server
Open

feat: docs mcp server#568
sanny-io wants to merge 4 commits intozenstackhq:mainfrom
sanny-io:feat/docs-mcp-server

Conversation

@sanny-io
Copy link
Contributor

@sanny-io sanny-io commented Feb 24, 2026

Adds an MCP server for the docs at https://zenstack.dev/docs/mcp

Summary by CodeRabbit

  • New Features
    • Integrated Model Context Protocol (MCP) documentation service into the docs portal, providing access to built MCP docs.
    • Added a docs server plugin to the site configuration to enable serving the MCP documentation within the documentation site.

@vercel
Copy link

vercel bot commented Feb 24, 2026

@sanny-io is attempting to deploy a commit to the ZenStack Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 576a674 and b92aacb.

📒 Files selected for processing (1)
  • api/docs/mcp.ts

Walkthrough

Adds MCP documentation support: a new Vercel API handler at api/docs/mcp.ts that serves built MCP JSON, and a Docusaurus config plugin entry (docusaurus-plugin-mcp-server) registering an MCP server for the site build.

Changes

Cohort / File(s) Summary
MCP Docs Handler
api/docs/mcp.ts
New module exporting a default Vercel handler created via createVercelHandler(...) configured with docsPath, indexPath, name, and baseUrl pointing to built MCP JSON files.
Build Configuration
docusaurus.config.js
Adds docusaurus-plugin-mcp-server to the plugins array with options { server: { name: 'zenstack-docs', version: '1.0.0' } }.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: docs mcp server' directly describes the main changes: adding MCP server integration to the docs, which is confirmed by the file modifications (api/docs/mcp.ts handler and docusaurus.config.js plugin configuration).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
api/docs/mcp.ts (1)

11-11: Consider using an environment variable for baseUrl.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c59a79d and 576a674.

⛔ Files ignored due to path filters (3)
  • package.json is excluded by !**/*.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/*.yaml
  • vercel.json is excluded by !**/*.json
📒 Files selected for processing (2)
  • api/docs/mcp.ts
  • docusaurus.config.js

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