Docs-MCP is a server designed to efficiently search, retrieve, and manage documents with both keyword and semantic search capabilities.
- List Documents: Retrieve a list of all available documents.
- Get Document Content: Fetch content of specific documents with pagination support for large files.
- Grep Search: Perform full-text regex-based searches with case-insensitive option.
- Semantic Search: Find semantically relevant content using OpenAI Embeddings with adjustable result limits.
- Customization: Configure document access, file types, and search behavior through environment variables.
- Integration: Easily integrate with existing documentation projects and tools.
- Import Tools: Import documents from URLs or GitHub repositories.
Supports configuration via .env files for setting API keys and other environment variables
Supports installation via git clone, allowing users to easily download the MCP server
Allows fetching the MCP server code from the GitHub repository
Supports MDX document format for storing and retrieving documentation
Integrates with OpenAI's Embeddings API to enable semantic search of documents based on meaning rather than exact text matching
Includes test suite that can be run with pytest to verify functionality
Built with Python and includes Python scripts for metadata generation
docs-mcp
ユーザーが設定したドキュメントを効率的に検索・参照できるMCPサーバーです。
前提条件
docs-mcpを使用するにはuvが必要です。uvはPythonパッケージとプロジェクト管理のための高速なツールです。
uvのインストール
macOS/Linux
Windows
Homebrew (macOS)
pipでのインストール
詳細はuvのインストールガイドを参照してください。
主な機能
- 📄 ドキュメント一覧表示 - すべてのドキュメントとその説明を一覧表示
- 🔍 grep検索 - 正規表現を使った高速な全文検索
- 🧠 セマンティック検索 - OpenAI Embeddingsを使った意味的な類似検索(要設定)
- 📝 ドキュメント取得 - 指定したドキュメントの全内容を取得
- 📖 ページネーション対応 - 大きなドキュメントをページ単位で効率的に閲覧
クイックスタート
🚀 最もシンプルな使い方
既存のドキュメントがあるプロジェクトですぐに使えます:
Claude Desktopの設定(claude_desktop_config.json
)に追加:
重要: docs-mcpは常にプロジェクトフォルダ内のdocs/
ディレクトリを参照します。
セットアップガイド
方法1: 既存のドキュメントで使う
手元にあるMarkdownやテキストファイルをすぐに検索可能にできます:
- プロジェクトフォルダを作成
docs/
ディレクトリにドキュメントを配置- Claude Desktopの設定を更新
✅ メリット: コマンドライン操作不要、すぐに使える
❌ デメリット: インポートツールが使えない
方法2: インポートツールを活用する
GitHubやWebサイトからドキュメントを取り込む場合:
✅ メリット: 外部ドキュメントを簡単に取り込める
❌ デメリット: uvのセットアップが必要
高度な機能
🧠 セマンティック検索を有効にする
OpenAI Embeddingsを使った意味的な検索を追加できます:
Claude Desktopの設定でAPIキーを追加:
詳細な設定オプション
利用可能なツール
MCPツール(Claude内で使用)
list_docs
- ドキュメント一覧表示get_doc
- ドキュメント内容取得(ページネーション対応)grep_docs
- 正規表現検索semantic_search
- 意味的な類似検索(要OpenAI APIキー)
📖 ページネーション機能の使い方
大きなドキュメント(15,000文字超)では自動的に1ページ目が表示され、ページネーションの使用が推奨されます:
ページネーション出力例:
コマンドラインツール(ドキュメント管理用)
docs-mcp-import-url
- Webサイトからドキュメントをインポートdocs-mcp-import-github
- GitHubリポジトリからインポートdocs-mcp-generate-metadata
- セマンティック検索用メタデータを生成
必要な環境
- uv - Python環境とパッケージ管理ツール(
uvx
コマンドで実行) - Python 3.12以上(uvが自動的に管理)
- OpenAI APIキー(セマンティック検索を使用する場合のみ)
詳細設定
環境変数
変数名 | 説明 | デフォルト値 |
---|---|---|
OPENAI_API_KEY | OpenAI APIキー(セマンティック検索用) | なし |
DOCS_BASE_DIR | ドキュメントプロジェクトのルート | 現在のディレクトリ |
DOCS_FOLDERS | 読み込むフォルダ(カンマ区切り) | docs/ 内の全フォルダ |
DOCS_FILE_EXTENSIONS | 対象ファイル拡張子 | デフォルトの拡張子リスト |
DOCS_MAX_CHARS_PER_PAGE | ページネーションの1ページあたりの最大文字数 | 10000 |
DOCS_LARGE_FILE_THRESHOLD | 大きなファイルの自動ページネーション閾値(文字数) | 15000 |
サポートされるファイル形式
- ドキュメント:
.md
,.mdx
,.txt
,.rst
,.asciidoc
,.org
- 設定:
.json
,.yaml
,.yml
,.toml
,.ini
,.cfg
,.conf
,.xml
,.csv
- コード:
.py
,.js
,.jsx
,.ts
,.tsx
,.java
,.cpp
,.c
,.h
,.go
,.rs
,.rb
,.php
- スクリプト:
.sh
,.bash
,.zsh
,.ps1
,.bat
- Web:
.html
,.css
,.scss
,.vue
,.svelte
- その他:
.sql
,.graphql
,.proto
,.ipynb
,.dockerfile
,.gitignore
ディレクトリ構造の例
開発者向け情報
ソースからの開発
コマンドラインツールの詳細
docs-mcp-import-url
Webサイトからドキュメントをインポート
オプション:
--output-dir
,-o
: 出力ディレクトリ名(docs/
配下に保存)--depth
,-d
: クロール深度--include-pattern
,-i
: 含めるURLパターン--exclude-pattern
,-e
: 除外するURLパターン--concurrent
,-c
: 同時ダウンロード数
docs-mcp-import-github
GitHubリポジトリからインポート。ブランチを指定しない場合はデフォルトブランチ(main/master等)を自動検出します。
オプション:
--output-dir
,-o
: 出力ディレクトリ名(docs/
配下に保存。デフォルト: リポジトリ名)
docs-mcp-generate-metadata
セマンティック検索用のメタデータを生成
セキュリティ
- APIキーは環境変数で管理
DOCS_FOLDERS
とDOCS_FILE_EXTENSIONS
でアクセスを制限- 外部ネットワークアクセスはOpenAI APIのみ
トラブルシューティング
Claude Desktopに表示されない
- 設定ファイルの構文を確認
DOCS_BASE_DIR
が正しいパスを指しているか確認- Claude Desktopを再起動
セマンティック検索が動作しない
OPENAI_API_KEY
が設定されているか確認docs-mcp-generate-metadata
を実行したか確認
インポートが失敗する
- URL/GitHubリポジトリがアクセス可能か確認
- ネットワーク接続を確認
ライセンス
MIT License - LICENSE
コントリビューション
CONTRIBUTING.mdを参照してください。
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An MCP server that allows users to efficiently search and reference user-configured documents through document listing, grep searching, semantic searching with OpenAI Embeddings, and full document retrieval.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation contextLast updated -76281TypeScriptMIT License
- -securityAlicense-qualityAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context. Uses Ollama or OpenAI to generate embeddings. Docker files includedLast updated -5920TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that integrates with SerpApi to retrieve search results from multiple search engines including Google, Bing, Yahoo, and others, enabling fast access to both live and archived search data.Last updated -Python
- -securityFlicense-qualityAn MCP server that enables AI models to search the web using OpenAI's 4o-mini Search model, allowing access to up-to-date information for just a few cents per search.Last updated -1JavaScript