Docmost MCP Server

Docmost MCP Server

Provides AI assistants with direct access to self-hosted Docmost documentation through tools for listing spaces, searching content, and retrieving pages in Markdown format. It facilitates seamless documentation lookup and content retrieval within MCP-compatible clients.

Category
访问服务器

README

Docmost MCP Server

An MCP server that gives AI assistants direct access to your self-hosted Docmost documentation via its API.

Works with any MCP-compatible client, including:

Features

Tool Description
list_spaces List all available documentation spaces with names, slugs, and IDs
search_docs Full-text search across all documentation, with optional space filtering
get_page Retrieve full page content converted from ProseMirror JSON to Markdown

Prerequisites

  • Python 3.10+
  • A running Docmost instance with valid user credentials
  • An MCP-compatible client (Claude Code, Claude Desktop, Cursor, VS Code, etc.)

Installation

1. Clone the repository

git clone https://github.com/aleksvin8888/local-docmost-mcp.git
cd docmost-mcp

2. Create a virtual environment and install dependencies

python3 -m venv venv
source venv/bin/activate   # Linux / macOS
# venv\Scripts\activate    # Windows

pip install -r requirements.txt

This installs two dependencies:

  • mcp — official Python SDK for building MCP servers
  • requests — HTTP client for Docmost API calls

3. Configure credentials

Copy the example config and fill in your details:

cp config.example.json config.json

Edit config.json:

{
  "base_url": "https://your-docmost-instance.example.com",
  "email": "your-email@example.com",
  "password": "your-password",
  "timeout": 30
}
Parameter Description
base_url URL of your Docmost instance (no trailing slash)
email Email address for Docmost authentication
password Password for Docmost authentication
timeout HTTP request timeout in seconds

Note: config.json contains sensitive credentials and is excluded from version control via .gitignore.

4. Verify the setup

source venv/bin/activate   # if not already active

python docmost_client.py

Expected output:

=== Spaces ===
  My Space (my-space) - 019a2a69-...
  Another Space (another) - 019a5e21-...
  ...

=== Search 'example' ===
  Example Page Title - abc123def
  ...

If you see your spaces and search results, the client is working correctly.

Connecting to an MCP client

The server uses stdio transport, which is supported by all major MCP clients. Below are setup instructions for the most popular ones.

Claude Code

Choose one of the following options.

Important: Use absolute paths to both the Python binary inside venv and mcp_server.py.

Option 1: Global config (recommended)

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "docmost": {
      "command": "/absolute/path/to/docmost-mcp/venv/bin/python",
      "args": ["/absolute/path/to/docmost-mcp/mcp_server.py"]
    }
  }
}

Option 2: Project-level config

Create .claude/settings.json in your project root:

{
  "mcpServers": {
    "docmost": {
      "command": "/absolute/path/to/docmost-mcp/venv/bin/python",
      "args": ["/absolute/path/to/docmost-mcp/mcp_server.py"]
    }
  }
}

Option 3: CLI command

claude mcp add docmost \
  -c "/absolute/path/to/docmost-mcp/venv/bin/python" \
  -- /absolute/path/to/docmost-mcp/mcp_server.py

After adding the config, restart Claude Code or start a new session.

Claude Desktop

Add the server to your Claude Desktop config file:

  • Linux: ~/.config/claude/claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "docmost": {
      "command": "/absolute/path/to/docmost-mcp/venv/bin/python",
      "args": ["/absolute/path/to/docmost-mcp/mcp_server.py"]
    }
  }
}

Restart Claude Desktop after saving the config.

Cursor / Windsurf / VS Code / Other clients

Most MCP clients use the same configuration format. Add the server with:

  • Command: /absolute/path/to/docmost-mcp/venv/bin/python
  • Args: /absolute/path/to/docmost-mcp/mcp_server.py
  • Transport: stdio

Refer to your client's documentation for the exact config file location and format.

Usage

Once the MCP server is connected, your AI assistant can use the following tools:

List all spaces

Show me all available documentation spaces

Search documentation

Search the documentation for "user permissions"

Search within a specific space

Find "API endpoints" in the Engineering space

Get a specific page

Show me the full content of page with slug_id "abc123def"

How it works

  1. The MCP client launches the server as a subprocess and communicates via stdio (stdin/stdout).
  2. On the first API call, the server authenticates with your Docmost instance using email/password and receives a JWT token from the Set-Cookie header.
  3. The token is cached in token.json for subsequent requests. If a request returns 401, the server automatically re-authenticates and retries.
  4. Page content is stored in Docmost as ProseMirror JSON. The server converts it to clean Markdown (headings, lists, tables, code blocks, images, links, etc.) before returning it to the client.

Project structure

docmost-mcp/
├── mcp_server.py         # MCP server (3 tools)
├── docmost_client.py     # Docmost API client
├── requirements.txt      # Python dependencies (mcp, requests)
├── config.example.json   # Configuration template
├── config.json           # Your credentials (not in git)
├── token.json            # Cached JWT token (auto-generated, not in git)
├── .gitignore
└── README.md

Security

  • config.json contains your credentials — never commit it to git
  • token.json contains a JWT token — never commit it to git
  • Both files are already listed in .gitignore

Troubleshooting

"No authToken in response cookies"

  • Verify that email and password in config.json are correct
  • Verify that base_url points to your Docmost instance

"Connection refused"

  • Check that your Docmost instance is running and accessible
  • Check your network connection and firewall rules

"401 Unauthorized"

  • The token may have expired — delete token.json and it will be recreated automatically on the next request

MCP tools not appearing in the client

  • Ensure you used absolute paths to venv/bin/python and mcp_server.py
  • Check that the virtual environment has all dependencies installed (pip install -r requirements.txt)
  • Restart your MCP client after changing the config

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选