nw-MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
nw-MCP — Unofficial MCP server for novelWriter
Status: phases 1–5 implemented — read core, story bible, analysis, opt-in safe edits and structural writes; the release packaging (v1.0: PyPI, registry listing) is still pending. See the roadmap for what lands in which phase.
This is an unofficial, independent tool. It is not affiliated with, endorsed by, or supported by the novelWriter project — please do not report issues with it to the novelWriter project.
novelWriter's maintainers keep generative AI out of the app itself: their AI Policy states plainly that they will not add features that generate text for you, while acknowledging that language models have a legitimate, pre-generative use in text analysis. nw-MCP is built for that analysis side, and we ask you to use it that way — as an AI-assisted helper for understanding, checking and integrating your novelWriter project, not as a content generator. The words should stay yours.
What it is
nw-MCP is a Model Context Protocol server that lets AI clients
(Claude Desktop, Claude Code, VS Code, Cursor and others) read and analyze novelWriter projects.
It works directly on novelWriter's documented file format — nwProject.nwx plus the
content/*.md document files — and never modifies or bundles novelWriter.
It is an analysis and continuity assistant, not an AI co-writer. Reading and analysis are the
core; writing tools are off by default and only work when you explicitly set NW_MCP_ALLOW_WRITE=1
(see Configuration).
Intended use
Treat nw-MCP as an AI-assisted integration layer for novelWriter, not an AI co-writer. The aim is to smooth novelWriter into the rest of your workflow: ask an AI client about your story bible, continuity and structure instead of paging through files yourself; wire project state into dashboards, checklists or other writing tools; automate the mechanical edits — synopses, metadata, placing text you have written. The creative work stays with you, which is also the stance of novelWriter's own AI Policy. If you are looking for a tool that generates prose for you, this is deliberately not it.
Capabilities
Project overview — title, author, word counts, project tree with statuses.
Outline-first reading — parts, chapters and scenes in order, with synopses and POV, so the AI's context stays small. Full text is loaded only on demand, paginated.
Story bible — all
@char,@location,@plot,@object,@entityand other tags, where each is defined, and where it is referenced.Continuity analysis — undefined and unused tags, headings without POV, missing synopses, character timelines, POV distribution, word-count targets.
Opt-in safe edits (v0.4) — with
NW_MCP_ALLOW_WRITE=1:update_synopsisandupdate_metadataedit only%Synopsis:/@keyword:lines of one heading section. Every write is guarded by a lock-file check, backed up to a timestamped.mcp-backups/folder, written atomically, and verified by re-parsing (auto-restored on any inconsistency). The novelWriter index is never written — rebuild it (F9) after edits.Structural writes (v0.5) — with
NW_MCP_ALLOW_WRITE=1:append_to_documentappends prose paragraphs to one heading section (never reflowing existing lines),replace_document_textreplaces one exact, unique match (refusing 0 or several matches, and any contact with headings or@/%metadata lines), andcreate_documentadds a new document to the tree — a spec-conformantcontent/<handle>.mdplus a minimal, style-preservingnwProject.nwxedit. Prose-only payloads: lines starting with#,@or%are refused everywhere. Same safety pipeline as v0.4; Trash parents refused.
What it will not do
Modify, fork or patch novelWriter itself.
Generate prose for you — by design (see Intended use).
Sync with a running novelWriter instance — there is no API for this.
Touch the
meta/folder (novelWriter's own index cache).
Related MCP server: TypeWriter MCP
Install
nw-MCP is a local stdio MCP server: your MCP client launches it as a subprocess and communicates with it over stdin/stdout. You never start it by hand — you point a client config at it (see Configuration).
From PyPI (pending)
uvx mcp-server-for-novelwriterFrom source (current)
Requires Python 3.11+. The easiest way is uv:
git clone <repo-url> nw-MCP
cd nw-MCP
uv tool install .Or plain pip in a virtual environment:
git clone <repo-url> nw-MCP
cd nw-MCP
python -m venv .venv
.venv\Scripts\python -m pip install . # Windows
# .venv/bin/python -m pip install . # macOS / LinuxEither way you end up with a novelwriter-mcp command (also runnable as python -m nw_mcp from
that environment). Give your client the absolute path to that command.
Configuration
The server is configured at launch through environment variables (or a --project PATH flag that
overrides NW_PROJECT_PATH):
Variable | Default | Purpose |
| (required) | Path to the novelWriter project folder — the folder containing |
|
| Registers the 5 write tools ( |
|
| Includes Archive items in results |
|
| Maximum characters per tool response |
One server instance serves one project: the path is fixed at launch on purpose, so the AI cannot aim the server at arbitrary folders. To work on a different project, point the same entry at another folder, or register several server entries — one per project.
Most MCP clients take the same core shape — a command, optional args, and env. Claude Desktop style:
{
"mcpServers": {
"novelwriter": {
"command": "C:/dev/nw-MCP/.venv/Scripts/novelwriter-mcp.exe",
"args": [],
"env": {
"NW_PROJECT_PATH": "C:/Users/you/Documents/My Novel.nw",
"NW_MCP_ALLOW_WRITE": "1"
}
}
}
}Ready-made configs live in examples/:
examples/claude-desktop-config.json— Claude Desktop, running from PyPI viauvx(once published).examples/claude-desktop-config-from-source.json— Claude Desktop, running from a source checkout.examples/vscode-mcp.json— VS Code. Other clients (Cursor, Zed, …) use the same command/args/env idea under their own schema.
Leave NW_MCP_ALLOW_WRITE out (or at 0) for a read-only server with 13 tools; set it to 1 for
all 18. Write tools are marked destructive, so MCP clients prompt before each call, and writes only
succeed when novelWriter itself has the project closed (see Safety).
Trying it out
With MCP Inspector. Run these from the repo
checkout so the relative .venv/... path resolves — from anywhere else, use the absolute path to
the exe (D:\...\nw-MCP\.venv\Scripts\novelwriter-mcp.exe).
UI mode — set NW_PROJECT_PATH in the environment panel:
npx @modelcontextprotocol/inspector .venv/Scripts/novelwriter-mcp.exeHeadless (CLI mode) — the Inspector does not forward your shell environment to the server, so use
--project (or env in a client config). Point it at a real novelWriter project folder (the
folder containing nwProject.nwx):
npx @modelcontextprotocol/inspector --cli .venv/Scripts/novelwriter-mcp.exe --project C:/path/to/MyNovel.nw --method tools/call --tool-name get_project_infoSafety
Read-only by default. Write tools are not even registered unless you enable them.
Lock-file guard. If novelWriter has the project open (
nwProject.lockpresent), writes are refused — a running novelWriter may overwrite files at any moment.Backups. Every write first copies affected files to
.mcp-backups/.Atomic writes. Temp file, then rename, so a crash cannot leave half-written files.
Input validation. Handles must match the documented 13-character hex pattern; paths must stay inside the project folder.
Format version gate. Unknown
nwProject.nwxversions get read-only mode or are refused.Hardened XML parsing and no shell or code execution of any kind.
See SECURITY.md for details and COMPATIBILITY.md for tested novelWriter / file-format versions.
Roadmap
Phase | Version | Scope |
0. Research | — | File Format Spec study, fixture projects, name and license |
1. Read core | v0.1 | Storage layer; info, tree, outline, read, search tools |
2. Story bible | v0.2 | Tag index, |
3. Analysis | v0.3 | Continuity report, timelines, POV and word-count reports, prompts |
4. Safe edits | v0.4 | Opt-in metadata and synopsis edits, lock guard, backups |
5. Structural writes | v0.5 |
|
6. Release | v1.0 | PyPI package, docs, MCP Registry listing |
The changelog documents what shipped in each release.
Development
uv sync # create .venv and install dev dependencies
uv run pytest # run the test suite
uv run ruff check . # lint
uv run ruff format . # formatLayout (src layout, clean-room parser — no novelWriter code is imported):
src/nw_mcp/
├── storage/ # .nwx / document parsers, lock-file checks, safe writer (opt-in)
├── domain/ # outline, tag index, search, continuity analysis
└── mcp_layer/ # thin MCP tool/resource/prompt wrappers, output limitsLicense
MIT — see LICENSE. novelWriter itself is a separate project under GPL-3.0; this tool neither imports nor bundles its code.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Story continuity, novel memory, and series bible for fiction writers, shared with AI assistants
AI-native fiction platform. Any AI can register, read, search and co-author novels via MCP or REST.
Read and edit your screenplays, series and novels in Screenwriting AI, with edits you approve.
Writing studio for novels and screenplays: read your projects and run cited fact-checks.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables AI assistants to read, write, organize, search, and compile Scrivener writing projects. Supports manuscript editing, document management, consistency checking, and PDF export for writers using Scrivener 3.228 npm-
- AlicenseAqualityCmaintenanceEnables AI assistants to read and edit storylines for the Typewriter Minecraft plugin, including pages, dialogues, facts, and triggers, over websocket or offline file mode.151MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading work outlines, contexts, and chapters, and saving chapters with version protection for an AI novel writing tool.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI-driven long-form novel creation and management, including chapter generation, character and timeline tracking, semantic memory retrieval, version savepoints, and deep consistency checking across multiple projects through MCP tools, with support for local LM Studio or any OpenAI-compatible API.18MIT