プロジェクトディレクトリ概要

by yhanawa

111 downloads
Not rated
GitHub

Description

# プロジェクトディレクトリ概要 このプロジェクトは、MCP サーバーを使用して API ドキュメントを参照する方法を提供します。`reference` の機能を使用して実装されています。 ## ディレクトリ構成 - `README.md`: このファイル。プロジェクトの概要と使用方法を記載しています。 - `crawl_all.py`: 特定のウェブページをクロールするスクリプト。(使用方法は後述) - `document/`: クローリングした結果が保存されるディレクトリ。 - `gemini_docs.py`…

About

# プロジェクトディレクトリ概要 このプロジェクトは、MCP サーバーを使用して API ドキュメントを参照する方法を提供します。`reference` の機能を使用して実装されています。 ## ディレクトリ構成 - `README.md`: このファイル。プロジェクトの概要と使用方法を記載しています。 - `crawl_all.py`: 特定のウェブページをクロールするスクリプト。(使用方法は後述) - `document/`: クローリングした結果が保存されるディレクトリ。 - `gemini_docs.py`: `gemini_docs.json` の内容を MCP サーバー経由で提供するメインプログラム。 -…

Details

Author
yhanawa
Downloads
111
Categories
Other

- Provides MCP servers for Gemini, Anthropic, and OpenAPI documentation.
- Crawls web documentation using a customizable script (crawl_all.py).
- Supports presets for Gemini and Anthropic documentation.
- Allows custom crawling with options like base URL, selector, and delay.
- Integrates with Claude Desktop via claude_desktop_config.json.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name プロジェクトディレクトリ概要
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install uv, create a virtual environment, and install dependencies (mcp[cli] and PyYAML). Prepare documentation by crawling (or downloading for OpenAPI), then run one of the MCP server scripts (e.g., uv run gemini_docs.py). Finally, update claude_desktop_config.json with the appropriate command and restart Claude.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u6982\u8981": {
            "mcp-server-yhanawa": {
                "command": "uv",
                "args": [
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-yhanawa": {
        "command": "uv",
        "args": [
            "venv"
        ]
    }
}

プロジェクトディレクトリ概要

このプロジェクトは、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 サーバー経由で提供するメインプログラム。

使用方法

詳細なセットアップ手順については、公式クイックスタートガイドを参照してください。事前に本リポジトリをクローンしてください。

1. ドキュメントの用意
document の中身は本リポジトリには含めておりません。各自クローリングして document 内に保存してください。詳しい方法については本 readme 末尾に記載があります。

2. uv のインストール

curl -LsSf https://astral.sh/uv/install.sh | sh

3. 仮想環境の有効化

uv venv
source .venv/bin/activate

4. 依存関係のインストール

uv add "mcp[cli]" PyYAML

5. プログラムの動作確認

例として、gemini_docs.py を実行します。

uv run gemini_docs.py

6. claude_desktop_config.json の更新

以下の設定を追加または更新してください。

{
  "mcpServers": {
    "gemini_docs_resource": {
      "command": "uv",
      "args": [
        "--directory",
        "mcp_server ディレクトリへのパス",
        "run",
        "gemini_docs.py"
      ]
    }
  }
}

注: 実行がうまくいかない場合は、uv を絶対パスに変更してください。また、必要に応じて gemini_docs.pyanthropic_docs.py または openapi_docs.py に変更してください。

7. 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 | デバッグモードを有効にして詳細なログを出力します。 |

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.