Skip to main content
Glama

docmost-community-mcp

面向自托管 Docmost Community / Open Source Edition 的 Model Context Protocol 服务器。

来源:github.com/dilruwanm/docmost-community-mcp

Docmost 官方的 MCP 和 API 密钥仅限 Enterprise 版使用。此服务器与 Docmost Web 应用使用的是同一个内部 HTTP API,因此你可以从 Cursor、Claude 或任何 MCP 客户端搜索、阅读、编写和管理 CE 维基。

Markdown 正文写入需要 Docmost v0.71+。最新验证过的目标版本为 v0.95.0。

安装

npx -y docmost-community-mcp

从源码安装:

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

Related MCP server: docmost-mcp-local

功能一览

包含官方 Enterprise MCP 工具名称,以及官方文档未提及的 Community 版额外工具。

页面: search_pages, get_page, create_page, update_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

空间: list_spaces, get_space, create_space, update_space, delete_space, export_space

评论: get_comments, create_comment, update_comment, delete_comment

搜索 / 成员: search_attachments, search_suggest, list_workspace_members, get_current_user

文件 / 标签 / 权限: 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

页面和评论正文均为 Markdown。更新通过 POST /api/pages/update 并携带 format: "markdown" 完成,Docmost 会自行转换并就地应用更改。此服务器不会打开 Yjs socket,也不会自行发明 TipTap schema。

环境变量

变量

是否必需

用途

DOCMOST_URL

是

实例 URL,例如 https://docs.example.com

DOCMOST_EMAIL + DOCMOST_PASSWORD

任选一种认证方式

Community 版登录

DOCMOST_AUTH_TOKEN

任选一种认证方式

来自浏览器的 authToken cookie

DOCMOST_SESSION_PATH

否

会话缓存文件

DOCMOST_READ_ONLY

否

true / 1 / yes — 仅可搜索和读取;修改类工具将被拒绝

建议使用邮箱/密码。JWT 会缓存到 ~/.docmost-community-mcp/session.json,并在收到 401 时刷新。MFA 账户无法在此完成登录 — 请改用 DOCMOST_AUTH_TOKEN。

请使用专用的 Docmost 用户。切勿将凭据提交到版本库。

Cursor

添加到 .cursor/mcp.json 或 ~/.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"
      }
    }
  }
}

从本地克隆运行:

{
  "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 Desktop / Claude Code

使用与上面相同的 mcpServers 配置块。Claude Code:

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

设计说明

  • 本版本仅支持 stdio。Streamable HTTP 可稍后添加。

  • 无 Enterprise 许可证,不访问 Docmost 数据库,不是 Docmost 的复刻。

  • 任何需要 space id 的位置都接受 space slug。

  • move_page 会计算所需的分数 position 键(first、last 或某个同级页面之后)。

  • 在低于 v0.71 的服务器上,create_page / update_page 会明确报错,而不会静默丢弃正文。get_current_user 会从 Docmost 的 currentVersion 字段报告 docmostVersion。

  • delete_space 需要 confirm: true。修改类工具会遵循 DOCMOST_READ_ONLY。

  • list_pages 默认返回最近更新的页面。传入 view=tree 可获取侧边栏根级页面。

  • search_attachments 仅限 Enterprise 版;Community 版自托管实例会收到明确的 403 提示。

  • 导出工具会将 zip 或单个 .md/.html 文件写入 output_path 或临时文件,并返回文件路径。

许可证

MIT。本包不包含 Docmost AGPL 或 Enterprise 源代码。

Available Tools

41 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_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_commentA
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).

export_pageA
Read-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_spaceA
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_infoC
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).

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: no named parameters.

get_history_versionA
Read-only

Get a specific page history version by history ID.

Inputs: history_id (required).

get_pageA
Read-only

Get a page's metadata and Markdown body. Use format=json for raw ProseMirror.

Inputs: page_id (required), format.

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, space_id.

list_page_labelsA
Read-only

List labels on a page.

Inputs: page_id (required), limit, cursor.

list_pagesA
Read-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_membersA
Read-only

List members and groups in a space.

Inputs: space_id (required), limit, cursor.

list_spacesA
Read-only

List spaces the authenticated user can access.

Inputs: limit, cursor.

list_trashA
Read-only

List soft-deleted pages in a space.

Inputs: space_id (required), limit, cursor.

list_workspace_membersC
Read-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_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).

search_attachmentsA
Read-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_pagesA
Read-only

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

Inputs: query (required), limit, offset, space_id.

search_suggestA
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, 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

    A3.5/5.0

    Scored across 41 tools

    Disambiguation4/5

    Most tools target distinct resource-action pairs, and near-pairs like move_page vs move_page_to_space and duplicate_page vs copy_page_to_space are clearly separated by destination scope. The main ambiguity is list_pages vs list_child_pages, since both can return space-root pages depending on options.

    Naming Consistency5/5

    The API uses a consistent snake_case verb_noun pattern throughout: create_page, update_page, delete_page, list_spaces, get_comments, add_space_members, etc. Prepositional variants like move_page_to_space and copy_page_to_space follow the same readable convention.

    Tool Count2/5

    Forty-one tools is beyond the 16-25 'heavy' range and feels over-split for an MCP surface. Some tools such as search_attachments are non-functional in the Community Edition, and the many page-move/copy/list variants make the surface larger than its core workflows require.

    Completeness4/5

    The surface covers the core wiki lifecycle well: pages, spaces, comments, attachments, labels, members, search, export, trash, and history read operations. Workable gaps remain: there is no restore-from-version operation, no attachment delete/download, and no workspace-level user/group management.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers