docmost-community-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@docmost-community-mcp search the wiki for our onboarding guide and summarize it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
docmost-community-mcp
Model Context Protocol server for self-hosted Docmost Community / Open Source Edition, with a shared HTTP mode, a Docmost account per model for writes, and lossless page writes.
This repository is a fork of dilruwanm/docmost-community-mcp, maintained on its own since 2026-10-05. Upstream is kept as a git remote for reference only, and changes made here are not sent upstream. This fork is not published to npm.
Official Docmost MCP and API keys are Enterprise-only. This server talks to the same internal HTTP API the Docmost web app uses, so you can search, read, write and organize a Community wiki from any MCP client.
What this fork adds
Area | What | Section |
Shared hosting | Streamable HTTP and legacy SSE from one process, behind a secret URL path | HTTP mode |
Attribution | Each write runs under the Docmost account of the model named in | Actors |
Safer writes |
| Safer page writes |
Lossless writes |
| Lossless writes |
Section edits |
| Section edits |
Related MCP server: Confluence MCP Server
Compatibility
Page body writes need Docmost v0.71+; the server checks the version at runtime.
Verified against Docmost 0.96.0. The schema used to check
docwrites (src/docmost-schema.ts) is generated from that version. Regenerate it after every Docmost upgrade, as described in "Lossless writes".
Install
Install from this repository. npx docmost-community-mcp fetches whatever npm holds under that name, which is not built from this code.
git clone https://github.com/kostritsaalex/docmost-community-mcp.git
cd docmost-community-mcp
npm install
npm run buildFor a shared server, build the Docker image from a pinned commit (see "Docker").
Tools
Pages: search_pages, get_page, create_page, update_page, get_section, replace_section, list_pages, list_child_pages, duplicate_page, copy_page_to_space, move_page, move_page_to_space, delete_page, restore_page, list_trash, get_page_history, get_history_version, get_breadcrumbs, get_backlinks, export_page
Spaces: list_spaces, get_space, create_space, update_space, delete_space, export_space
Comments: get_comments, create_comment, update_comment, delete_comment
Search / people: search_attachments, search_suggest, list_workspace_members, get_current_user
Files / labels / access: upload_attachment, get_attachment_info, list_page_labels, add_page_labels, remove_page_label, list_space_members, add_space_members, remove_space_member, update_space_member_role
In HTTP mode export_page, export_space and upload_attachment are not registered (see "Security model").
Page bodies. create_page and update_page take the body either as markdown, which Docmost converts (format: "markdown"), or as doc, ProseMirror JSON stored without any conversion (format: "json"). get_page returns Markdown by default and the stored document with format: "json". A Markdown round trip is lossy: table header rows, internal links, colours and column widths do not survive it. Change existing pages through doc or the section tools, never by rewriting a Markdown read. Comment bodies are Markdown. The server does not open a Yjs socket.
Environment
Variable | Required | Purpose |
| yes | Instance URL, e.g. |
| one auth method | Community login |
| one auth method |
|
| no | Session cache file |
| no |
|
Email/password is preferred. The JWT is cached under ~/.docmost-community-mcp/session.json and refreshed on 401. MFA accounts cannot complete login here — use DOCMOST_AUTH_TOKEN instead.
Use a dedicated Docmost user. Do not commit credentials.
Local stdio clients
On a single machine, run the built server over stdio. In an mcpServers block (Cursor, Claude Desktop and similar):
{
"mcpServers": {
"docmost": {
"command": "node",
"args": ["/absolute/path/to/docmost-community-mcp/dist/index.js"],
"env": {
"DOCMOST_URL": "https://docs.example.com",
"DOCMOST_EMAIL": "you@example.com",
"DOCMOST_PASSWORD": "your-password"
}
}
}
}Claude Code:
claude mcp add docmost --env DOCMOST_URL=https://docs.example.com --env DOCMOST_EMAIL=you@example.com --env DOCMOST_PASSWORD=secret -- node /absolute/path/to/docmost-community-mcp/dist/index.jsA stdio entry keeps the Docmost password in the client config. With a shared server, clients hold only its URL (see "HTTP mode").
HTTP mode (remote hosting)
By default the server speaks MCP over stdio. Set MCP_TRANSPORT=http to run one shared instance that many clients reach over the network. One process keeps one Docmost login and serves every MCP session.
Both MCP transports are served, so clients connect without a bridge such as mcp-remote:
Path | Transport | Typical clients |
| Streamable HTTP (POST, GET, DELETE) | Current CLIs and IDEs |
| Legacy HTTP+SSE | Connectors that only speak SSE |
| Liveness check, returns | Docker, monitoring |
Variable | Default | Purpose |
|
|
|
| none, required | Secret first path segment, at least 32 characters of |
| none | Comma-separated host names accepted in the |
|
| Bind address ( |
|
| Listen port |
|
| Streamable HTTP sessions with no traffic for this long are closed; the client starts a new one |
The client URL is https://mcp.example.com/<secret>/mcp, or https://mcp.example.com/<secret>/sse for SSE-only clients.
Security model
The URL is the credential. Anyone who has it acts as the configured Docmost user. Treat it like a password, and rotate the secret if it leaks.
Any path without the right secret gets an empty
404, so a scan cannot tell the server is there. The secret is compared in constant time and never logged.With
MCP_ALLOWED_HOSTSset, a request with any otherHostheader gets403(DNS rebinding protection).Docmost credentials come only from the server environment. Use a dedicated member account, not the workspace owner.
DOCMOST_READ_ONLY=truegives read-only access.export_page,export_spaceandupload_attachmentare not offered in HTTP mode. They read or write files on the machine running the server, which for a shared server is not the caller's computer and holds the credentials.Terminate TLS in a reverse proxy and publish the port on loopback only. Keep proxy access logs off for this site, or strip the path, because the path carries the secret.
Actors: one Docmost account per model
A shared server normally writes everything as DOCMOST_EMAIL. To see in Docmost page history which model created or changed a page, define named actors, each with its own Docmost account:
DOCMOST_ACTORS=opus,sonnet,other
DOCMOST_ACTOR_OPUS_EMAIL=opus@example.com
DOCMOST_ACTOR_OPUS_PASSWORD=...
DOCMOST_ACTOR_SONNET_EMAIL=sonnet@example.com
DOCMOST_ACTOR_SONNET_PASSWORD=...
DOCMOST_ACTOR_OTHER_EMAIL=other@example.com
DOCMOST_ACTOR_OTHER_PASSWORD=...Names are lowercase letters, digits and -; in variable names they are upper-cased and - becomes _. The server refuses to start if an actor lacks its email or password, and the message names the variable, never its value.
With actors defined:
Every write or destructive tool requires an
actorinput. Its allowed values are the actor names, listed in the tool schema, so the agent sees them. A missing or unknown actor is rejected before anything is written.The write runs in Docmost as that actor, with its own login and session cache (
session.<actor>.jsonnext to the default one).Read tools have no
actorinput and use the default account (DOCMOST_EMAIL), so a read never fails because an actor lacks access to a space.Without
DOCMOST_ACTORS, nothing changes: noactorinput, every call uses the default account. This also works in stdio mode.
Trust model: attribution, not authentication. The server cannot verify which model is calling. Anyone with the URL can name any actor, so giving actors different Docmost rights is not a security boundary. Use the actors to record who wrote what; control access through the URL and the rights of the accounts as a group.
Docker
Dockerfile builds an HTTP-mode image that runs as the node user. deploy/compose.example.yaml runs it with a read-only root filesystem, the port on 127.0.0.1 only, and settings from a .env file:
cp .env.example deploy/.env # fill in DOCMOST_*, MCP_PATH_SECRET, MCP_ALLOWED_HOSTS
chmod 600 deploy/.env
docker compose -f deploy/compose.example.yaml up -d --buildCaddy in front of it:
mcp.example.com {
reverse_proxy 127.0.0.1:3001
}Safer page writes
update_pagewithmarkdownrequiresoperation(replace,appendorprepend). There is no default: a missing operation used to meanreplace, which silently overwrote the whole page. Title or icon changes without a body need no operation. The rule applies in stdio and HTTP mode.Every tool that takes a page id (
page_id,parent_page_id,after_page_id) accepts a UUID or a slugId. A slugId is resolved to the UUID with one/pages/infocall before the endpoint is called, because some Docmost endpoints answer a slugId with a 500 or a misleading 400.
Lossless writes (doc)
create_page and update_page accept the body either as markdown or as doc, a ProseMirror document exactly as get_page with format: "json" returns it. A doc is sent to Docmost with format: "json" and stored as is, with no Markdown conversion, so tables, links and formatting survive. To change an existing page: read it with get_page format: "json", edit the content object, send it back as doc with operation: "replace". markdown and doc cannot be combined; operation is required with either. A JSON string in doc is parsed first.
Every doc is checked against Docmost's own ProseMirror schema before it is sent: unknown node or mark types, missing required attributes and content in the wrong place (text directly in doc, a cell outside a table row) are rejected with nothing written. Docmost itself does not do this: its json check never calls check() and silently unwraps unknown node types, so a malformed doc would be stored and the page damaged without an error (found on Docmost 0.96.0).
The schema lives in src/docmost-schema.ts, generated from a running Docmost. After a Docmost upgrade, regenerate it:
# on the Docmost host, from the folder with its compose file (service name may differ)
docker compose exec -T -w /app/apps/server docmost node - < dump-docmost-schema.cjs > docmost-schema.json
# in this repository, with the dump copied to scripts/ (ignored by git)
node scripts/write-docmost-schema.mjs scripts/docmost-schema.jsonKeep prosemirror-model at the version Docmost uses (see its pnpm-lock.yaml; 1.25.11 for Docmost 0.96.0), so the check behaves exactly like Docmost's parser.
Section edits (get_section, replace_section)
Docmost has no partial page update over REST, and a large page can be too big for an agent to read and resend whole. The gateway does the read-modify-write itself:
get_sectionwithoutheadingreturns the page outline: top-level headings with level, position and section size. Withheadingit returns that section's body as a ProseMirrordocand ahash.Edit the returned
doc.replace_sectionwithheading, the editeddoc,expected_hash(the hash from step 1) and youractor.
A section is a top-level heading and the top-level nodes after it, up to the next heading of the same or a higher level; the footnotes block is never part of one, and headings inside callouts, details or tables do not start sections. Headings are matched exactly after trimming; level and occurrence (1-based) pick among identical headings.
Nothing is written when the heading is unknown or ambiguous, when the section changed since it was read (hash mismatch), when the new body holds a heading of the section's level or higher, or when the resulting page fails the Docmost schema check. After the write the gateway reads the page back and confirms that text and nodes outside the section are unchanged.
The whole body is still sent to Docmost: an edit made in the browser to another part of the same page in the same moment can be lost; the hash protects the section itself. A page's first json write adds default attributes (dir, empty mark attrs) once, with no visible change; later writes are byte-stable (measured on Docmost 0.96.0, DCMCP-US0077).
Design notes
stdio by default, with an optional HTTP mode (Streamable HTTP and legacy SSE) for shared hosting.
No Enterprise license, no Docmost database access, no Docmost fork.
Space slugs are accepted anywhere a space id is required.
move_pagecomputes the required fractionalpositionkey (first,last, or after a sibling).create_page/update_pagefail clearly on servers older than v0.71 instead of silently dropping the body.get_current_userreportsdocmostVersionfrom Docmost'scurrentVersionfield.delete_spacerequiresconfirm: true. Mutating tools honorDOCMOST_READ_ONLY.list_pagesdefaults to recently updated pages. Passview=treefor sidebar-root pages.search_attachmentsis Enterprise-only; Community hosts get a clear 403 message.Export tools write a zip or a single
.md/.htmlfile tooutput_pathor a temp file and return the path.
License
MIT. This package does not include Docmost AGPL or Enterprise source.
Available Tools
41 toolsadd_page_labelsA
Add one or more labels to a page. Names are normalized to lowercase kebab-case.
Inputs: names (required), page_id (required).
add_space_membersB
Add users and/or groups to a space with a role.
Inputs: role (required), space_id (required), user_ids, group_ids.
copy_page_to_spaceA
Copy a page and its accessible sub-pages into a different space.
Inputs: page_id (required), space_id (required).
create_commentA
Add a page-level comment. Inline selection comments are not supported.
Inputs: page_id (required), markdown (required), parent_comment_id.
create_pageA
Create a page in a space. Body is Markdown and is persisted in place (Docmost v0.71+). Can nest under a parent.
Inputs: title (required), space_id (required), icon, markdown, +1 more.
create_spaceA
Create a space. Slug is generated from the name if omitted. Requires permission to manage spaces.
Inputs: name (required), slug, description.
delete_commentADestructive
Delete a comment. Owners can delete their own; space admins can delete any comment.
Inputs: comment_id (required).
delete_pageADestructive
Move a page to trash, or permanently delete it. Permanent delete requires space admin.
Inputs: page_id (required), permanently.
delete_spaceADestructive
Delete a space and its pages. This cannot be undone.
Inputs: confirm (required), space_id (required).
duplicate_pageA
Duplicate a page and its accessible sub-pages within the same space.
Inputs: page_id (required).
export_pageARead-only
Export a page to a local file. A page without children is often a .md or .html file; include_children usually returns a zip. Writes to output_path or a temp file and returns the path plus content type.
Inputs: page_id (required), format, output_path, include_children, +1 more.
export_spaceARead-only
Export a whole space as a zip of Markdown or HTML. Writes to output_path or a temp file.
Inputs: space_id (required), format, output_path, include_attachments.
get_attachment_infoCRead-only
Get metadata for an uploaded attachment.
Inputs: attachment_id (required).
get_backlinksARead-only
List incoming or outgoing page links.
Inputs: page_id (required), direction (required), limit, cursor.
get_breadcrumbsARead-only
Get the ancestor path from space root to a page.
Inputs: page_id (required).
get_commentsARead-only
List page-level comments. Content is returned as Markdown. Each comment is re-fetched so edits are not stale.
Inputs: page_id (required), limit, cursor.
get_current_userARead-only
Get the authenticated user and workspace context, detected Docmost version, and whether this session is read-only.
Inputs: no named parameters.
get_history_versionARead-only
Get a specific page history version by history ID.
Inputs: history_id (required).
get_pageARead-only
Get a page's metadata and Markdown body. Use format=json for raw ProseMirror.
Inputs: page_id (required), format.
get_page_historyCRead-only
List revision history for a page.
Inputs: page_id (required), limit, cursor.
get_spaceARead-only
Get details for a space, including the current user's membership.
Inputs: space_id (required).
list_child_pagesARead-only
List direct child pages of a page, in sidebar order. Omit page_id and pass space_id for space-root pages.
Inputs: limit, cursor, page_id, space_id.
list_page_labelsARead-only
List labels on a page.
Inputs: page_id (required), limit, cursor.
list_pagesARead-only
List pages in a space. Default view=recent is recently updated pages (not the sidebar tree; General can look empty). Use view=tree for space-root pages in sidebar order, or list_child_pages for children of a page.
Inputs: space_id (required), view, limit, cursor.
list_space_membersARead-only
List members and groups in a space.
Inputs: space_id (required), limit, cursor.
list_spacesARead-only
List spaces the authenticated user can access.
Inputs: limit, cursor.
list_trashARead-only
List soft-deleted pages in a space.
Inputs: space_id (required), limit, cursor.
list_workspace_membersCRead-only
List workspace members.
Inputs: limit, query, cursor.
move_pageA
Move a page under a new parent or to the space root. Position is computed unless you pass an explicit 5-12 character key.
Inputs: page_id (required), root, position, after_page_id, +1 more.
move_page_to_spaceA
Move a page and its accessible sub-pages to a different space.
Inputs: page_id (required), space_id (required).
remove_page_labelA
Remove a label from a page by label ID.
Inputs: page_id (required), label_id (required).
remove_space_memberCDestructive
Remove a user or group from a space.
Inputs: space_id (required), user_id, group_id.
restore_pageA
Restore a soft-deleted page from trash.
Inputs: page_id (required).
search_attachmentsARead-only
Search file attachments by name or indexed text. This is an Enterprise feature; Community Edition returns 403. Prefer get_attachment_info when you already have an attachment id.
Inputs: query (required), limit, space_id.
search_pagesARead-only
Full-text search for pages the authenticated user can access. Optionally scope to a space.
Inputs: query (required), limit, offset, space_id.
search_suggestARead-only
Typeahead suggestions. Pages are included by default (set include_pages=false to skip). Users and groups default to off.
Inputs: query (required), limit, space_id, include_pages, +2 more.
update_commentA
Replace a comment body. You can update your own comments.
Inputs: markdown (required), comment_id (required).
update_pageA
Update a page title, icon, and/or Markdown body in place. Body writes use the server converter (v0.71+). operation defaults to replace.
Inputs: page_id (required), icon, title, markdown, +1 more.
update_spaceC
Update a space name, slug, or description.
Inputs: space_id (required), name, slug, description.
update_space_member_roleC
Change a space member or group's role.
Inputs: role (required), space_id (required), user_id, group_id.
upload_attachmentA
Upload a local file to a page. Returns attachment metadata including the /api/files/:id/:name URL path.
Inputs: page_id (required), file_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
Most tools target a distinct resource+action, and descriptions carefully disambiguate the tricky pairs (list_pages view=tree vs list_child_pages, move_page vs move_page_to_space, search_pages vs search_suggest vs search_attachments). A few tools overlap conceptually — the three move/copy variants and the various list_* tools — but descriptions give clear selection guidance.
All 41 tools follow a consistent verb_noun snake_case pattern (search_pages, create_page, update_space_member_role, add_page_labels). Resource-oriented variants like copy_page_to_space and move_page_to_space stay within the same convention and remain readable.
41 tools is heavy for a wiki/docs server, well above the typical comfortable range. The domain is genuinely broad (pages, spaces, members, comments, attachments, labels, history, trash), so most tools earn their place, but the surface could be consolidated (e.g. export_page/export_space, the move/copy family).
Coverage is strong: full page and space CRUD, trash/restore, history, backlinks/breadcrumbs, comments CRUD, labels add/list/remove, and attachment upload/info/search. Minor gaps remain, notably no attachment deletion or download/retrieval of file content, and inline comments are explicitly unsupported.
Maintenance
Related MCP Connectors
Unofficial Confluence MCP — wraps the Confluence Cloud REST API v2 (OAuth)
Shared project wiki for AI agents: read and write pages, next actions, and activity logs over MCP.
Hosted markdown project wikis your team's AI assistants read, search, and update over MCP.
Search and manage your team's knowledge from MCP clients.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with direct access to self-hosted Docmost documentation through tools for listing spaces, searching content, and retrieving pages in Markdown format. It facilitates seamless documentation lookup and content retrieval within MCP-compatible clients.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients to search, read, and manage Confluence Cloud pages, including publishing and updating documentation from Markdown, with support for folders and secure API token storage.3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides a bridge to self-hosted Docmost Community, enabling access to spaces, pages, and search, as well as creating and updating pages via Markdown. It also offers REST endpoints alongside MCP tools.AGPL 3.0
- AlicenseAqualityBmaintenanceEnables AI assistants to search, read, write, and organize content in self-hosted Docmost Community Edition wikis through MCP clients like Cursor and Claude.4132 npm4MIT