Skip to content

Upload Documentation

After generating your documentation, upload it to the Cyborg backend using the MCP server.

Upload with MCP

With the Cyborg MCP server configured, uploading is simple. In Claude Code or Cursor, ask:

Upload my documentation files from ./cyborg-docs

Or use the tool directly:

json
upload_docs({
  "filePaths": ["./cyborg-docs/**/*.md"]
})

What Happens

When you upload documentation:

  1. Files are read and content hashes calculated
  2. Batch upload to Cyborg API
  3. Backend processes files: chunking, embedding, indexing
  4. State file created at .cyborg-state.json tracking sync status

Response

After successful upload:

json
{
  "success": true,
  "uploaded": [
    { "path": "getting-started.md", "documentId": "doc_abc123" },
    { "path": "api/useChat.md", "documentId": "doc_def456" }
  ],
  "failed": []
}

State File

The upload creates .cyborg-state.json which tracks:

  • Document IDs from the backend
  • Content hashes for change detection
  • Last sync timestamps
json
{
  "apiUrl": "https://api.cyborgsdk.dev/api/v1",
  "lastSyncedAt": "2025-01-15T10:30:00Z",
  "files": {
    "getting-started.md": {
      "documentId": "doc_abc123",
      "contentHash": "sha256:e3b0c44298fc...",
      "syncedAt": "2025-01-15T10:30:00Z"
    }
  }
}

Keeping Docs in Sync

After the initial upload, use sync_docs to upload only changed files:

Sync my documentation changes

Or preview changes first:

json
sync_docs({ "dryRun": true })

The sync tool uses smart change detection to minimize API calls—only modified files are uploaded.

Best Practices

  1. Commit the state file to version control for team sync
  2. Review before uploading - check generated docs for accuracy
  3. Sync after code changes - keep docs up to date with your codebase

Next Steps

Next: Get API Key →

More Information

Built with VitePress