Ghostwriter
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.
Ghostwriter
A small document editor, in the spirit of Google Docs, that you and your AI assistant edit together. Documents live on a server, so any number of editors can be open on the same document and stay in step, and an AI assistant can read and edit it while you watch: its edits are typed out on the page, old text erased and new text typed in.
It runs three ways from one codebase:
A website. Home screen with all your documents (start one, search, rename, copy, remove with undo) and an editor with a toolbar, outline and page.
An MCP server at
/mcp. Any MCP client can list, read and edit documents with ordinary tools.An MCP App for Claude and ChatGPT. The editor itself appears inside the chat, in the conversation or in a side panel, and the assistant edits the document you are looking at. The "app" is the website, not a rebuilt copy.
The page also describes itself to a browser-based agent through WebMCP where the browser supports it.
Quick start
npm install
npm start # http://localhost:3010Or with Docker (documents are kept in ./data):
docker compose up -d --buildSetting | Default | What it is |
|
| Port to listen on |
|
| Interface to listen on |
|
| Where documents are stored ( |
|
| The address the site is reachable at from a browser. The MCP App view loads its files and calls its API from here, so set it to your real public address (for example |
Related MCP server: @node2flow/google-docs-mcp
Connect an assistant
Make the server reachable over HTTPS at a public address and set
PUBLIC_ORIGINto it. (Claude and ChatGPT need a URL they can reach;localhostonly works for the plain website.)Add
https://<your address>/mcpas a custom connector: in Claude, Customize > Connectors; in ChatGPT, developer mode > Apps. The site's menu has an "Add to Claude" link that builds the address for you.In a chat, ask the assistant to open Ghostwriter.
Sign-in is off by default. Then anyone who can reach the site or
/mcpcan read, edit and remove every document. That is fine for a personal prototype on a private network. To put it on the open internet, turn on sign-in.
Sign-in (optional)
Point Ghostwriter at your own OpenID Connect provider (Authelia, Keycloak, Authentik, Zitadel, Okta, Google, Microsoft Entra...) and it asks people to sign in there:
The website shows a sign-in screen. Signing in sends you to your provider and back; the session lasts a week.
Claude, ChatGPT and other MCP clients still connect with just the URL. Ghostwriter acts as an OAuth server for them: the app registers itself, you sign in at your provider, approve the app on Ghostwriter's own page, and the app gets Ghostwriter's tokens. Your provider never has to know about Claude or ChatGPT, and it does not need to support dynamic client registration.
The editor inside the chat gets a short-lived token from that connection.
Connected apps in the menu lists the apps you approved, with a Disconnect button that cuts each one off at once.
Everyone who can sign in shares one library of documents.
Set it up
Serve Ghostwriter over https and set
PUBLIC_ORIGINto that address.At your provider, create a confidential OpenID Connect client for Ghostwriter:
redirect URI:
https://<your address>/auth/callback(the only one; MCP apps register with Ghostwriter, not with the provider)grant type authorization code, PKCE (S256) required or allowed, client authentication
client_secret_basicorclient_secret_postscopes
openid profile email, plusgroupsif you let people in by group
Set these, for example in
.envnext todocker-compose.yml:
Setting | Required | What it is |
| yes | Your provider's issuer URL, for example |
| yes | The client you created. |
| for a confidential client | Its secret, or a file holding it. |
| one of these three | Groups whose members may sign in (comma-separated), from the |
| Email addresses that may sign in. Only counted when the provider says the email is verified ( | |
|
| |
| no | Claim that lists groups. Default |
| no | Scopes to ask for. Default |
| no | Website session length. Default 7. |
| no | Lifetime of an app's access token (default 60) and of its sign-in (default 30 days; then the person signs in again). |
| no | Signs cookies and editor tokens. Default: a random one made once and kept in |
| behind a proxy | Which proxies' |
Ghostwriter refuses to start if sign-in is half set up (an issuer but no allowlist, or http on a public address), rather than starting open.
Restart, then in Claude or ChatGPT remove the old connector and add
https://<your address>/mcpagain. It asks you to sign in and approve.
Provider notes:
Authelia: add a client under
identity_providers.oidc.clientswithpublic: false,require_pkce: true,pkce_challenge_method: S256,token_endpoint_auth_method: client_secret_basic, the redirect URI above and the scopes above. Groups come from lldap or your users file; useOIDC_ALLOWED_GROUPS.Google: create an OAuth client of type "Web application" and use
OIDC_ISSUER=https://accounts.google.comwithOIDC_ALLOWED_EMAILS(Google has no groups claim).Keycloak: the issuer is
https://<host>/realms/<realm>. Add a "groups" client scope with a group membership mapper (full group path off) to useOIDC_ALLOWED_GROUPS.
What is kept, and good to know
DATA_DIR/auth/state.json(owner-only): apps that registered, who approved which, and tokens as hashes only. Back it up with the documents.DATA_DIR/auth/secretsigns cookies; deleting it signs everyone out.Removing someone from the allowlist (or the group) takes effect for new sign-ins at once. A session already open, or an app already connected, keeps the groups it had when the person signed in: up to
SESSION_DAYSfor the website andOAUTH_REFRESH_DAYSfor apps. Disconnect the app or shorten those to make it quicker. Changing the allowlist settings themselves applies at once.Signing out of Ghostwriter does not sign you out of your provider, so signing in again may be one click.
Tools
list_documents, create_document, open_document, get_document, get_section, find_nodes, replace_text, replace_nodes, insert_nodes, insert_list_items, delete_nodes, set_title. Inside the app view the assistant also gets editor_* tools that work on the open document, including what you have selected. Edit tools take an optional expected_revision and return the nodes they removed and added. Every tool declares whether it is read-only, and document text is marked as untrusted so it is never treated as instructions.
How it works
server.js: Express and the MCP SDK. Stores documents, serves the website and/api, and the MCP endpoint (stateless).auth/: optional sign-in.oidc.js(signing in at your provider),provider.js(the OAuth server for MCP apps, on the MCP SDK's router),store.js,pages.js(the approval page),index.js(settings, sessions, guards).site/: the website, plain ES modules with no build step.model.js(the document),tools.js(the tools),merge.js(three-way merge by block id),sync.js(polling and saving),view.js(the editor),host.js(what only matters inside a chat app).Two editors on one document are merged on the server by block id; the person's cursor stays put when someone else's change arrives.
The MCP App view is
site/index.htmlwith its asset paths made absolute, plus a small boot script. A deploy of the site is a deploy of the app.
More detail for contributors is in CLAUDE.md.
Tests
npm test # server tests and site tests, no network, no API key
npm run evals:selftest # the eval harness checks itself
npm run e2e # a real browser and a stand-in chat host (needs Chrome)
npm run e2e:auth # the same with sign-in on, against a stand-in providernpm run evals runs scenarios against a real model and needs an Anthropic API key (see evals/README.md); it costs money and is never run by CI.
Limits
Light theme only. Plain-text blocks only (no bold or italic). Concurrent edits to the very same paragraph keep the one saved first. Undo is per editor and starts over when another editor's change arrives.
License
MIT. See LICENSE.
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
Share markdown as a link anyone can comment on and edit, no account. MCP server and CLI.
An MCP server that used to create notes
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that allows users to efficiently search and reference user-configured documents through document listing, grep searching, semantic searching with OpenAI Embeddings, and full document retrieval.43MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Docs — create, read, edit, format, and manage documents through 26 tools via the Model Context Protocol.13 npm1MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides document management capabilities including reading, editing, and summarizing documents through a CLI chat interface powered by Claude AI.-
- AlicenseAqualityBmaintenanceAn MCP server that provides surgical read/write access to individual sections of Markdown files, allowing agents to fetch, edit, or delete specific slices without touching the entire file.71MIT