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.1.0.tar.gz (15.7 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.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docmost_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 15.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 7acae925d085604032c55273fa7332075407b64c7bb04f57769a872587db6fc8
MD5 125ff5a7bfa634ce303ea5b398b86c2f
BLAKE2b-256 0a383e6497e9ee9e1adf45ceee61dd96828c119ad8488d5d546c1d5352477ba8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docmost_mcp-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 425386555fa94a84d479f40885b82dfd58b8226b33b6df6ff70f9dabe9506e20
MD5 580247b643d50d34b2ecb9c0d187c09f
BLAKE2b-256 550c8c7c11533c023196c97bebaa9140fecd379f588246099227599e0b55dc0e

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