Skip to main content
Glama

docmost-community-mcp

npm version npm downloads License: MIT Node docmost-community-mcp MCP server

Model Context Protocol (MCP) server for self-hosted Docmost Community / Open Source Edition. Lets Claude, Cursor or any MCP client search, read, write and organize your wiki.

Docmost's official MCP server and API keys are Enterprise-only. This server talks to the same internal HTTP API the Docmost web app uses, so it works on the free edition.

Source: github.com/dilruwanm/docmost-community-mcp

Quick start

You need Docmost v0.71+ (verified on v0.96.0), Node.js 20+, and a Docmost user for the AI to sign in as. A dedicated user is best: the AI can do anything that user can.

Claude Code:

claude mcp add docmost --env DOCMOST_URL=https://docs.example.com --env DOCMOST_EMAIL=you@example.com --env DOCMOST_PASSWORD=your-password -- npx -y docmost-community-mcp

Cursor, Claude Desktop and other clients: add this to the client's MCP config (for Cursor, .cursor/mcp.json or ~/.cursor/mcp.json):

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

Restart the client, then ask something like "list my Docmost spaces". To let the AI read but never change anything, add DOCMOST_READ_ONLY=true. All settings are under Environment.

Related MCP server: docmost-mcp-local

What you can ask it

  • "Find our onboarding checklist and summarize it."

  • "In the Release 2.4 page, set Alpha's State to Done in the Status table."

  • "Add a Risks section under Plan with these three points."

  • "Move every page under Drafts into the Archive space."

  • "Show the open comments on the Q3 roadmap and reply to the question about dates."

  • "Export the Engineering space as Markdown."

Compatibility

Docmost

Community / Open Source Edition, v0.71+ for page writes; verified on v0.96.0. Older servers can read, and writes fail with a clear error.

Node.js

20 or newer

MCP clients

Any client that runs stdio servers. Setups above for Claude Code, Claude Desktop and Cursor.

Transport

stdio

This server uses Docmost's internal HTTP API (the one its web app uses), not a documented public API. A Docmost upgrade can change it; if a tool breaks after an upgrade, please open an issue with your Docmost version.

Install from source

git clone https://github.com/dilruwanm/docmost-community-mcp.git
cd docmost-community-mcp
npm install
npm run build

Then point your client at the build instead of npx:

{
  "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"
      }
    }
  }
}

What you get

Official Enterprise MCP tool names, plus Community extras those docs omit.

Pages: search_pages, get_page, create_page, update_page, edit_page, 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

Page and comment bodies are Markdown. update_page goes through POST /api/pages/update with format: "markdown" so Docmost converts and applies the change in place. edit_page (below) edits the page's ProseMirror JSON instead, so untouched content is written back exactly as it was read. The server does not open a Yjs socket or invent its own TipTap schema.

Editing part of a page

update_page replaces, appends or prepends a whole body. To change one part, use edit_page: it reads the page, applies your edits in memory and writes once. Tables, callouts, inline comments and every block you did not touch are sent back unchanged. If any edit fails, nothing is written.

{
  "page_id": "aB3dE5fG7h",
  "expected_updated_at": "2026-11-21T12:00:00.000Z",
  "edits": [
    { "mode": "replace_text", "old_text": "v1.0", "new_text": "v1.1" },
    { "mode": "replace_section", "heading": "## Status", "markdown": "Shipped." },
    { "mode": "insert_in_section", "heading": "Install", "markdown": "Requires Node 20." }
  ]
}

Mode

What it does

replace_text

Replaces old_text with new_text. It must match exactly once, inside one paragraph, heading or list item, unless replace_all is set. Formatting around the match is kept.

replace_section

Keeps the heading and replaces everything under it, subsections included. Rename a heading with replace_text.

insert_in_section

Adds blocks to a section. at: "end" (default) is the end of the section's own body, before any subsection; at: "start" is right under the heading.

insert_after_section

Adds blocks after the section and all its subsections.

delete_section

Removes the heading, its body and its subsections.

update_row

Changes one table row. values sets cells by column header ({"State": "Done"}, case-insensitive); cells replaces every cell in order.

insert_row

Adds a row with cells, after the row matched by after_row, or at the end of the only table in scope.

delete_row

Removes the row matched by row.

How table rows work:

  • row and after_row match a row by the text of its first cell (exact, ignoring extra spaces). Header rows never match. No match, or more than one, is an error that lists the candidates. Pass heading to search one section only, for example when two tables share a row name.

  • Cell values are one line of text with bold, italic, code and links. The number of cells must equal the table's columns. Tables with merged cells, and tables inside callouts or columns, are refused.

{
  "page_id": "aB3dE5fG7h",
  "edits": [
    { "mode": "update_row", "row": "Alpha", "values": { "State": "Done" } },
    { "mode": "insert_row", "after_row": "Alpha", "cells": ["Gamma", "Gil", "Open"] },
    { "mode": "delete_row", "row": "Beta", "heading": "Status" }
  ]
}

How sections work:

  • heading is the heading's text (case-insensitive), or "## Text" to pin the level. A missing heading, or a name that matches more than one section, is an error that lists the candidates.

  • A section runs from its heading to the next heading of the same or higher level. Sections are flat: text sitting after a subsection's content belongs to that subsection. To add text to a parent section ahead of its subsections, use insert_in_section, not insert_after_section.

  • Only top-level headings count; headings inside callouts or tables do not.

  • New markdown supports headings, paragraphs, one-level bullet and numbered lists, fenced code, and bold, italic, code and links. Tables, blockquotes, callouts, images, nested or task lists and horizontal rules are refused with an error naming the construct. Use replace_text to change text inside existing rich content, and the row modes to change table rows.

  • expected_updated_at (optional) refuses the write if the page changed since that updatedAt. There is still a small window between the check and the write.

Reading less

get_page can return part of a page: outline: true lists the headings with offsets, heading returns one section as Markdown, and max_chars plus offset page through the body. Text longer than 40,000 characters is cut off with truncated: true and a next_offset; pass it back as offset to continue. get_history_version pages the same way. format=json bodies are not capped.

Smaller responses

To save AI context, list and write results are slim by default (for example list_pages items keep id, slugId, title, icon, parentPageId, hasChildren, updatedAt, with the shared space shown once), fields that are null are omitted, and JSON is compact. Pass verbose: true to get the full metadata. The CHANGELOG lists exactly which fields each tool drops.

DOCMOST_TOOLSETS limits which tools are exposed, which shrinks the tool list your client sends to the model on every request.

Environment

Variable

Required

Purpose

DOCMOST_URL

yes

Instance URL, e.g. https://docs.example.com

DOCMOST_EMAIL + DOCMOST_PASSWORD

one auth method

Community login

DOCMOST_AUTH_TOKEN

one auth method

authToken cookie from the browser

DOCMOST_SESSION_PATH

no

Session cache file

DOCMOST_READ_ONLY

no

true / 1 / yes — search and read only; mutating tools are refused

DOCMOST_TOOLSETS

no

Comma list of tool groups to expose: pages, spaces, comments, search, workspace, attachments, labels, members. Unset means all tools. An unknown name stops startup.

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.

Security

  • The AI acts as the Docmost user you configure, with all of that user's permissions. Use a dedicated user, and give it only the spaces and role it needs.

  • DOCMOST_READ_ONLY=true refuses every tool that changes content. DOCMOST_TOOLSETS hides whole tool groups.

  • The login session (a JWT) is cached in ~/.docmost-community-mcp/session.json, or DOCMOST_SESSION_PATH. Treat that file like a password.

  • Keep credentials in your client's MCP config or environment, never in a repository.

  • To report a vulnerability, see SECURITY.md. Please don't open a public issue for it.

Troubleshooting

Symptom

Fix

"This account requires MFA"

The login here can't complete MFA. Sign in to Docmost in a browser, copy the authToken cookie, and set DOCMOST_AUTH_TOKEN instead of email and password.

"Saved session is missing or expired"

With DOCMOST_AUTH_TOKEN, the token has expired: copy a fresh one. With email and password, the session is refreshed on its own; check the password is still right.

"This Docmost build is too old for in-place Markdown writes"

Upgrade Docmost to v0.71 or newer. Reading works on older versions.

search_attachments returns 403

Attachment search is a Docmost Enterprise feature.

Unrecognized key: "pageId"

The AI guessed an argument name. The error names the wrong key; the right one is in the tool's schema (here page_id). Most clients retry on their own.

A table gains an empty header row after an edit

Fixed in 1.2.0. Update to the latest version; the next save repairs an affected table.

The client can't start npx on Windows

Use "command": "cmd" with "args": ["/c", "npx", "-y", "docmost-community-mcp"].

Design notes

  • stdio only in this release. Streamable HTTP can be added later.

  • No Enterprise license, no Docmost database access, no Docmost fork.

  • Space slugs are accepted anywhere a space id is required.

  • Page slugIds (the id in page URLs) are accepted anywhere a page id is required, and are resolved to UUIDs before the request.

  • move_page computes the required fractional position key (first, last, or after a sibling).

  • create_page / update_page fail clearly on servers older than v0.71 instead of silently dropping the body. get_current_user reports docmostVersion from Docmost's currentVersion field.

  • delete_space requires confirm: true. Mutating tools honor DOCMOST_READ_ONLY.

  • list_pages defaults to recently updated pages. Pass view=tree for sidebar-root pages.

  • edit_page needs Docmost to accept format: "json" on /api/pages/update; this was verified on v0.96.0. It writes the whole page body back in one request, so a person typing in the editor at the same moment can still be overwritten (see expected_updated_at).

  • Docmost's Markdown export ignores a table's header row and writes a blank header line instead, so writing that Markdown back would demote the real header and add an empty row each time. get_page puts the first non-blank row back as the header and drops blank rows left by earlier round trips, so reading and writing a page keeps its tables, and the next save repairs a damaged one. GFM has no headerless tables, so a table stored without a header row gains one on write-back. export_page output is not affected.

  • Every tool rejects unknown argument names, and the error names them (for example pageId instead of page_id).

  • search_attachments is Enterprise-only; Community hosts get a clear 403 message.

  • Export tools write a zip or a single .md/.html file to output_path or a temp file and return the path.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md; for questions, use Discussions. Release notes are in the CHANGELOG.

License

MIT. This package does not include Docmost AGPL or Enterprise source.

Available Tools

42 tools
add_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_membersC

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), verbose.

create_commentA

Add a page-level comment. Inline selection comments are not supported.

Inputs: page_id (required), markdown (required), parent_comment_id.

create_pageB

Create a page in a space from Markdown, optionally under a parent.

Inputs: title (required), space_id (required), icon, verbose, +2 more.

create_spaceB

Create a space. Slug is generated from the name if omitted. Requires permission to manage spaces.

Inputs: name (required), slug, description.

delete_commentB
Destructive

Delete a comment. Owners can delete their own; space admins can delete any comment.

Inputs: comment_id (required).

delete_pageA
Destructive

Move a page to trash, or permanently delete it. Permanent delete requires space admin.

Inputs: page_id (required), permanently.

delete_spaceA
Destructive

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), verbose.

edit_pageA

Edit parts of a page, leaving the rest as is. edits run in order, written once; if any fails nothing is written. Modes: replace_text (old_text must match once in one paragraph, or use replace_all), replace_section (keeps the heading, replaces what is under it), insert_after_section (after its subsections), insert_in_section (at=start, or at=end, the default: end of its own body before any subsection), delete_section. heading is the text, or '## Text' to pin the level. Table rows (row/after_row match a row's first cell; heading optionally scopes): update_row (values by column header, or cells for every cell), insert_row (cells, after after_row or at the table's end), delete_row.

Inputs: edits (required), page_id (required), expected_updated_at.

export_pageB
Read-only

Export a page to output_path or a temp file and return the path. Without children usually .md/.html; include_children gives a zip.

Inputs: page_id (required), format, output_path, include_children, +1 more.

export_spaceB
Read-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_infoB
Read-only

Get metadata for an uploaded attachment.

Inputs: attachment_id (required).

get_breadcrumbsA
Read-only

Get the ancestor path from space root to a page.

Inputs: page_id (required), verbose.

get_commentsA
Read-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_userA
Read-only

Get the authenticated user and workspace context, detected Docmost version, and whether this session is read-only.

Inputs: verbose.

get_history_versionB
Read-only

Get a specific page history version by history ID.

Inputs: history_id (required), offset, max_chars.

get_pageA
Read-only

Get page metadata and Markdown body (format=json for ProseMirror). To read less: outline=true lists headings, heading returns one section, max_chars+offset page the body (follow next_offset).

Inputs: page_id (required), format, offset, heading, +2 more.

get_page_historyC
Read-only

List revision history for a page.

Inputs: page_id (required), limit, cursor.

get_spaceA
Read-only

Get details for a space, including the current user's membership.

Inputs: space_id (required).

list_child_pagesA
Read-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, verbose, +1 more.

list_page_labelsC
Read-only

List labels on a page.

Inputs: page_id (required), limit, cursor.

list_pagesA
Read-only

List pages in a space. view=recent (default) is recently updated pages, not the sidebar tree; view=tree is space-root pages in sidebar order. Use list_child_pages for children.

Inputs: space_id (required), view, limit, cursor, +1 more.

list_space_membersB
Read-only

List members and groups in a space.

Inputs: space_id (required), limit, cursor, verbose.

list_spacesB
Read-only

List spaces the authenticated user can access.

Inputs: limit, cursor.

list_trashB
Read-only

List soft-deleted pages in a space.

Inputs: space_id (required), limit, cursor, verbose.

list_workspace_membersC
Read-only

List workspace members.

Inputs: limit, query, cursor, verbose.

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_labelB

Remove a label from a page by label ID.

Inputs: page_id (required), label_id (required).

remove_space_memberC
Destructive

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), verbose.

search_attachmentsA
Read-only

Search attachments by name or text. Enterprise only: Community gets 403. Prefer get_attachment_info when you have an id.

Inputs: query (required), limit, space_id.

search_pagesA
Read-only

Full-text search for pages the authenticated user can access. Optionally scope to a space.

Inputs: query (required), limit, offset, verbose, +1 more.

search_suggestC
Read-only

Typeahead suggestions. Pages are included by default (set include_pages=false to skip). Users and groups default to off.

Inputs: query (required), limit, verbose, space_id, +3 more.

update_commentB

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 (operation: replace default, append, prepend). For partial edits use edit_page.

Inputs: page_id (required), icon, title, verbose, +2 more.

update_spaceC

Update a space name, slug, or description.

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

update_space_member_roleB

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

    B3.1/5.0

    Scored across 42 tools

    Disambiguation4/5

    Most tools target a distinct resource+action, and close pairs like update_page vs edit_page, move_page vs move_page_to_space, and duplicate_page vs copy_page_to_space are explicitly clarified in their descriptions. A few boundaries (get_page_history vs get_history_version, search_pages vs search_suggest vs list_pages) still require reading descriptions carefully, but no true duplicates exist.

    Naming Consistency4/5

    Nearly all tools follow a verb_noun snake_case pattern (create_page, list_spaces, delete_comment, export_space). Minor deviations exist in pluralization, e.g. create_comment vs get_comments, add_page_labels vs remove_page_label, which slightly weakens predictability.

    Tool Count2/5

    42 tools is well beyond a comfortable surface for an agent, even for a full wiki platform. Many low-frequency operations (move_page_to_space, copy_page_to_space, search_suggest, get_history_version) inflate the set and increase selection cost.

    Completeness4/5

    Pages have full CRUD plus history, trash/restore, labels, comments, attachments, links, breadcrumbs, and export; spaces have CRUD plus member management. Gaps remain around attachment deletion/updating and inline/selection comments (explicitly unsupported), but core workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers