Purpose
docmost-local-mcp is an MCP (Model Context Protocol) server designed specifically for self-hosted Docmost instances, especially deployments that do not have an enterprise license but still want reliable MCP access from local IDEs and AI tools. It enables MCP clients such as Claude, Cursor, and VS Code to read and write wiki content in Docmost.
The project's main goal is to provide MCP access capability for self-hosted Docmost without requiring an enterprise license as a prerequisite.
Main capabilities
The server provides the following tools:
- list_spaces: List available Docmost spaces
- get_space: Get details of a specified space
- search_docs: Search documents, optionally limited to a certain space
- search_pages: Backward-compatible alias for search_docs
- get_page: Get a page and return its content as Markdown
- list_pages: List recent pages in a space
- list_child_pages: List child pages under a parent page ID
- get_comments: List comments on a page
- list_workspace_members: List workspace members
- get_current_user: Get the authenticated user and workspace context
- create_page: Create a new page in a space from Markdown content
- update_page: Update an existing page's title and/or Markdown content
- duplicate_page: Duplicate a page (and its child pages) within a space
- copy_page_to_space: Copy a page (and its child pages) to another space
- move_page: Move a page under a new parent page, or to the space root
- move_page_to_space: Move a page (and its child pages) to another space
- create_space: Create a new space with a name and URL slug
- update_space: Update a space's name, slug, and/or description
- create_comment: Add a page-level comment to a page from Markdown
- update_comment: Replace an existing comment body with new Markdown
All planned read and write tools have been implemented. create_comment adds page-level comments; inline comments anchored to a specific text selection require the collaborative editor's cursor position and are outside the scope of this REST-based server.
Usage
Runtime requirements:
- Node.js 18 or later (for npx)
- An accessible Docmost instance
- Email/password authentication enabled on that Docmost instance
You can run the server directly with npx, or provide the base URL via an environment variable.
MCP client configuration: Most MCP clients start the server directly with npx. Add the configuration to the client's MCP config, and replace the base URL with your own Docmost instance address.
Configuration locations for each client:
- Claude Desktop — claude_desktop_config.json (Settings → Developer → Edit Config)
- Cursor — ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project)
- Claude Code — one command, no file editing required: claude mcp add docmost -- npx -y @wisflux/docmost-local-mcp --base-url=https://docs.example.com
- VS Code (GitHub Copilot) — .vscode/mcp.json, using the top-level servers key instead of mcpServers: { "servers": { "docmost": { "command": "npx", "args": ["-y", "@wisflux/docmost-local-mcp", "--base-url=https://docs.example.com"] } } }
If --base-url or DOCMOST_BASE_URL is set, the login page pre-fills that URL and locks the field. If no base URL is configured, the login flow asks for it during interactive login.
Authentication flow:
- The MCP client starts the server via stdio.
- On the first call to a tool that requires authentication, the server starts a local HTTP login page on 127.0.0.1.
- The server opens a native authentication window when available, otherwise falls back to the system browser.
- You enter your email and password there. If --base-url or DOCMOST_BASE_URL is set, the Docmost URL is pre-filled and locked.
- The server logs in via /api/auth/login, extracts the authToken cookie, stores the session, and optionally stores the credentials for automatic re-login.
- Subsequent requests reuse the saved token until it is close to expiring or is rejected by Docmost.
Local state and credential storage: the server stores local state in a local directory, including config.json (the last base URL and email) and session.json (the saved authentication token and expiration time). Credentials are stored in the operating system keychain when available, which is the preferred path on supported platforms. If secure operating system credential storage is unavailable, the server falls back to encrypted local credential storage so that login reuse is still supported without writing plaintext credentials. This fallback is intentionally a secondary option to keychain storage.
The native authentication window uses each platform's system webview: WKWebView on macOS, WebView2 on Windows, and WebKitGTK on Linux.
Important notes:
- Windows requires the WebView2 runtime to be available
- Linux desktop environments require the WebKitGTK package to be installed
- When the binary is built without the native-webview feature, the browser fallback is always used
When to use
- Accessing self-hosted Docmost in Cursor, Claude Desktop, or other MCP clients
- Searching, summarizing, creating, updating, moving, and copying Docmost pages
- Generating structured Docmo from meeting notes or notesst page
- Add or update comments on a page
- Manage spaces and member information
Example prompts:
- "Search our on-call runbook in the Engineering space of Docmost and summarize it."
- "Create a new page titled 'Q3 Planning' in the Product space from these notes: ..."
- "Turn this meeting note into a structured Docmost page under the Team space."
- "Find and list all pages in Docmost that mention the old API endpoint."
- "Read the 'Onboarding' page, and draft a shorter checklist as a new subpage."
- "Add a comment on the release-notes page, flagging the missing migration steps."
Limitations
- Targets Docmost released in roughly the last year (v0.22+); older servers are best-effort. The server detects the Docmost version once per session via POST /api/version, and adapts where behavior differs.
- Page body editing: update_page can only change the body of an existing page on Docmost v0.70.0+. On older servers, the body lives in the collaborative editor and REST body updates are ignored—update_page states this explicitly and suggests using create_page (which persists the body via the import endpoint on all versions). Title updates work on all versions.
- Content support: page and comment bodies are written in Markdown (headings, bold/italic/strikethrough, inline code, links, lists, task lists, blockquotes, code blocks; pages also support tables and external URL images). Comments support a smaller set—no tables, task lists, or images.
- Mentions (@tagging): in any Markdown body, links with user: or page: URLs become mentions—Display Name tags a user (use list_workspace_members to find the UUID), Page Title links a page. Tagged users receive a Docmost notification.
- Attaching uploaded files/images (as opposed to referencing image URLs) is not supported.
- In create_page, when markdown is provided, the page body is sent via Docmost's import endpoint (POST /api/pages/import), which is the only mechanism to reliably persist page body content across Docmost versions (including older self-hosted servers). Pages created with a body land in the space root—parent_page_id is only valid for title-only pages.
- Inline comments (anchored to a specific text selection) are out of scope.
For more design details, Markdown→ProseMirror conversion details, verified Docmost API fields, and version notes, see docs/write-tools.md. For maintainer and contributor workflow details, see CONTRIBUTING.md.