← Back to Articles & Artefacts
artefactseast

Scrivener-iOS-App-DropboxSync-LLM-MCP-c4a221a9-c7db-4892-a9ec-ec0d117e0187--260207

IAIP Research
scrivener-ios-app-dropboxsync-llm-mcp-c4a221a9-c7db-4892-a9ec-ec0d117e0187
<img src="https://r2cdn.perplexity.ai/pplx-full-logo-primary-dark%402x.png" style="height:64px;margin-right:32px"/>

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 .scriv packages (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

  1. 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
  2. dreeves/eat-the-richtext (Recent - 2025)
    • Bidirectional Markdown ↔ RTF converter
    • JavaScript implementation
    • Actively maintained
  3. makalin/c2md (Rust, MIT)
    • Universal terminal-based converter
    • Handles RTF, PDF, Word, Excel, HTML → Markdown
    • Supports batch mode, OCR, customization
    • Perfect for terminal agents
  4. GustavoHennig/MarkdownToRtf (.NET)
    • Markdown → RTF direction
    • For writing back to Scrivener

File Watching & Sync Patterns

From code search results:

  1. cclauss/Ten-lines-or-less - dropbox_change_watcher.py
    • Minimal Dropbox change detection pattern
    • Python implementation
  2. brianhuynh2021/python_leetcode - file_watcher.py
    • Dropbox-lite mini project implementation
    • Shows client-side file watching patterns
  3. 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

  1. Multi-file corruption risk: If any internal file gets out of sync, project corrupts
  2. Never open on multiple devices simultaneously: Wait for complete sync
  3. Annotations: Scrivener's inline comments use nested RTF format - strip or preserve carefully
  4. Metadata preservation: Synopsis, notes, labels stored separately from content
  5. Auto-backup: Scrivener creates zipped backups - use these for recovery

Sync Reliability:52

  1. Wait for Dropbox sync completion: Check for sync status before processing
  2. Debounce file changes: Wait 2-3 seconds after last change before converting
  3. Preserve timestamps: RTF timestamps matter for Scrivener's change tracking
  4. 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

  1. Initial Setup: Agent scans .scriv project, converts all RTF → Markdown
  2. Background Watch: File watcher monitors both Scrivener folder and markdown workspace
  3. Scrivener Edit → Agent: RTF change detected → convert to MD → agent can process
  4. Agent Edit → Scrivener: MD change detected → convert to RTF → preserve structure
  5. Conflict Detection: If both change, create conflict file and alert user

Testing Strategy

Start with:

  1. Single document conversion (RTF ↔ MD)
  2. Verify Scrivener can still open modified RTF
  3. Add file watching
  4. Test bidirectional sync on simple project
  5. Gradually add metadata preservation
  6. 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

  1. https://www.reddit.com/r/scrivener/comments/pzbah4/saving_to_dropbox_and_syncing_on_dropbox/ ↩ ↩2 ↩3

  2. https://scrivener.tenderapp.com/help/kb/ios/dropbox-syncing-with-ios ↩ ↩2 ↩3

  3. https://github.com/aredridel/rtf2md ↩ ↩2

  4. https://www.reddit.com/r/scrivener/comments/fbyjuv/open_scrivener_files_in_ios/ ↩ ↩2

  5. https://forum.literatureandlatte.com/t/syncing-to-dropbox-via-windows-laptop/138745 ↩

  6. https://markdownlivepreview.dev/tools/rtf-to-markdown ↩

  7. https://www.literatureandlatte.com/blog/compile-scrivener-projects-on-ipad-and-iphone ↩

  8. https://www.vertopal.com/en/convert/rtf-to-markdown ↩

  9. https://www.youtube.com/watch?v=LW7ATR9tW3I ↩

  10. https://scrivener.tenderapp.com/help/kb/ios/changing-formatting-and-setting-default-formatting-on-ios ↩

  11. https://www.youtube.com/watch?v=hVP_Ad7AfU8 ↩

  12. https://forum.literatureandlatte.com/t/importing-compile-formats-in-ios-app/45109 ↩

  13. https://strapi.io/blog/rtf-to-markdown-developers ↩

  14. https://sitegpt.ai/tools/convert-rtf-to-markdown ↩

  15. http://arxiv.org/pdf/2402.06421.pdf ↩

  16. https://online-journals.org/index.php/i-jac/article/download/4410/3416 ↩

  17. http://arxiv.org/pdf/1409.1551.pdf ↩

  18. https://scrivener.tenderapp.com/help/kb/ios/customising-compile-settings-on-ios ↩