mcpField
W
web-search

web-search

github.com/signet-ai生産性314135 回インストール4 日前に更新
リポジトリ

web-search について

エージェント向けのウェブ検索・取得スキルです。SearXNG、Lightpanda、Agent-Browser と統合 CLI の web-search を組み合わせ、JavaScript 描画、ログイン、操作の要否に応じた取得方法を示します。

主な機能

  1. 01SearXNG によるウェブ検索とカテゴリ指定
  2. 02Lightpanda による Markdown・HTML・意味ツリー取得
  3. 03Agent-Browser による動的ページとフォームの操作
  4. 04web-search CLI による検索と取得の連携
  5. 05ページ送りと複数ページの取得

活用シーン

  1. 01トピックを検索して結果の抜粋を確認
  2. 02ニュースや指定カテゴリのページを検索
  3. 03検索結果から複数ページを取得
  4. 04ログインや操作が必要な動的ページに対応

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/signet-ai/signetai --skill web-search

インストール後、Claude Code で/web-searchを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
infrastructure.md
searxng-settings.yml
scripts/
web-search

詳細

Web Search & Scrape

Web にアクセスするためのツールが 3 つあります。タスクの内容に応じて組み合わせて使用してください。

スタック

SearXNG — 検索エンジン

25 以上の検索エンジン(Google、Bing、DuckDuckGo、Brave など)を集約するローカルのメタ検索エンジンです。追跡はなく、レート制限もありません。JSON API を利用できます。

# Basic search
curl -s "http://localhost:8888/search?q=QUERY&format=json" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', [])[:10]:
    print(r.get('title', ''))
    print(r.get('url', ''))
    print(r.get('content', '')[:200])
    print()
"

カテゴリ検索 — &categories= を追加し、general、news、images、files、science、it、music、videos を指定します。

# News search
curl -s "http://localhost:8888/search?q=QUERY&format=json&categories=news"

# Multiple categories
curl -s "http://localhost:8888/search?q=QUERY&format=json&categories=science,it"

ページネーション — さらに結果を表示するには、&pageno=2(または 3、4 など)を追加します。

Lightpanda — 高速ヘッドレスフェッチ

Zig で構築されています。Chrome の 10 倍高速で、メモリ使用量もごくわずかです。ページコンテンツの取得には、これをデフォルトで使用してください。

# Fetch as markdown (best for reading/summarizing)
lightpanda fetch --dump markdown https://example.com

# Fetch as HTML (when you need structure)
lightpanda fetch --dump html https://example.com

# Semantic tree (useful for understanding page layout)
lightpanda fetch --dump semantic_tree https://example.com

# Strip unnecessary elements
lightpanda fetch --dump markdown --strip_mode js,css https://example.com

# Include iframe content
lightpanda fetch --dump markdown --with_frames https://example.com
Agent-Browser — フルブラウザー自動化

Playwright ベースです。Lightpanda でページを処理できない場合(JavaScript を多用する SPA、ログインが必要なページ、動的コンテンツ、フォーム操作など)に使用してください。

# Open and snapshot
agent-browser open https://example.com
agent-browser wait --load networkidle
agent-browser snapshot -i

# Get text content
agent-browser get text body

# Interact with elements
agent-browser fill @e1 "search query"
agent-browser click @e2

# Screenshot for visual inspection
agent-browser screenshot --annotate

# Always close when done
agent-browser close

選択ガイド

何かを見つけたいですか? → まず SearXNG を使用してください。常に最初に使います。

ページのコンテンツが必要ですか? → Lightpanda を使用してください。高速で、クリーンな Markdown を返し、ページの 90% に対応します。

Lightpanda が不正なコンテンツや空のコンテンツを返しますか? → ページの表示に JavaScript が必要な可能性があります。Agent-Browser に切り替えてください。

ログイン、フォーム入力、操作手順のクリックが必要ですか? → Agent-Browser を使用してください。認証状態を保存して再利用できます。

agent-browser state save auth.json
# Later:
agent-browser state load auth.json

web-search CLI

~/.agents/tools/web-search に統合 CLI もあります(PATH 上では web-search としても利用可能)。これらのツールを連携させて使用します。

# Search only
web-search "hospice compliance CMS 2026"

# Search + scrape top results
web-search "hospice compliance CMS 2026" --scrape -n 3

# Fetch a single URL
web-search --fetch https://example.com

# Use Agent-Browser for JS-heavy pages
web-search --fetch https://spa-app.com --browser

# News search + scrape
web-search "CMS hospice updates" --categories news --scrape

よくあるパターン

トピックを調査する
# 1. Search
curl -s "http://localhost:8888/search?q=topic+here&format=json" > /tmp/results.json

# 2. Review results, pick the best URLs

# 3. Fetch the good ones
lightpanda fetch --dump markdown https://good-result.com
最新情報や速報を取得する
# News category + recent results
curl -s "http://localhost:8888/search?q=topic&format=json&categories=news"
複数のページを詳細にスクレイピングする
# Search, extract URLs, fetch each
curl -s "http://localhost:8888/search?q=topic&format=json" | \
  python3 -c "import json,sys; [print(r['url']) for r in json.load(sys.stdin)['results'][:5]]" | \
  while read url; do
    echo "=== $url ==="
    lightpanda fetch --dump markdown "$url" 2>/dev/null
  done
JavaScript を多用する扱いにくいページに対応する
# Lightpanda returned nothing useful? Switch to agent-browser
agent-browser open https://stubborn-spa.com
agent-browser wait --load networkidle
agent-browser get text body > /tmp/page-content.txt
agent-browser close

重要な注意事項

  • SearXNG は http://localhost:8888 で実行されます。停止している場合は、docker ps | grep searxng を確認し、docker start searxng で再起動してください
  • Lightpanda は /opt/homebrew/bin/lightpanda にあります
  • Agent-Browser は /opt/homebrew/bin/agent-browser にあります(v0.21.1)
  • web-search CLI は ~/.agents/tools/web-search にあり、/opt/homebrew/bin/web-search にシンボリックリンクされています
  • SearXNG が結果を返すと、content フィールドにスニペットが含まれます。ページ全体を取得しなくても、簡単な事実に関する質問への回答には十分なことがよくあります
  • curl で URL エンコードするには、python を使用してください:python3 -c "import urllib.parse; print(urllib.parse.quote('my query'))"

同梱リソース

このスキルには、スタックの再構築やトラブルシューティングに必要なものがすべて含まれています。

  • scripts/web-search — 統合 CLI スクリプト(~/.agents/tools/web-search にもインストールされています)
  • references/infrastructure.md — インフラストラクチャの完全なドキュメント:バイナリの場所、SearXNG API リファレンス、コンテナー管理、OrbStack のセットアップ、トラブルシューティングガイド。問題が発生した場合や、再設定が必要な場合に参照してください。
  • references/searxng-settings.yml — SearXNG の設定(エンジン、形式、API 設定)。編集して ~/.agents/searxng/config/settings.yml にコピーし、docker restart searxng を実行すると変更が適用されます。

関連スキル

  • [[agent-browser]] — JavaScript を多用するページやフォーム操作に対応するフルブラウザー自動化
  • [[human-browser]] — ボット対策サイト向けの住宅用プロキシを使ったステルスブラウジング
  • [[seo]] — Web 調査を補完する SEO 監査と最適化

コメント