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-docsOr use the tool directly:
json
upload_docs({
"filePaths": ["./cyborg-docs/**/*.md"]
})What Happens
When you upload documentation:
- Files are read and content hashes calculated
- Batch upload to Cyborg API
- Backend processes files: chunking, embedding, indexing
- State file created at
.cyborg-state.jsontracking 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 changesOr 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
- Commit the state file to version control for team sync
- Review before uploading - check generated docs for accuracy
- Sync after code changes - keep docs up to date with your codebase
Next Steps
More Information
- Sync Docs - Detailed sync documentation
- Upload Docs - Full upload options
- Tools Reference - All MCP tools