Skip to main content
Glama

Docmost MCP server

npm version npm downloads tests license: MIT punyamsingh/docmost-mcp MCP server Listed on mcpservers.org

An MCP server for self-hosted Docmost. Read, search, create and edit wiki pages in Markdown from Claude Code, Claude Desktop, Cursor, VS Code or any other MCP client. Works with the free Community Edition: no Enterprise licence and no API key, just a normal Docmost login.

claude mcp add docmost --scope user \
  -e DOCMOST_URL=https://docs.example.com \
  -e DOCMOST_EMAIL=you@example.com \
  -e DOCMOST_PASSWORD='your-password' \
  -- npx -y @punyamsingh/docmost-mcp

That is all Claude Code needs; config for Claude Desktop, Cursor and VS Code is under Setup.

Docmost's official MCP server and API keys are part of its paid Enterprise edition. This server needs neither. It logs in with a normal Docmost account and calls the same API the Docmost web app uses. Since Docmost v0.70 that API accepts and returns Markdown, and the server converts it to and from its editor format.

  • Markdown in and out: pages come back as Markdown and are written from Markdown.

  • Safe edits: an optional stale-write check stops a replace from overwriting someone else's newer change, and rewrites that would delete comments, mentions or diagrams are refused.

  • Live collaboration: text edits are made in the live document, the way Docmost's own editor makes them, so they merge with whatever people with the page open are typing.

  • Any page reference: a page id, slug id or the URL copied from the browser.

Tools

Tool

What it does

get_workspace

Returns the workspace with its member count, the account the server is signed in as with its email and role, and the spaces it can see with their ids

list_members

Lists the workspace's members with names, emails and roles, optionally filtered by name or email

create_space

Creates a space with a name and slug; needs a workspace admin

update_space

Renames a space or changes its slug or description; needs space admin rights

list_pages

Lists the root pages of a space, or the children of a page, with each page's updatedAt on Docmost 0.97 and newer

find_pages

Finds pages by full-text query, by label (Docmost 0.90 and newer) or in a space's trash with inTrash; with none of those, lists recently updated pages; optionally within one space, paged by cursor

get_page

Returns a page as Markdown, 500 lines at a time by default, with its id, space, parent, URL, updatedAt, the path of pages above it and, on Docmost 0.90 and newer, its labels; or one heading's section; or, with outline, only its headings and their line numbers; with historyId, reads a saved revision instead

list_page_history

Lists a page's saved revisions, newest first, with author, contributors and time

list_page_links

Lists the pages linking to a page, or the pages it links to, on Docmost 0.90 and newer

create_page

Creates a page from Markdown, at a space root or under a parent page

update_page

Replaces, appends to or prepends to a page body, or with heading only that heading's section, which can also be deleted; can rename the page or change its icon; in a call of their own, adds and removes labels by name

replace_page_text

Replaces an exact piece of text in a page, in place when it is plain text, leaving the rest of the page as it is

move_page

Moves a page and its subpages under another page or to a space root, including into another space; with copy, copies them there without comments, or next to the original when no destination is given

delete_page

Moves a page and its subpages to the space's trash; never deletes permanently

restore_page

Restores a page and its subpages from the trash, or with historyId puts a saved revision back as the page's body and title, diagrams, mentions and formatting included

list_comments

Lists a page's open comment threads with their replies, or every thread with includeResolved

create_comment

Posts a page comment, an inline comment attached to a quote copied from get_page, or with parentCommentId a reply in that comment's thread

update_comment

Replaces the text of one of the account's own comments, or resolves or reopens a thread with resolved; before Docmost 0.98 resolving needs an Enterprise licence

delete_comment

Permanently deletes a comment and removes its highlight; a whole thread needs deleteReplies

upload_attachment

Uploads a local image or file (up to 50 MB) to a page and returns a Markdown image or link to place with replace_page_text or update_page

list_attachments

Lists the files and images uploaded to a page, newest first, on Docmost 0.96 and newer

delete_attachment

Permanently deletes a file from a page; needs space admin rights and Docmost 0.97 or newer

import_pages

Creates pages from a .md or .html file, a .zip, or a folder, at the space root or under a parent page

export_pages

Saves a page as a Markdown or HTML file, or as a .zip with its subpages or attachments, or a whole space as a .zip, which needs space admin rights, and returns the path and size

Every tool that takes a page accepts a page id, a slug id, or the page URL copied from the browser.

get_workspace returns at most 1000 spaces and list_pages at most 1000 pages; a longer list comes with a note saying it was cut short.

Pass the updatedAt from get_page as expectedUpdatedAt to update_page, and the change is refused if someone changed the page in the meantime. replace_page_text reads the current body itself, so it applies on top of other people's changes as long as the text still matches exactly once.

When oldText and newText are plain text and each match sits inside one paragraph, heading or code block, replace_page_text changes just that text in the page's live document, over Docmost's collaboration websocket, the same connection Docmost's editor uses. The change merges with what anyone with the page open is typing, and comments, mentions, colours and everything else on the page are kept. The new text takes the formatting of the text it replaces, as typing over a selection does in the editor. Docmost saves the change within 45 seconds, so the result's updatedAt is null; editedInPlace and liveMerge say which way the edit went. If the websocket can't be reached within 10 seconds, the edit is written to the saved page instead and liveMergeSkipped says why.

Otherwise, for example when the new text has Markdown formatting or the match crosses a line break or a mention, the edit rewrites the whole body from Markdown, as an update_page replace does. Content that Markdown cannot carry would be deleted, so the server refuses such a rewrite on any page that holds it: mentions, comments, highlights, coloured or underlined text, drawio and excalidraw diagrams, embeds, attachments, merged table cells, and any block type it does not recognise. Append and prepend only add blocks, so they still work on those pages.

A whole-body rewrite can't be merged, so it is refused while someone with the page open has typing that Docmost hasn't saved yet; retry a minute later. Append and prepend are merged by Docmost, so they always go through.

restore_page with a historyId undoes changes by putting a revision from list_page_history back, the way Docmost's own Restore button does. It sends the revision in Docmost's editor format rather than Markdown, so nothing is lost, and takes expectedUpdatedAt like a replace. Like a rewrite, it is refused while someone has unsaved typing open, and on a page in the trash. Comments added since the revision keep their thread but lose their highlight in the text; the result's commentHighlightsRemoved says how many.

Exports and imports

Paths are on the machine running the server, which over HTTP is not the client's machine. An export given an existing folder saves under Docmost's file name, and refuses to replace a file unless overwrite: true. import_pages uses Docmost's own importer, which turns relative links into page links and uploads the images they point to; a folder is zipped first, and each subfolder becomes a page holding its files' pages. A single file must be under 30 MB, and .docx and .pdf need Docmost Enterprise. The server waits up to 2 minutes for a .zip or folder import, or DOCMOST_IMPORT_WAIT_SECONDS, then returns the import's task id if it is still running. With parentPageId the new pages are moved under that page; if the move fails they stay at the space root and the result says moved: false and why.

Sections

update_page with a heading finds that heading by its text, ignoring case and any leading #, and works on everything below it down to the next heading of the same or a higher level, subsections included. replace keeps the heading and swaps what is under it, prepend adds content right under the heading, append adds it after the last subsection, and delete removes the heading too. A heading that appears twice is refused, as the section would be ambiguous.

The change is made in the page's live document, like replace_page_text, so it merges with what people with the page open are typing, and diagrams, mentions and comments outside the section are kept. When the websocket can't be reached, the saved page's editor content is changed instead. The new content is Markdown with headings, paragraphs, bullet, numbered and task lists, code blocks, quotes, horizontal rules, bold, italic, strikethrough, inline code and links; tables, images, callouts and HTML are refused, so use replace_page_text, or update_page without heading, for those. Comments whose highlighted text is replaced or deleted keep their thread but lose the highlight, and the result's commentHighlightsRemoved says how many.

Comments

Comment text is plain text: blank lines start new paragraphs, and @[Full Name] mentions the one member with that name, which notifies them. A name that matches no member, or several, refuses the call before anything is posted.

An inline comment's quote must appear exactly once inside one paragraph or heading, without crossing a mention or sitting in a code block or on text that already has a comment. The server finds it in the page's live document and sends its position with the comment, and Docmost adds the highlight, as it does in its own editor. The server then waits up to 5 seconds for the highlight; if it doesn't appear, the comment still exists and the result says anchored: false.

Docmost threads are one level deep, so a reply to a reply is posted in the same thread, and only a thread's top comment can be resolved. Docmost 0.98 and newer let any member resolve threads; older releases keep it for Enterprise licences, and without one the call is refused and nothing changes. Docmost 0.95 leaves an inline thread's highlight looking open after a resolve, so the server updates it through the live document; highlightUpdated says whether it could. Deletes are permanent and take a comment's replies with them, so deleting a thread's top comment needs deleteReplies: true. Docmost's API leaves a deleted comment's highlight on the page, so the server removes it through the live document; if it can't, for an account that can only comment, the result says highlightRemoved: false.

Related MCP server: Docmost Community Bridge

Requirements

  • Node.js 22.18 or newer

  • Docmost v0.70 or newer

  • A Docmost account. Edits are attributed to this account in page history, so each person should use their own. An account with MFA signs in with a session token instead of a password, as described below.

Setup

There is nothing to clone. Register the server with your MCP client and pass your Docmost login as environment variables. npx downloads and runs it.

Claude Code: all projects

claude mcp add docmost --scope user \
  -e DOCMOST_URL=https://docs.example.com \
  -e DOCMOST_EMAIL=you@example.com \
  -e DOCMOST_PASSWORD='your-password' \
  -- npx -y @punyamsingh/docmost-mcp

Claude Desktop, Cursor and other clients

Add the following to the client's MCP config (claude_desktop_config.json, ~/.cursor/mcp.json, …):

{
  "mcpServers": {
    "docmost": {
      "command": "npx",
      "args": ["-y", "@punyamsingh/docmost-mcp"],
      "env": {
        "DOCMOST_URL": "https://docs.example.com",
        "DOCMOST_EMAIL": "you@example.com",
        "DOCMOST_PASSWORD": "your-password"
      }
    }
  }
}

VS Code

Add the following to .vscode/mcp.json in a workspace, or to your user MCP config:

{
  "servers": {
    "docmost": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@punyamsingh/docmost-mcp"],
      "env": {
        "DOCMOST_URL": "https://docs.example.com",
        "DOCMOST_EMAIL": "you@example.com",
        "DOCMOST_PASSWORD": "your-password"
      }
    }
  }
}

To run the latest code on GitHub instead of the npm release, replace @punyamsingh/docmost-mcp with github:punyamsingh/docmost-mcp. The first start is slower because it builds from source.

The client stores these values in its own config file in plain text, the same as a .env file would, so use a config file only you can read.

After the first login the session token is cached in ~/.cache/docmost-mcp/ (or $XDG_CACHE_HOME/docmost-mcp/), with file mode 600. Restarting the client therefore does not open a new Docmost session each time. A new login happens automatically when the token expires or is revoked.

Accounts with MFA

The server can't complete a second factor, so an account with MFA signs in with a browser session instead. Sign in to Docmost in a browser, copy the value of its authToken cookie (in the browser's developer tools, under the site's cookies), and set DOCMOST_AUTH_TOKEN to it in place of DOCMOST_EMAIL and DOCMOST_PASSWORD; when an email and password are set too, they are used and the token is ignored. Treat the token like a password. It stops working when the session expires or you sign out, and the server then asks for a fresh one rather than logging in again.

From a clone

git clone https://github.com/punyamsingh/docmost-mcp.git
cd docmost-mcp
npm install          # also builds into build/
cp .env.example .env # then fill in DOCMOST_URL, DOCMOST_EMAIL, DOCMOST_PASSWORD
claude mcp add docmost --scope user -- node "$PWD/build/index.js"

.env is git-ignored. Variables set in the client's config take precedence over it.

The server reaches Docmost's collaboration websocket at DOCMOST_URL + /collab. If your Docmost serves it elsewhere (its COLLAB_URL setting), set DOCMOST_COLLAB_URL to that address.

npm test builds the server and runs the test suite against a fake Docmost, so it needs no Docmost instance.

Over HTTP

The server speaks stdio by default. To serve Streamable HTTP instead, start it with --http or set DOCMOST_MCP_PORT:

DOCMOST_URL=https://docs.example.com DOCMOST_EMAIL=you@example.com DOCMOST_PASSWORD='your-password' \
  npx -y @punyamsingh/docmost-mcp --http --port 3000

Clients connect to http://127.0.0.1:3000/mcp, for example claude mcp add --transport http docmost http://127.0.0.1:3000/mcp.

Flag

Environment variable

Default

--port

DOCMOST_MCP_PORT

3000

--host

DOCMOST_MCP_HOST

127.0.0.1

DOCMOST_MCP_TOKEN

none

The server still logs in to Docmost with its own DOCMOST_* variables, so every client that reaches it acts as that one account. When DOCMOST_MCP_TOKEN is set, each request must send Authorization: Bearer <token>. The server refuses to bind to anything but a loopback address without a token, and serves plain HTTP, so put it behind a TLS proxy before exposing it to a network.

Read-only mode

Set DOCMOST_READ_ONLY=true to offer only the tools that leave Docmost unchanged: reading, searching, listing and exporting. The tools that write are not listed at all, so the model never sees them.

Limitations

  • No tools for permissions.

  • Mentions are looked up through Docmost's people search, 100 people at a time; when 100 or more people match a name, uniqueness can't be confirmed and the mention is refused.

  • delete_comment checks a thread for replies just before deleting it. A reply posted in the moment between that check and the delete is deleted with the thread, because Docmost's delete can't be made conditional.

  • The HTTP transport is stateless: it keeps no MCP sessions, so it sends no server-initiated notifications and serves no GET stream.

  • A find_pages search offers a nextCursor only when a full page of results came back. Docmost drops pages the account can't open after counting, so a short page can still have more results after it.

  • Docmost returns revisions only as editor JSON, so get_page converts them to Markdown itself when reading one; content Markdown can't hold, such as diagrams or embeds, comes back as a link or is left out.

  • Accounts with MFA need DOCMOST_AUTH_TOKEN, which has to be copied again from a browser whenever the session expires.

  • When the collaboration websocket can't be reached, replace_page_text falls back to writing the saved page. Docmost saves what people type 10 to 45 seconds after they type it, so in that case text typed in that window by someone with the page open can be lost.

  • Docmost's import task doesn't record the pages it created, so import_pages takes the space's new root pages as the import's. A root page someone else creates in that space during the import is reported, and moved under parentPageId, with it.

  • Before a whole-body rewrite the server compares the live text with the saved text, not formatting, so bold or colour added in the last 45 seconds without typing can still be lost by a rewrite.

License

MIT

Available Tools

24 tools
create_commentCreate a Docmost commentA

Posts a comment on a page, attached to a quoted piece of text when quote is given, or a reply in a comment's thread when parentCommentId is given, and notifies the people it mentions.

Inputs: text (required), pageId (required), quote, parentCommentId.

create_pageCreate a Docmost pageA

Creates a page from Markdown at the root of a space or under a parent page, and returns its id and URL; titles need not be unique, so an existing page with the same title is left alone.

Inputs: title (required), markdown (required), icon, spaceId, +1 more.

create_spaceCreate a Docmost spaceA

Creates a space, which needs a workspace admin, with this account as its admin, and returns the space id the other tools take.

Inputs: name (required), slug (required), description.

delete_attachmentDelete a Docmost attachmentA
Destructive

Permanently deletes a file or image uploaded to a page, which needs space admin rights, leaving a broken image or link wherever the page still shows it.

Inputs: attachmentId (required).

delete_commentDelete a Docmost commentA
Destructive

Permanently deletes a comment and removes its highlight from the page, deleting a whole thread only when deleteReplies is set.

Inputs: commentId (required), deleteReplies.

delete_pageDelete a Docmost pageA
DestructiveIdempotent

Moves a page and its subpages to the space's trash, from which they can be restored, and never deletes anything permanently.

Inputs: pageId (required).

export_pagesExport Docmost pages to a fileA

Saves a page as a Markdown or HTML file, or as a .zip when it includes subpages or attachments, or every page of a space as a .zip, which needs space admin rights, to a path on the machine running this server and returns the path and size.

Inputs: format (required), outputPath (required), pageId, spaceId, +3 more.

find_pagesFind Docmost pagesA
Read-only

Finds pages by full-text search, by label or in a space's trash, or with none of those lists the most recently updated pages, optionally within one space.

Inputs: label, limit, query, cursor, +2 more.

get_pageRead a Docmost pageA
Read-only

Returns a window of a page, or of one saved revision of it, as Markdown along with its id, URL, labels, path from the space root and line counts, or just one heading's section, or only the headings with their line numbers.

Inputs: pageId (required), limit, offset, outline, +2 more.

get_workspaceGet the Docmost workspaceA
Read-only

Returns the workspace with its member count, the account this server is signed in as with its email and role, and the spaces that account can see with the space ids the other tools take.

Inputs: no named parameters.

import_pagesImport files as Docmost pagesA

Creates pages from a .md or .html file, a .zip, or a folder of them on the machine running this server through Docmost's importer, which nests pages by folder, links pages and uploads images, at the space root or under parentPageId.

Inputs: path (required), spaceId, parentPageId.

list_attachmentsList Docmost page attachmentsA
Read-only

Lists the files and images uploaded to a page, newest first, with each file's id, name, type, size, uploader and URL.

Inputs: pageId (required), limit, cursor.

list_commentsList Docmost commentsA
Read-only

Lists the comment threads on a page with their replies, authors, text and the quoted text each one is attached to.

Inputs: pageId (required), includeResolved.

list_membersList Docmost workspace membersA
Read-only

Lists the workspace's active members with their names, emails and roles, sorted by name and paged by cursor, for finding the exact name an @[Full Name] mention in a comment needs.

Inputs: limit, query, cursor.

list_page_historyList Docmost page historyA
Read-only

Lists a page's saved revisions, newest first and paged by cursor, with each revision's id, title, author, contributors and time; pass an id to get_page to read that revision or to restore_page to put it back.

Inputs: pageId (required), limit, cursor.

list_pagesList Docmost pagesA
Read-only

Browses the page tree, listing the top-level pages of a space or the direct children of a page in sidebar order, all at once up to 1000, with whether each has children; to search, filter by label or see recent pages, use find_pages.

Inputs: spaceId, parentPageId.

move_pageMove or copy a Docmost pageA

Moves a page and its subpages under another page or to the root of a space, including into another space, placing it last among its new siblings, or with copy copies them there without their comments.

Inputs: pageId (required), copy, spaceId, parentPageId.

replace_page_textReplace text in a Docmost pageA
Destructive

Replaces an exact piece of text in a page, changing plain text in the live document so it merges with anyone editing and keeps comments, mentions and formatting, with Docmost saving it within 45 seconds, and rewriting the whole body from Markdown only when the change needs Markdown.

Inputs: pageId (required), newText (required), oldText (required), replaceAll.

restore_pageRestore a Docmost pageA
Destructive

Restores a page and its subpages from the trash to where they were, or to the space root when the old parent is still in the trash, or with historyId puts that saved revision back as the page's body and title, keeping diagrams, mentions and formatting.

Inputs: pageId (required), historyId, expectedUpdatedAt.

update_commentUpdate a Docmost commentA
DestructiveIdempotent

Replaces the text of one of this account's own comments, or resolves or reopens a thread by its top comment's id, which Docmost before 0.98 allows only with an Enterprise licence.

Inputs: commentId (required), text, resolved.

update_pageUpdate a Docmost pageA
Destructive

Writes Markdown to a page, replacing, appending to or prepending to the whole body or, with heading, only the part under that heading, which can also be deleted, and can rename the page, change its icon, or in a call of their own add and remove labels; a whole-body replace is refused on pages holding content Markdown cannot carry, such as mentions or comments.

Inputs: pageId (required), icon, title, heading, +5 more.

update_spaceUpdate a Docmost spaceA
DestructiveIdempotent

Renames a space or changes its slug or description, which needs space admin rights; a new slug changes the space's URL.

Inputs: spaceId (required), name, slug, description.

upload_attachmentUpload a file to a Docmost pageA

Uploads a local image or file of up to 50 MB to a page and returns its URL and a Markdown image or link to place in the page with replace_page_text or update_page.

Inputs: pageId (required), filePath (required), altText.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 24 tools

    Disambiguation4/5

    Tools target distinct resources and actions, and descriptions clearly separate list_pages (tree browsing) from find_pages (search/filter/recent/trash). The main overlap is update_page versus replace_page_text, but their guidance on Markdown rewrites versus exact live-text edits is clear enough for selection.

    Naming Consistency5/5

    Names consistently use snake_case verb_noun phrasing such as get_workspace, list_pages, create_comment, and delete_attachment. Qualifiers like list_page_history and replace_page_text follow the same convention without mixing camelCase or vague verbs.

    Tool Count4/5

    At 24 tools this is on the heavy side, but each maps to a distinct operation across workspace, spaces, pages, comments, and attachments. The surface is broad but not obviously redundant for a full-featured wiki integration.

    Completeness4/5

    Page operations are especially complete, covering create/read/update/replace/move/restore/delete/history/links/import/export, while comments and attachments have create/list/update/delete coverage. Minor gaps remain around space deletion and member administration, but core wiki workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers