Skip to main content

A Model Context Protocol (MCP) server for Docmost — the open-source collaborative wiki.

Project description

📚 Docmost MCP Server

A Model Context Protocol (MCP) server that connects any LLM client to your Docmost wiki. Search, read, create, update, and delete documentation pages — all through natural language.

Python 3.10+ License: MIT PyPI


✨ Features

Tool Description
search_docmost Full-text search across all pages
get_page Read page content (Markdown / HTML / JSON)
create_page Create a new page with optional content
update_page Update title/content (replace, append, prepend)
delete_page Soft-delete or permanently remove a page
list_spaces List all accessible spaces
get_space_info Get space details and permissions
list_space_pages Browse the page hierarchy in a space
import_page Import Markdown as a new page

🚀 Quick Start

1. Install

pip install docmost-mcp

2. Configure

Create a .env file (or set environment variables):

Community Edition (email/password login):

DOCMOST_BASE_URL=https://docmost.example.com
DOCMOST_EMAIL=your@email.com
DOCMOST_PASSWORD=your-password

Enterprise / Business Edition (API token):

DOCMOST_BASE_URL=https://docmost.example.com
DOCMOST_API_TOKEN=dk_live_xxxxxxxxxxxxx

3. Run

docmost-mcp

Or as a Python module:

python -m docmost_mcp

🔌 Integration with MCP Clients

Claude Desktop / Cursor / Windsurf

Add this to your MCP client configuration:

{
  "mcpServers": {
    "docmost": {
      "command": "docmost-mcp",
      "env": {
        "DOCMOST_BASE_URL": "https://docmost.example.com",
        "DOCMOST_API_TOKEN": "your-api-token"
      }
    }
  }
}

Tip: If you installed with pip, use the full path to the docmost-mcp executable. Find it with: which docmost-mcp (macOS/Linux) or where docmost-mcp (Windows).


🏗️ Architecture

src/docmost_mcp/
├── __init__.py         # Package metadata and version
├── __main__.py         # CLI entry point
├── config.py           # Environment validation (Pydantic BaseSettings)
├── exceptions.py       # Custom exception hierarchy
├── client.py           # Async Docmost API client (httpx)
└── server.py           # MCP tool definitions (FastMCP)

Design Principles

  1. Fail Fast — Configuration is validated at startup. Missing env vars crash immediately with a clear error, not mid-request.
  2. One Client, Many Tools — A single DocmostClient with connection pooling handles all API calls. No per-request client creation.
  3. Typed Exceptions — Every failure mode has its own exception class (DocmostAuthError, DocmostNotFoundError, etc.) for precise error messages.
  4. LLM-Friendly Errors — MCP tools catch exceptions and return descriptive strings, never raw tracebacks.
  5. Dual Auth — Supports both API token (Enterprise) and email/password login (Community) with automatic session refresh.

🔐 Authentication

Community Edition

Uses POST /api/auth/login to obtain a session cookie. The server automatically re-authenticates on 401 (session expired).

Required env vars: DOCMOST_BASE_URL, DOCMOST_EMAIL, DOCMOST_PASSWORD

Enterprise / Business Edition

Uses Authorization: Bearer <token> header. Generate an API token from your Docmost admin panel.

Required env vars: DOCMOST_BASE_URL, DOCMOST_API_TOKEN

If both are configured, the API token takes precedence (no login round-trip needed).


🛠️ Development

# Clone the repo
git clone https://github.com/Dev789/docmost-mcp-server.git
cd docmost-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows

# Install in editable mode
pip install -e .

# Run
docmost-mcp

📄 License

MIT — free to use, modify, and distribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docmost_mcp-1.0.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docmost_mcp-1.0.1-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file docmost_mcp-1.0.1.tar.gz.

File metadata

  • Download URL: docmost_mcp-1.0.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for docmost_mcp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f12d0c2e941f4c44d99ed041e94ce89a1a737d0154ab2f62080e6fc3dd7f1b27
MD5 2325829453288f8a5ba01b1b9dff406b
BLAKE2b-256 1916650909ea96ff5e915da79d232599244581a28708dd3e8a68a045a83b3306

See more details on using hashes here.

File details

Details for the file docmost_mcp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: docmost_mcp-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for docmost_mcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b5c4148ee5d1e9e69ea821c161899297fd1d61789d4a19b329458d9ccb05c9
MD5 cfad1f42b40ed058d93c4577f61aa8f2
BLAKE2b-256 0db5bfbb21c0b12ab48aa28d717efbc184f530856c802f2088c966adea676a54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page