@twelvetake/scrivener-mcp 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 TwelveTake Studios LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,543 @@
1
+ # Scrivener MCP Server
2
+
3
+ An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that lets AI assistants read, write, and organize [Scrivener](https://www.literatureandlatte.com/scrivener/overview) projects. Works with Claude, ChatGPT, Gemini, and other MCP-compatible AI tools.
4
+
5
+ ## Features
6
+
7
+ - **Read & Write** - Full access to manuscript content, notes, and synopses
8
+ - **Organize** - Create, move, rename, and delete documents and folders
9
+ - **Search** - Find content across your entire project with context
10
+ - **Compile** - Export your manuscript to PDF directly from AI
11
+ - **Continuity Tools** - Check character/setting consistency across your manuscript
12
+
13
+ Perfect for writers who want AI assistance with drafting, revision, outlining, or project organization.
14
+
15
+ ## Requirements
16
+
17
+ - Node.js 18 or higher
18
+ - Scrivener 3 (macOS or Windows)
19
+ - An MCP-compatible AI client (Claude Desktop, ChatGPT Desktop, Cursor, etc.)
20
+
21
+ ## Installation
22
+
23
+ ### Option 1: npm (Recommended)
24
+
25
+ ```bash
26
+ npm install -g @twelvetake/scrivener-mcp
27
+ ```
28
+
29
+ Then add to your MCP client's configuration. For Claude Desktop (`claude_desktop_config.json`):
30
+
31
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
32
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "scrivener": {
38
+ "command": "scrivener-mcp"
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ ### Option 2: From Source
45
+
46
+ 1. Clone and build:
47
+ ```bash
48
+ git clone https://github.com/TwelveTake-Studios/scrivener-mcp.git
49
+ cd scrivener-mcp
50
+ npm install
51
+ npm run build
52
+ ```
53
+
54
+ 2. Add to your Claude Desktop configuration:
55
+ ```json
56
+ {
57
+ "mcpServers": {
58
+ "scrivener": {
59
+ "command": "node",
60
+ "args": ["/full/path/to/scrivener-mcp/dist/index.js"]
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ 3. Restart Claude Desktop
67
+
68
+ ## Quick Start
69
+
70
+ Once installed, try these commands with your AI assistant:
71
+
72
+ ```
73
+ Open my Scrivener project at /path/to/mynovel.scriv
74
+ ```
75
+
76
+ ```
77
+ Show me the structure of my manuscript
78
+ ```
79
+
80
+ ```
81
+ Read Chapter 3
82
+ ```
83
+
84
+ ```
85
+ Create a new scene called "The Confrontation" in Chapter 5
86
+ ```
87
+
88
+ ```
89
+ Compile everything up to Chapter 7 into a PDF
90
+ ```
91
+
92
+ ```
93
+ Find all mentions of "Sarah" and check if her descriptions are consistent
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Available Tools (22 total)
99
+
100
+ ### Project Management
101
+
102
+ | Tool | Description |
103
+ |------|-------------|
104
+ | `open_project` | Open a Scrivener project (.scriv folder) |
105
+ | `get_structure` | Get the hierarchical structure of the project binder |
106
+
107
+ ### Document Operations
108
+
109
+ | Tool | Description |
110
+ |------|-------------|
111
+ | `read_document` | Read content from a document (optionally includes synopsis) |
112
+ | `write_document` | Write/replace content in a document |
113
+ | `append_to_document` | Append content to end of document without replacing |
114
+ | `create_document` | Create new documents or folders |
115
+ | `delete_document` | Move documents to trash |
116
+ | `move_document` | Reorganize items in the binder |
117
+ | `rename_document` | Rename documents |
118
+ | `batch_read` | Read multiple documents at once (more efficient) |
119
+
120
+ ### Synopsis & Notes
121
+
122
+ | Tool | Description |
123
+ |------|-------------|
124
+ | `read_synopsis` | Read the synopsis (index card text) |
125
+ | `write_synopsis` | Write/update the synopsis |
126
+ | `read_notes` | Read inspector notes for a document |
127
+ | `write_notes` | Write/update inspector notes |
128
+
129
+ ### Search
130
+
131
+ | Tool | Description |
132
+ |------|-------------|
133
+ | `search_content` | Search across all documents |
134
+ | `search_with_context` | Search with surrounding paragraphs for context |
135
+
136
+ ### Compile & Export
137
+
138
+ | Tool | Description |
139
+ |------|-------------|
140
+ | `get_compile_order` | Preview what will be compiled |
141
+ | `compile_manuscript` | Export manuscript to PDF |
142
+ | `set_include_in_compile` | Toggle document's "Include in Compile" setting |
143
+ | `word_count` | Get word count for document or entire manuscript |
144
+
145
+ ### Continuity Checking
146
+
147
+ | Tool | Description |
148
+ |------|-------------|
149
+ | `find_all_mentions` | Find all sentences mentioning a term |
150
+ | `compare_descriptions` | Find descriptive sentences to check consistency |
151
+
152
+ ---
153
+
154
+ ## Tool Reference
155
+
156
+ ### open_project
157
+
158
+ Open a Scrivener project to work with.
159
+
160
+ **Parameters:**
161
+ - `path` (required): Path to the .scriv project folder
162
+
163
+ **Example:**
164
+ ```
165
+ Open my project at D:/Writing/MyNovel.scriv
166
+ ```
167
+
168
+ ---
169
+
170
+ ### get_structure
171
+
172
+ View the binder hierarchy of your project.
173
+
174
+ **Parameters:**
175
+ - `folderId` (optional): Get structure for specific folder only
176
+ - `maxDepth` (optional): Maximum depth to traverse
177
+
178
+ **Example:**
179
+ ```
180
+ Show me the structure of my manuscript
181
+ Show me only what's in Chapter 3
182
+ ```
183
+
184
+ ---
185
+
186
+ ### read_document
187
+
188
+ Read the content of a document.
189
+
190
+ **Parameters:**
191
+ - `documentId` (required): UUID of the document
192
+ - `includeSynopsis` (optional): If true, returns both content and synopsis
193
+
194
+ **Example:**
195
+ ```
196
+ Read the content of "Chapter 1 - The Beginning"
197
+ Read Chapter 3 with its synopsis
198
+ ```
199
+
200
+ ---
201
+
202
+ ### write_document
203
+
204
+ Replace the content of a document.
205
+
206
+ **Parameters:**
207
+ - `documentId` (required): UUID of the document
208
+ - `content` (required): New content to write
209
+
210
+ **Example:**
211
+ ```
212
+ Replace the content of Scene 2 with the revised version
213
+ ```
214
+
215
+ ---
216
+
217
+ ### append_to_document
218
+
219
+ Add content to the end of a document without replacing existing content.
220
+
221
+ **Parameters:**
222
+ - `documentId` (required): UUID of the document
223
+ - `content` (required): Content to append
224
+ - `separator` (optional): Separator between existing and new content (default: two newlines)
225
+
226
+ **Example:**
227
+ ```
228
+ Append this new paragraph to Chapter 5
229
+ Add these notes to the end of the scene
230
+ ```
231
+
232
+ ---
233
+
234
+ ### create_document
235
+
236
+ Create a new document or folder.
237
+
238
+ **Parameters:**
239
+ - `title` (required): Title of the new document
240
+ - `parentId` (optional): UUID of parent folder (defaults to Draft/Manuscript)
241
+ - `documentType` (optional): "Text" or "Folder" (default: "Text")
242
+ - `content` (optional): Initial content
243
+
244
+ **Example:**
245
+ ```
246
+ Create a new chapter called "The Escape"
247
+ Create a folder called "Act Two" and add three scenes to it
248
+ ```
249
+
250
+ ---
251
+
252
+ ### delete_document
253
+
254
+ Move a document to the trash.
255
+
256
+ **Parameters:**
257
+ - `documentId` (required): UUID of the document to delete
258
+
259
+ **Example:**
260
+ ```
261
+ Delete the scene called "Old Draft"
262
+ ```
263
+
264
+ ---
265
+
266
+ ### move_document
267
+
268
+ Move a document to a different folder.
269
+
270
+ **Parameters:**
271
+ - `documentId` (required): UUID of the document to move
272
+ - `targetFolderId` (required): UUID of the target folder
273
+ - `position` (optional): Position in target folder
274
+
275
+ **Example:**
276
+ ```
277
+ Move "The Discovery" scene to Chapter 4
278
+ ```
279
+
280
+ ---
281
+
282
+ ### rename_document
283
+
284
+ Rename a document.
285
+
286
+ **Parameters:**
287
+ - `documentId` (required): UUID of the document
288
+ - `newTitle` (required): New title
289
+
290
+ **Example:**
291
+ ```
292
+ Rename "Untitled Scene" to "The Confrontation"
293
+ ```
294
+
295
+ ---
296
+
297
+ ### batch_read
298
+
299
+ Read multiple documents at once. More efficient than multiple read_document calls.
300
+
301
+ **Parameters:**
302
+ - `documentIds` (required): Array of document UUIDs to read
303
+
304
+ **Example:**
305
+ ```
306
+ Read all the scenes in Chapter 2
307
+ ```
308
+
309
+ ---
310
+
311
+ ### read_synopsis / write_synopsis
312
+
313
+ Read or write the synopsis (index card text) for a document.
314
+
315
+ **Parameters:**
316
+ - `documentId` (required): UUID of the document
317
+ - `synopsis` (required for write): Synopsis text
318
+
319
+ **Example:**
320
+ ```
321
+ Show me the synopsis for Chapter 3
322
+ Update the synopsis for "The Chase" to summarize the new version
323
+ ```
324
+
325
+ ---
326
+
327
+ ### read_notes / write_notes
328
+
329
+ Read or write inspector notes for a document.
330
+
331
+ **Parameters:**
332
+ - `documentId` (required): UUID of the document
333
+ - `notes` (required for write): Notes content
334
+
335
+ **Example:**
336
+ ```
337
+ Show me my notes for Scene 5
338
+ Add a note to Chapter 2 about the timeline
339
+ ```
340
+
341
+ ---
342
+
343
+ ### search_content
344
+
345
+ Search for content across all documents.
346
+
347
+ **Parameters:**
348
+ - `query` (required): Search query
349
+
350
+ **Example:**
351
+ ```
352
+ Search for mentions of "the artifact"
353
+ Find all scenes that reference the castle
354
+ ```
355
+
356
+ ---
357
+
358
+ ### search_with_context
359
+
360
+ Search with surrounding paragraphs for better context.
361
+
362
+ **Parameters:**
363
+ - `query` (required): Search term
364
+ - `contextParagraphs` (optional): Paragraphs before/after to include (default: 2)
365
+
366
+ **Example:**
367
+ ```
368
+ Search for "the ritual" with 3 paragraphs of context
369
+ ```
370
+
371
+ ---
372
+
373
+ ### get_compile_order
374
+
375
+ Preview what documents will be compiled and in what order.
376
+
377
+ **Parameters:**
378
+ - `stopAtTitle` (optional): Stop at document with this title (partial match)
379
+
380
+ **Example:**
381
+ ```
382
+ Show me the compile order
383
+ What would be compiled up to Chapter 5?
384
+ ```
385
+
386
+ ---
387
+
388
+ ### compile_manuscript
389
+
390
+ Compile the manuscript to a PDF file.
391
+
392
+ **Parameters:**
393
+ - `outputPath` (required): Full path for the output PDF
394
+ - `title` (optional): Book title for cover page and PDF metadata (default: project filename)
395
+ - `author` (optional): Author name for cover page and PDF metadata
396
+ - `stopAtTitle` (optional): Stop at document with this title
397
+ - `includeTitle` (optional): Include document titles as headers (default: true)
398
+ - `fontSize` (optional): Font size in points (default: 12)
399
+ - `lineSpacing` (optional): Line spacing multiplier (default: 1.5)
400
+
401
+ **Example:**
402
+ ```
403
+ Compile my full manuscript to D:/Writing/MyNovel.pdf
404
+ Compile with title "Keystone: Aftermath" by Dave Cilluffo
405
+ Compile everything up to Chapter 7 to D:/Writing/Draft.pdf
406
+ Compile with 14pt font and double spacing
407
+ ```
408
+
409
+ ---
410
+
411
+ ### set_include_in_compile
412
+
413
+ Toggle whether a document should be included when compiling.
414
+
415
+ **Parameters:**
416
+ - `documentId` (required): UUID of the document
417
+ - `include` (required): true to include, false to exclude
418
+
419
+ **Example:**
420
+ ```
421
+ Exclude the "Notes" document from compile
422
+ Include "Deleted Scene" back in the compile
423
+ ```
424
+
425
+ ---
426
+
427
+ ### word_count
428
+
429
+ Get word count for a specific document or the entire manuscript.
430
+
431
+ **Parameters:**
432
+ - `documentId` (optional): UUID of document (omit for entire manuscript)
433
+
434
+ **Example:**
435
+ ```
436
+ How many words are in my manuscript?
437
+ What's the word count for Chapter 3?
438
+ ```
439
+
440
+ ---
441
+
442
+ ### find_all_mentions
443
+
444
+ Find all sentences mentioning a term. Great for character/setting consistency checks.
445
+
446
+ **Parameters:**
447
+ - `term` (required): Term to search for (e.g., character name)
448
+
449
+ **Example:**
450
+ ```
451
+ Find all mentions of "Sarah"
452
+ Show me every sentence that mentions "the lighthouse"
453
+ ```
454
+
455
+ ---
456
+
457
+ ### compare_descriptions
458
+
459
+ Find descriptive sentences for a term (sentences with "was", "had", "looked", etc.). Helps identify inconsistent descriptions.
460
+
461
+ **Parameters:**
462
+ - `term` (required): Term to find descriptions for
463
+
464
+ **Example:**
465
+ ```
466
+ Find all descriptions of Sarah
467
+ Check how I've described the mansion throughout the book
468
+ Are my descriptions of Marcus consistent?
469
+ ```
470
+
471
+ ---
472
+
473
+ ## Important Notes
474
+
475
+ - **Close Scrivener first** before using this server to avoid conflicts
476
+ - The server modifies the `.scrivx` binder file and RTF content files directly
477
+ - Always keep backups of important projects
478
+ - Only documents marked "Include in Compile" are included in PDF export
479
+ - This is an unofficial tool and is not affiliated with Literature & Latte
480
+
481
+ ## How It Works
482
+
483
+ Scrivener projects (`.scriv` folders) contain:
484
+ - A `.scrivx` XML file that defines the binder structure
485
+ - Individual RTF files for each document's content
486
+ - Synopsis and notes stored as plain text and RTF files
487
+
488
+ This server parses and modifies these files directly, allowing AI assistants to interact with your project programmatically.
489
+
490
+ ## Support This Project
491
+
492
+ If you find this useful, consider supporting development:
493
+
494
+ [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support-yellow?style=flat&logo=buy-me-a-coffee)](https://buymeacoffee.com/twelvetake)
495
+ [![Ko-fi](https://img.shields.io/badge/Ko--fi-support-ff5e5b?style=flat&logo=ko-fi)](https://ko-fi.com/twelvetake)
496
+
497
+ ## License
498
+
499
+ MIT License - see [LICENSE](LICENSE) for details.
500
+
501
+ ---
502
+
503
+ ## Changelog
504
+
505
+ ### v1.3.2
506
+ - **Added title/author to compile** - `compile_manuscript` now accepts `title` and `author` parameters for cover page and PDF metadata
507
+
508
+ ### v1.3.1
509
+ - **Fixed PDF compile formatting** - Paragraphs now have proper spacing instead of running together
510
+ - **Added text formatting to PDF** - Bold, italic, and bold-italic are now rendered in compiled PDFs
511
+ - **Improved chapter titles** - Larger font (18pt), bold, with better spacing
512
+
513
+ ### v1.3.0
514
+ - **Added utility tools**: `word_count`, `append_to_document`, `set_include_in_compile`, `read_notes`, `write_notes`, `batch_read`
515
+ - **Added continuity tools**: `search_with_context`, `find_all_mentions`, `compare_descriptions`
516
+ - 22 tools total
517
+
518
+ ### v1.2.0
519
+ - **Added compile features**: `get_compile_order`, `compile_manuscript` (PDF export via pdfkit)
520
+ - Compile supports partial export with `stopAtTitle` parameter
521
+ - Added synopsis tools: `read_synopsis`, `write_synopsis`
522
+
523
+ ### v1.1.3
524
+ - **Fixed empty paragraph handling** - Empty lines no longer cause extra spacing in compiled output
525
+
526
+ ### v1.1.2
527
+ - **Fixed RTF paragraph formatting** - Resolved issue where `\par\par` patterns caused section breaks in Scrivener compile
528
+
529
+ ### v1.0.1
530
+ - **Fixed DraftFolder detection** - `create_document` now finds the manuscript root by type (`DraftFolder`) instead of requiring title to be "Draft" or "Manuscript"
531
+ - **Fixed empty search query** - `search_content` with empty query now returns empty array
532
+ - **Fixed empty rename validation** - `rename_document` rejects empty titles
533
+
534
+ ### v1.0.0
535
+ - Initial release with 11 core tools
536
+ - Custom RTF parser with formatting preservation
537
+ - Support for bold, italic, em-dash, en-dash
538
+
539
+ ## Credits
540
+
541
+ Developed by Dave Cilluffo / [TwelveTake Studios](https://twelvetake.com)
542
+
543
+ Scrivener is a registered trademark of [Literature & Latte Ltd](https://www.literatureandlatte.com/).
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};