Skip to content

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):

json
{
  "mcpServers": {
    "cyborg": {
      "command": "npx",
      "args": ["@cyborg-sdk/mcp"],
      "env": {
        "CYBORG_PUBLISHABLE_KEY": "your-api-key"
      }
    }
  }
}

Cursor (MCP configuration):

json
{
  "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 project

The AI will guide you through a 7-step interactive process:

  1. Product Description - What does your product do?
  2. Target Audience - Who will read this documentation?
  3. Technical Level - Beginner, intermediate, or advanced?
  4. Main Features - What are the 3-5 main features?
  5. Common Tasks - What do users most commonly do?
  6. Documentation Style - Tutorial, reference, or task-oriented?
  7. 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.md

Tips 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:

bash
# List generated files
ls ./cyborg-docs/

# Read a specific file
cat ./cyborg-docs/getting-started.md

Make any necessary edits to ensure accuracy.

Next Steps ​

Once your documentation is generated and reviewed:

Next: Upload Documentation →

More Information ​

Built with VitePress