mcpField
G
gs-advanced-search

gs-advanced-search

github.com/cookjohn生産性538231 回インストール33 週間前に更新
リポジトリ

gs-advanced-search について

gs-advanced-searchは、自然言語の検索条件をGoogle ScholarのURLパラメーターに変換して検索します。著者、出版物、期間、タイトル範囲を指定する文献検索に適しています。

主な機能

  1. 01条件をScholarのURLパラメーターに変換
  2. 02著者と出版物の指定
  3. 03期間と検索範囲の設定
  4. 04構築した検索パラメーターの表示

活用シーン

  1. 01期間を指定した著者の論文検索
  2. 02特定の出版物内でのトピック検索
  3. 03フレーズ検索をタイトルに限定

MCP 対応

Chrome DevTools MCPで構築したGoogle Scholar検索URLに移動し、検索結果を抽出します。

インストール

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

$npx skills add https://github.com/cookjohn/gs-skills --skill gs-advanced-search

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

詳細

Google Scholar 詳細検索

ユーザーの自然言語による説明に基づいて、URL パラメーターを使用して Google Scholar 検索を作成し、実行します。

引数

$ARGUMENTS は検索条件を自然言語で記述したものです。例:

  • 「2020 年以降に発表された、相対性理論に関する Einstein の論文を検索」
  • 「Nature に掲載された CRISPR に関するレビューを検索」
  • 「タイトルのみを対象に、完全一致する語句「machine learning」を検索」

ステップ 1:検索条件を URL パラメーターに変換

ユーザーの意図を Google Scholar の URL パラメーターに割り当てます。

条件パラメーター例
キーワードqq=gastric+cancer
著者as_sauthorsas_sauthors="Albert Einstein"
ジャーナル/情報源as_publicationas_publication=Nature
開始年as_yloas_ylo=2020
終了年as_yhias_yhi=2025
完全一致する語句as_epqas_epq=machine+learning
次のいずれかの語句(OR)as_oqas_oq=immunotherapy+checkpoint
除外する語句as_eqas_eq=review
検索範囲as_occtas_occt=title(タイトルのみ)/as_occt=any(すべて)
1 ページあたりの検索結果数numnum=10(デフォルト)または num=20(最大)
言語hlhl=en または hl=zh-CN

構成例:

  • 「Einstein 2020 年以降に Nature で発表した論文」 → scholar?as_sauthors=Einstein&as_publication=Nature&as_ylo=2020&hl=en
  • 「タイトルに CRISPR を含む論文」 → scholar?q=CRISPR&as_occt=title&hl=en
  • 「deep learning と完全一致し、review を除外して検索」 → scholar?as_epq=deep+learning&as_eq=review&hl=en
  • 「immunotherapy または checkpoint に関連する論文を検索」 → scholar?as_oq=immunotherapy+checkpoint&hl=en

注意:

  • as_sauthors、as_publication などを使用する場合、q は省略するか、追加のキーワードに使用できます。
  • 結果を安定させるため、常に hl=en を指定してください。
  • CAPTCHA のリスクを最小限に抑えるため、num=10(デフォルト)を使用してください。

ステップ 2:移動

mcp__chrome-devtools__navigate_page を使用します。

  • url: https://scholar.google.com/scholar?{CONSTRUCTED_PARAMS}

ステップ 3:結果を抽出する(evaluate_script)

gs-search のステップ 2 と同じ抽出スクリプトを使用します。

async () => {
  for (let i = 0; i < 20; i++) {
    if (document.querySelector('#gs_res_ccl') || document.querySelector('#gs_captcha_ccl')) break;
    await new Promise(r => setTimeout(r, 500));
  }

  if (document.querySelector('#gs_captcha_ccl') || document.body.innerText.includes('unusual traffic')) {
    return { error: 'captcha', message: 'Google Scholar requires CAPTCHA verification. Please complete it in your browser, then tell me to continue.' };
  }

  const items = document.querySelectorAll('#gs_res_ccl .gs_r.gs_or.gs_scl');
  const results = Array.from(items).map((item, i) => {
    const titleEl = item.querySelector('.gs_rt a');
    const meta = item.querySelector('.gs_a')?.textContent || '';
    const parts = meta.split(' - ');
    const authors = parts[0]?.trim() || '';
    const journalYear = parts[1]?.trim() || '';
    const citedByEl = item.querySelector('.gs_fl a[href*="cites"]');

    return {
      n: i + 1,
      title: titleEl?.textContent?.trim() || item.querySelector('.gs_rt')?.textContent?.trim() || '',
      href: titleEl?.href || '',
      authors,
      journalYear,
      citedBy: citedByEl?.textContent?.match(/\d+/)?.[0] || '0',
      citedByUrl: citedByEl?.href || '',
      dataCid: item.getAttribute('data-cid') || '',
      fullTextUrl: (item.querySelector('.gs_ggs a') || item.querySelector('.gs_or_ggsm a'))?.href || '',
      snippet: item.querySelector('.gs_rs')?.textContent?.trim()?.substring(0, 200) || ''
    };
  });

  const totalText = document.querySelector('#gs_ab_md')?.textContent?.trim() || '';
  const currentUrl = window.location.href;
  return { total: totalText, resultCount: results.length, currentUrl, results };
}

ステップ 4:報告

Advanced search on Google Scholar:
Query parameters: {list the parameters used}
{total}

1. {title}
   Authors: {authors} | {journalYear}
   Cited by: {citedBy} | [Full text]({fullTextUrl})
   Data-CID: {dataCid}

2. ...

クエリの構築方法がユーザーにわかるよう、構成した URL パラメーターを必ず表示してください。

注意事項

  • このスキルでは、navigate_page と evaluate_script の 2 回のツール呼び出しを使用します。
  • Google Scholar は出版物の種類(レビュー、臨床試験など)による絞り込みをサポートしていません。代わりにキーワードを使用してください。
  • Google Scholar ではインパクトファクターを確認できません。代わりに被引用数を参考値として使用してください。
  • gs-search との主な違いは URL パラメーターの構成です。このスキルは自然言語を Google Scholar の検索パラメーターに変換します。

コメント