About プロジェクトディレクトリ概要
This project serves Gemini, Anthropic, and OpenAPI documentation through MCP for developers who need API references in a client. It includes a crawler and reads content from local JSON or YAML files.
Key features
- 01Serve Gemini and Anthropic documentation
- 02Read OpenAPI YAML files
- 03Crawl web pages and save documentation
- 04Use preset or custom crawl rules
Use cases
- 01Look up Gemini API documentation in Claude
- 02Look up Anthropic API documentation in Claude
- 03Consult OpenAPI documentation from local YAML
- 04Crawl documentation sites with path and page limits
MCP support
The project includes several MCP server programs that provide local JSON documentation or OpenAPI YAML content to clients such as Claude.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEプロジェクトディレクトリ概要
このプロジェクトは、MCP サーバーを使用して API ドキュメントを参照する方法を提供します。reference の機能を使用して実装されています。
ディレクトリ構成
README.md: このファイル。プロジェクトの概要と使用方法を記載しています。crawl_all.py: 特定のウェブページをクロールするスクリプト。(使用方法は後述)document/: クローリングした結果が保存されるディレクトリ。gemini_docs.py:gemini_docs.jsonの内容を MCP サーバー経由で提供するメインプログラム。anthropic_docs.py:anthropic_docs.jsonの内容を MCP サーバー経由で提供するメインプログラム。openapi_docs.py:openapi.yamlの内容を MCP サーバー経由で提供するメインプログラム。
使用方法
詳細なセットアップ手順については、公式クイックスタートガイドを参照してください。事前に本リポジトリをクローンしてください。
-
ドキュメントの用意 document の中身は本リポジトリには含めておりません。各自クローリングして document 内に保存してください。詳しい方法については本 readme 末尾に記載があります。
-
uv のインストール
curl -LsSf https://astral.sh/uv/install.sh | sh
- 仮想環境の有効化
uv venv
source .venv/bin/activate
- 依存関係のインストール
uv add "mcp[cli]" PyYAML
- プログラムの動作確認
例として、gemini_docs.py を実行します。
uv run gemini_docs.py
claude_desktop_config.jsonの更新
以下の設定を追加または更新してください。
{
"mcpServers": {
"gemini_docs_resource": {
"command": "uv",
"args": [
"--directory",
"mcp_server ディレクトリへのパス",
"run",
"gemini_docs.py"
]
}
}
}
注: 実行がうまくいかない場合は、uv を絶対パスに変更してください。また、必要に応じて gemini_docs.py を anthropic_docs.py または openapi_docs.py に変更してください。
- Claude の再起動
設定を反映させるために Claude を再起動してください。
各 MCP サーバーについて
- gemini_docs.py: クローリング結果が JSON ファイルとして保存され、その内容を利用します。
- anthropic_docs.py: クローリング結果が JSON ファイルとして保存され、その内容を利用します。
- openapi_docs.py: OpenAPI ドキュメントはクローリングできないため、GitHub リポジトリからダウンロードしたファイルを参照します。このプログラムは YAML 形式のファイルを読み取るように設計されています。
クローリング
crawl_all.py を使用して、プリセットに基づき gemini と anthropic のドキュメントをクロールできます。
python crawl_all.py --preset gemini
python crawl_all.py --preset anthropic
また、プリセットを使用せず、任意の設定でクロールすることも可能です。
python crawl_all.py \
--base-url "https://example.com" \
--start-path "/docs" \
--output_file "document/example_docs.json" \
--selector "main" \
--path-pattern "^/docs/.*" \
--delay 0.5 \
--max-pages 100
主なコマンドラインオプション
| オプション | 説明 |
|---|---|
--preset | gemini または anthropic を指定すると、事前定義された設定でクロールを開始します。 |
--base-url | クロール対象サイトのベース URL(例: https://example.com)。 |
--start-path | クロール開始パス(例: /docs)。 |
--output_file | クロール結果の保存先ファイルパス(例: document/example_docs.json)。 |
--selector | ページ内でコンテンツを取得するための CSS セレクタ(デフォルト: main)。 |
--delay | 各リクエスト間の待機時間(秒)(デフォルト: 0.5 秒)。 |
--use-selenium | 動的ページ対応のため Selenium を使用する場合に指定します。 |
--wait-time | Selenium 使用時のページ読み込み待機時間(秒)(デフォルト: 5 秒)。 |
--additional-paths | クロール対象に追加するパスのリスト。 |
--path-pattern | クロール対象とする URL パスの正規表現パターン。 |
--max-pages | 最大クロールページ数(例: 200 ページまで)。 |
--debug | デバッグモードを有効にして詳細なログを出力します。 |
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.