Synchronization Modes
The S3 Documentation MCP server supports three synchronization modes to control when your vector index is updated with changes from S3.
Quick Reference
Section titled “Quick Reference”| Mode | When It Syncs | Best For |
|---|---|---|
| startup (default) | At server startup | Most use cases |
| periodic | At regular intervals | Frequently updated docs |
| manual | Only when you trigger it | Full control, debugging |
Sync Modes
Section titled “Sync Modes”startup (Default)
Section titled “startup (Default)”Synchronizes the index when the server starts.
SYNC_MODE=startupBehavior:
- ✅ Syncs automatically on server start
- ✅ Smart detection: Full sync if index is empty, incremental otherwise
- ✅ No manual intervention needed after restart
- ✅ Uses ETag comparison for efficient updates
Best for:
- Most production deployments
- Development environments
- Infrequently updated documentation
Example Use Case: Your documentation is updated a few times per week, and you restart the server or redeploy after each update.
periodic
Section titled “periodic”Synchronizes the index at regular intervals while the server is running.
SYNC_MODE=periodicSYNC_INTERVAL_MINUTES=60 # Sync every hourBehavior:
- ✅ Initial sync on startup (same as startup mode)
- ✅ Automatic syncs every N minutes
- ✅ Always uses incremental sync (only changed files)
- ✅ Non-blocking: searches work during sync
Best for:
- Frequently updated documentation
- Long-running servers
- Environments where documentation changes without server restarts
Example Use Case: Your documentation is continuously updated by a CI/CD pipeline, and you want the index to stay fresh without restarting the server.
Configuration:
SYNC_MODE=periodicSYNC_INTERVAL_MINUTES=30 # Sync every 30 minutesRecommended intervals:
- 30 minutes: Frequently updated docs
- 60 minutes: Moderately updated docs (default)
- 120+ minutes: Slowly updated docs
manual
Section titled “manual”No automatic synchronization. You control when syncs happen.
SYNC_MODE=manualBehavior:
- ❌ No automatic syncs
- ✅ Use the
refresh_indexMCP tool to trigger syncs - ✅ Full control over timing
- ✅ Useful for debugging and testing
Best for:
- Development and debugging
- Testing vector store behavior
- Environments with strict control requirements
Example Use Case: You’re testing the indexing behavior and want to control exactly when updates happen.
Triggering Manual Sync:
Use the refresh_index MCP tool from your client:
{ "force": false // false = incremental, true = full reindex}Incremental vs Full Sync
Section titled “Incremental vs Full Sync”Incremental Sync (Default)
Section titled “Incremental Sync (Default)”Only processes changed files by comparing ETags:
- ✅ Fast: Only reprocesses modified/new/deleted files
- ✅ Efficient: Minimal S3 API calls
- ✅ Smart: Automatically detects changes via ETag comparison
When it happens:
- Regular syncs in
startupandperiodicmodes refresh_indexwithforce: false
Full Sync (Manual)
Section titled “Full Sync (Manual)”Reprocesses all files from scratch:
- 🔄 Complete rebuild: Deletes old index and rebuilds from scratch
- ⚠️ Slower: Processes every file in the bucket
- ✅ Fresh start: Useful after configuration changes
When to use:
- After changing embedding providers (Ollama ↔ OpenAI)
- After modifying chunk size or overlap settings
- When you suspect index corruption
Triggering Full Sync:
{ "force": true}Auto-Detection on Startup
Section titled “Auto-Detection on Startup”The server automatically detects if the vector store is empty and performs a full sync:
# After deleting the indexrm -rf ./data/hnswlib-store
# Server automatically rebuilds on next startnpm start # or docker-compose restartYou no longer need to manually call refresh_index after:
- First installation
- Deleting the index
- Switching between embedding providers
Configuration Examples
Section titled “Configuration Examples”Production - Infrequent Updates
Section titled “Production - Infrequent Updates”SYNC_MODE=startupSync once at startup. Restart after documentation updates.
Production - Frequent Updates
Section titled “Production - Frequent Updates”SYNC_MODE=periodicSYNC_INTERVAL_MINUTES=30Sync every 30 minutes to keep index fresh.
Development
Section titled “Development”SYNC_MODE=manualFull control for testing and debugging.
Monitoring Syncs
Section titled “Monitoring Syncs”The server logs detailed sync information:
[INFO] Starting incremental sync...[INFO] Scanned 523 files in S3[INFO] Changes detected: 3 new, 2 modified, 1 deleted[INFO] Sync completed in 12.3sHealth Endpoint
Section titled “Health Endpoint”Check the /health endpoint for index status:
curl http://localhost:3000/healthResponse includes:
- Total documents indexed
- Last sync time
- Vector store status
Best Practices
Section titled “Best Practices”For Most Users
Section titled “For Most Users”- Use
startupmode (default) - Restart server after documentation updates
- Let auto-detection handle empty indexes
For Frequently Updated Docs
Section titled “For Frequently Updated Docs”- Use
periodicmode - Set interval based on update frequency
- Monitor logs for sync errors
For Development
Section titled “For Development”- Use
manualmode - Trigger syncs explicitly via
refresh_index - Test incremental and full syncs
After Configuration Changes
Section titled “After Configuration Changes”- Delete the vector store:
rm -rf ./data/hnswlib-store - Restart the server (auto-sync will rebuild)
- Or manually trigger:
refresh_indexwithforce: true
Troubleshooting
Section titled “Troubleshooting”Index Not Updating
Section titled “Index Not Updating”Check:
- Sync mode is not
manual(unless intended) - S3 credentials are valid
- Files actually changed in S3 (check ETags)
- Server logs for sync errors
Slow Syncs
Section titled “Slow Syncs”- Use incremental sync (don’t force full rebuilds)
- Check network latency to S3
- Verify S3 rate limits aren’t being hit
Missing Files
Section titled “Missing Files”- Run full sync:
refresh_indexwithforce: true - Check S3 bucket contents
- Verify file extensions are
.md