Scrivener-iOS-App-DropboxSync-LLM-MCP-c4a221a9-c7db-4892-a9ec-ec0d117e0187--260207
Scrivener iOS App - Dropbox Sync, LLM MCP RTF to Mardown to RTF (Sync)
My agents in the terminal needs something efficient to be capable to manage various sources like my academic paper I am writing etc. My work is within Scrivener and they needs something to be capable to work back and forth between the 2 sources (from my Scrivener document to the filesystem and so on. ) find on github all potential repo that they could be using to borrow what they need and construct the most flexible and reliable tool that can be
Based on the research, I can now provide you with detailed recommendations for building a robust Scrivener ā Terminal sync tool. Let me compile the key findings:
Scrivener-iOS-Dropbox Sync Tool for LLM MCP Integration
Based on my research into Scrivener's file structure, Dropbox sync patterns, and RTF ā Markdown conversion tools, here's what your terminal agents need to build a flexible and reliable bidirectional sync system:123
Understanding Scrivener's Architecture
Scrivener Project Structure:41
- Projects are stored as
.scrivpackages (essentially folders) - Each document in the Binder is a separate RTF file
- Additional metadata stored in separate files (notes, synopsis, etc.)
- All held together by internal indexes
- Critical: Dropbox can handle this multi-file structure; iCloud/Google Drive cannot reliably
iOS Sync Path:2
- Scrivener iOS uses
Dropbox/Apps/Scrivener/by default - Files sync bidirectionally when Dropbox completes its sync cycle
- Must wait for Dropbox sync completion before accessing files
Key GitHub Repositories for Your Tool
RTF ā Markdown Conversion
- aredridel/rtf2md (Archived but functional)3
- Parses bold, italic, strikeout, rudimentary headings
- Specifically strips Scrivener annotations (quoted-RTF-in-RTF format)
- Works with unified/remark pipeline
- Good starting point for understanding Scrivener's RTF quirks
- dreeves/eat-the-richtext (Recent - 2025)
- Bidirectional Markdown ā RTF converter
- JavaScript implementation
- Actively maintained
- makalin/c2md (Rust, MIT)
- Universal terminal-based converter
- Handles RTF, PDF, Word, Excel, HTML ā Markdown
- Supports batch mode, OCR, customization
- Perfect for terminal agents
- GustavoHennig/MarkdownToRtf (.NET)
- Markdown ā RTF direction
- For writing back to Scrivener
File Watching & Sync Patterns
From code search results:
- cclauss/Ten-lines-or-less - dropbox_change_watcher.py
- Minimal Dropbox change detection pattern
- Python implementation
- brianhuynh2021/python_leetcode - file_watcher.py
- Dropbox-lite mini project implementation
- Shows client-side file watching patterns
- cacheflowe/media-utility-scripts - file-watcher.mjs
- Node.js file watcher with conversion pipeline
- Good pattern for watch ā convert workflows
Recommended Architecture for Your Agents
``` āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā Scrivener iOS App (Dropbox/Apps/Scrivener/) ā ā *.scriv/Files/Data/[document_id].rtf ā āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā (Dropbox Sync) ā¼ āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā Local Filesystem (Termux or Desktop) ā ā ~/Dropbox/Apps/Scrivener/ ā āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā¼ āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā File Watcher Service (watchdog/chokidar) ā ā - Monitors .rtf file changes ā ā - Detects Dropbox sync completion ā ā - Debounces rapid changes ā āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā¼ āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā Conversion Layer ā ā RTF ā Markdown: c2md or Pandoc ā ā Markdown ā RTF: pandoc or MarkdownToRtf ā āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā¼ āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā Agent-Accessible Markdown Repository ā ā ~/workspace/academic-papers/[project]/[doc].md ā ā - Git-trackable format ā ā - LLM-friendly plain text ā ā - MCP server can read/write ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ```
Implementation Strategy
Core Components to Build:
1. Scrivener Project Parser (Python)
```python
Parse .scriv project structure
Extract document hierarchy from scrivener.scrivx
Map internal IDs to readable names
Preserve metadata (synopsis, notes, keywords)
```
2. Bidirectional Sync Manager (Python/Node.js)
```python
Watch ~/Dropbox/Apps/Scrivener/project.scriv/Files/Data/
Detect changes: modified, added, deleted RTF files
Convert RTF ā Markdown on Scrivener changes
Convert Markdown ā RTF on agent edits
Preserve Scrivener's internal structure
```
3. Conversion Pipeline
```bash
Use Pandoc for reliability:
pandoc document.rtf -f rtf -t markdown -o document.md
Or c2md for more control:
c2md --from rtf --to markdown --output workspace/ document.rtf ```
4. Conflict Resolution
- Use file modification timestamps
- Dropbox's conflict resolution creates
(conflicted copy)files - Agent should detect and alert on conflicts
- Never write simultaneously from iOS and terminal
Critical Implementation Notes
Scrivener-Specific Concerns:14
- Multi-file corruption risk: If any internal file gets out of sync, project corrupts
- Never open on multiple devices simultaneously: Wait for complete sync
- Annotations: Scrivener's inline comments use nested RTF format - strip or preserve carefully
- Metadata preservation: Synopsis, notes, labels stored separately from content
- Auto-backup: Scrivener creates zipped backups - use these for recovery
- Wait for Dropbox sync completion: Check for sync status before processing
- Debounce file changes: Wait 2-3 seconds after last change before converting
- Preserve timestamps: RTF timestamps matter for Scrivener's change tracking
- One-way at a time: Don't edit in Scrivener while agents work (or vice versa)
Recommended Tech Stack
For Python Agents (Termux-friendly):
```bash
File watching
pip install watchdog
RTF parsing
pip install striprtf
Conversion
sudo apt-get install pandoc # or use c2md pip install pypandoc
Dropbox sync monitoring
Use inotify or Dropbox API
```
For Node.js Agents:
```bash
File watching
npm install chokidar
Conversion
npm install @dreeves/eat-the-richtext
Or use Pandoc via child_process
```
MCP Server Integration
Your MCP server should expose:
```typescript // Read operations
- list_scrivener_documents(project_path)
- get_document_content(project_path, document_id)
- get_document_metadata(project_path, document_id)
// Write operations
- update_document_content(project_path, document_id, markdown_content)
- create_document(project_path, title, content)
// Sync operations
- sync_to_markdown(project_path, output_dir)
- sync_from_markdown(markdown_dir, project_path)
- get_sync_status(project_path) ```
Sample Workflow
- Initial Setup: Agent scans
.scrivproject, converts all RTF ā Markdown - Background Watch: File watcher monitors both Scrivener folder and markdown workspace
- Scrivener Edit ā Agent: RTF change detected ā convert to MD ā agent can process
- Agent Edit ā Scrivener: MD change detected ā convert to RTF ā preserve structure
- Conflict Detection: If both change, create conflict file and alert user
Testing Strategy
Start with:
- Single document conversion (RTF ā MD)
- Verify Scrivener can still open modified RTF
- Add file watching
- Test bidirectional sync on simple project
- Gradually add metadata preservation
- Test with your actual academic paper
Would you like me to draft the initial Python implementation for the sync manager, or help you set up the specific conversion pipeline for your Termux environment? <span style="display:none">6789101112131415161718</span>
<div align="center">ā</div>Footnotes
-
https://www.reddit.com/r/scrivener/comments/pzbah4/saving_to_dropbox_and_syncing_on_dropbox/ ā© ā©2 ā©3
-
https://scrivener.tenderapp.com/help/kb/ios/dropbox-syncing-with-ios ā© ā©2 ā©3
-
https://www.reddit.com/r/scrivener/comments/fbyjuv/open_scrivener_files_in_ios/ ā© ā©2
-
https://forum.literatureandlatte.com/t/syncing-to-dropbox-via-windows-laptop/138745 ā©
-
https://www.literatureandlatte.com/blog/compile-scrivener-projects-on-ipad-and-iphone ā©
-
https://scrivener.tenderapp.com/help/kb/ios/changing-formatting-and-setting-default-formatting-on-ios ā©
-
https://forum.literatureandlatte.com/t/importing-compile-formats-in-ios-app/45109 ā©
-
https://online-journals.org/index.php/i-jac/article/download/4410/3416 ā©
-
https://scrivener.tenderapp.com/help/kb/ios/customising-compile-settings-on-ios ā©