Generate Documentation
Generate documentation from your codebase using the Cyborg MCP server directly in Claude Code or Cursor.
Overview
The Cyborg MCP server provides an AI-powered workflow for generating documentation. It analyzes your codebase and creates documentation optimized for the Cyborg chat system.
Setup
1. Install the MCP Server
Add the Cyborg MCP server to your IDE:
Claude Code (~/.claude/mcp.json):
{
"mcpServers": {
"cyborg": {
"command": "npx",
"args": ["@cyborg-sdk/mcp"],
"env": {
"CYBORG_PUBLISHABLE_KEY": "your-api-key"
}
}
}
}Cursor (MCP configuration):
{
"cyborg": {
"command": "npx",
"args": ["@cyborg-sdk/mcp"],
"env": {
"CYBORG_PUBLISHABLE_KEY": "your-api-key"
}
}
}2. Restart Your IDE
After adding the configuration, restart Claude Code or Cursor to load the MCP server.
Generate Documentation
Interactive Generation
Simply ask Claude to generate documentation for your project:
Generate documentation for my projectThe AI will guide you through a 7-step interactive process:
- Product Description - What does your product do?
- Target Audience - Who will read this documentation?
- Technical Level - Beginner, intermediate, or advanced?
- Main Features - What are the 3-5 main features?
- Common Tasks - What do users most commonly do?
- Documentation Style - Tutorial, reference, or task-oriented?
- Existing Documentation - Any existing docs to reference?
Generated Output
Based on your answers, documentation is created in ./cyborg-docs/:
cyborg-docs/
├── getting-started.md
├── api/
│ ├── useChat.md
│ ├── useCyborg.md
│ └── CyborgProvider.md
├── components/
│ └── ChatWidget.md
├── types/
│ └── CyborgConfig.md
└── guides/
└── tool-calling.mdTips for Better Documentation
Be Specific About Features
Instead of: "It has chat features"
Say: "Chat widget with real-time streaming, conversation history, tool calling, and context awareness"
Define Your Audience Clearly
Instead of: "For developers"
Say: "For React developers building SaaS products who need to add AI chat"
List Common Tasks
Think about what users actually do:
- "Install and configure the SDK"
- "Add context to pages"
- "Register custom tools"
- "Style the chat widget"
Review Generated Docs
Before uploading, review the generated files:
# List generated files
ls ./cyborg-docs/
# Read a specific file
cat ./cyborg-docs/getting-started.mdMake any necessary edits to ensure accuracy.
Next Steps
Once your documentation is generated and reviewed:
More Information
- MCP Server Overview - Full MCP documentation
- MCP Installation - Detailed setup guide