Skip to main content
Glama

docmost-mcp

自己ホスト型の Docmost ウィキに、通常の REST API 経由で AI エージェントに読み書きアクセスを提供する MCP サーバー。

存在理由

Docmost には独自の MCP エンドポイントが同梱されていますが、有料ライセンスの後ろにゲートされています。設定 UI では API 管理について "Available with a paid license" と表示され、Community Edition では /api/mcp404 を返します。API キーの発行も同様にゲートされています。

ただし、通常の REST API は Community Edition で完全に利用可能です。このサーバーはその REST API の薄いラッパーであり、同じ操作を API キーではなくセッション認証で実行します。

Related MCP server: MediaWiki MCP Server

要件

  • Python 3.11+

  • HTTP(S) 経由で到達可能な Docmost インスタンス

  • エージェント専用の Docmost ユーザーアカウント

インストール

git clone https://github.com/<you>/docmost-mcp.git
cd docmost-mcp
python3 -m venv venv
./venv/bin/pip install -r requirements.txt

設定

サンプル設定をコピーして記入してください:

cp config.example.json config.json
chmod 600 config.json
{
  "url": "https://docmost.example.com",
  "api_key": "",
  "email": "agent@example.com",
  "password": "..."
}

2 つの認証モードがサポートされています:

モード

使用する場面

api_key

Docmost Enterprise ライセンスをお持ちの場合。Bearer トークンとして送信されます。

email + password

Community Edition の場合。サーバーがログインし、セッションの有効期限が切れると自動的に再認証します。

api_key が設定されている場合はそれが優先され、それ以外の場合は資格情報が使用されます。

設定パスは DOCMOST_MCP_CONFIG 環境変数で上書きできます。

専用アカウントを作成する

ワークスペース所有者の資格情報を使用しないでください。別のユーザーを招待し (Settings → Members → Invite)、エージェントが必要とするスペースにのみアクセスを許可してください。Docmost のスペースへのアクセスは通常、デフォルトの Everyone グループから継承されるため、エージェントが制限されていると想定する前に、そのグループがアクセスできる範囲を確認してください。

2 つ目のメールボックスを作成したくない場合は、Gmail 形式のプラスアドレス (you+agent@gmail.com) を使用できます。

動作確認

selftest.py はチェーン全体 (ログイン、読み取り、書き込み、読み返し、削除) を実行します:

./venv/bin/python selftest.py

エージェントの接続

サーバーは stdio 上で MCP を通信します。

Claude Code

claude mcp add docmost -- /path/to/docmost-mcp/venv/bin/python /path/to/docmost-mcp/server.py

または手動で ~/.claude.json に追加します:

{
  "mcpServers": {
    "docmost": {
      "type": "stdio",
      "command": "/path/to/docmost-mcp/venv/bin/python",
      "args": ["/path/to/docmost-mcp/server.py"],
      "env": {}
    }
  }
}

その後 Claude Code を再起動してください。設定は起動時に読み込まれます。

Claude Desktop

同じブロックを claude_desktop_config.json に追加します:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor

プロジェクト内の .cursor/mcp.json またはグローバルの ~/.cursor/mcp.json に、同じ mcpServers の形式で追加します。

その他の MCP クライアント

virtualenv の Python で server.py を起動し、stdin と stdout で JSON-RPC を送受信します。最小限のハンドシェイク:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"1"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/list"}

便利なラッパーを使うとコマンドを短くできます:

#!/bin/sh
exec /path/to/docmost-mcp/venv/bin/python /path/to/docmost-mcp/server.py "$@"

ツール

ツール

引数

動作

list_spaces

limit

ワークスペースのスペースを一覧表示します

search

query, space_id?, limit

ページ全体を全文検索します

get_page

page_id

ID または slugId でページを取得します

recent_pages

space_id?, limit

最近変更されたページを取得します

create_page

space_id, title, content?, parent_page_id?, fmt

ページを作成します

update_page

page_id, title?, content?, fmt

タイトルや本文を更新します

move_page

page_id, parent_page_id?

ページの親を変更します

delete_page

page_id, permanently

ページをゴミ箱に入れます (または完全に削除します)

fmtmarkdown (デフォルト)、htmljson のいずれかです。

Docmost API の注意点

このサーバーを拡張する場合に知っておくと役立つこと:

  • 読み取りを含むすべてのエンドポイントが POST です。

  • /pages/create/pages/updateformat フィールド (json | markdown | html) が 必須 です。省略すると 400 が返ります。

  • レスポンスはペイロードを {"data": ...} でラップします。クライアント側でそれをアンラップします。

  • Community Edition では /api/api-keys は空のリストで 200 を返します。一覧表示は開放されており、キーの 作成 のみがライセンスで制限されています。

  • エンドポイントのパスとペイロードの構造は、推測ではなく Docmost クライアントのソース (apps/client/src/features/*/services/*.ts) から取得したものです。

セキュリティ

  • config.json には平文のパスワードが含まれます。パーミッションを 600 に保ち、バージョン管理の対象外にしてください。.gitignore に含まれています。

  • エージェントアカウントには、作業に必要な最小限のスペースアクセスのみを付与してください。

  • アカウントの操作は Docmost 上でそのアカウントの名前で表示されるため、ページ履歴は誰の操作か追跡可能です。

互換性

Docmost 0.95.0 と Python MCP SDK 2.0 を対象に構築されています。SDK 2.0 では FastMCPMCPServer に名前変更され、mcp.server に移動したことに注意してください。2.0 より前のインポートパス mcp.server.fastmcp は機能しません。

ライセンス

MIT — LICENSE を参照してください。

このプロジェクトは Docmost とは提携関係にありません。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI models to interact with BookStack wiki instances through a comprehensive API interface. Supports content management (books, chapters, pages), user administration, search functionality, and content export in multiple formats.
    41
    12
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables LLM clients to interact with any MediaWiki wiki, supporting page creation/editing, search, file uploads, category browsing, and page history retrieval. Supports multiple wikis with OAuth2 or bot password authentication for both public and private wikis.
    910
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    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.
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.

  • Self-hostable team wiki; agents read & write it via MCP; Atlas turns your repo into a cited wiki.

  • AgentDocs (agentdocs.eu) MCP: read, search, write, comment, share & attach images to Markdown docs.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NeerdOnerT/docmost-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server