Skip to main content
Glama
ElliotPadfield

Unpaywall MCP Server

Unpaywall MCP サーバー

npm version CI license node >=18

Unpaywallツールを公開するMCP (Model Context Protocol) サーバーであり、AIクライアントは以下のことが可能です:

  • DOIによるメタデータの取得

  • 論文タイトルの検索

  • 最適なOA(オープンアクセス)全文リンクの取得

  • OA PDFのダウンロードとテキスト抽出

クイックスタート (npx)

MCPクライアントの設定(Claude Desktopの例)に以下を追加してください:

{
  "mcpServers": {
    "unpaywall": {
      "command": "npx",
      "args": ["-y", "unpaywall-mcp"],
      "env": { "UNPAYWALL_EMAIL": "you@example.com" }
    }
  }
}

次に、ツールを試してみてください:unpaywall_search_titles, unpaywall_get_fulltext_links, unpaywall_fetch_pdf_text。

このリポジトリをクローンしたり npm install を実行したりする必要はありません。npx が初回呼び出し時にフェッチとキャッシュを処理します。

Related MCP server: ScholarScope MCP

要件

  • Node.js 18+ (npx用)

  • Unpaywall / OpenAlexリクエスト用のメールアドレス(Unpaywallで必須、OpenAlexのポライトプールで使用されます)

ローカル開発(コントリビューターのみ)

エンドユーザーは上記のnpx設定を使用してください。ソースからビルドするコントリビューター向け:

npm install
npm run build
UNPAYWALL_EMAIL=you@example.com npm start   # stdio transport, as required by MCP clients

ホットラン(ビルドステップなし):

UNPAYWALL_EMAIL=you@example.com npm run dev

ツール

unpaywall_get_by_doi

  • 説明: DOIのUnpaywallメタデータを取得します

  • 入力スキーマ:

    • doi (文字列, 必須): 例: 10.1038/nphys1170

    • email (文字列, オプション): 指定された場合、UNPAYWALL_EMAIL を上書きします

  • 出力: UnpaywallからのJSONレスポンス

unpaywall_search_titles

  • 説明: 論文タイトルを検索し、各ヒットに対するUnpaywall形式のOAメタデータを返します(1ページあたり50件)

  • 入力スキーマ:

    • query (文字列, 必須): タイトル検索クエリ

    • is_oa (ブール値, オプション): trueの場合、OA結果のみ。falseの場合、クローズドのみ。省略時はすべて

    • page (整数 >= 1, オプション): ページ番号

    • email (文字列, オプション): UNPAYWALL_EMAIL を上書きします

  • 出力: Unpaywallの検索形式に一致するJSON。results[].response はDOI形式のレコード(doi, title, is_oa, oa_status, best_oa_location, oa_locations)であり、各結果に score と snippet が含まれます。_source: "openalex" はアップストリームを示します。

  • 注: Unpaywall独自の /v2/search が2025年5月の書き換え以降HTTP 500を返しているため、OpenAlexの /works エンドポイントを利用しています。Unpaywallは現在OpenAlexのサブルーチンとして動作しているため、これが現代における標準的な代替手段です。

unpaywall_get_fulltext_links

  • 説明: DOIに対する最適なOA PDF URLとOpen URL、およびすべてのOAロケーションを返します

  • 入力スキーマ:

    • doi (文字列, 必須)

    • email (文字列, オプション): UNPAYWALL_EMAIL を上書きします

  • 出力: best_pdf_url, best_open_url, best_oa_location, oa_locations および選択されたメタデータを含むJSON

unpaywall_fetch_pdf_text

  • 説明: DOIに対する最適なOA PDF、または提供された pdf_url からテキストをダウンロードして抽出します

  • 入力スキーマ:

    • pdf_url (文字列, オプション): 直接のPDF URL(優先されます)

    • doi (文字列, オプション): pdf_url が提供されない場合に最適なOA PDFを解決するために使用されます

    • email (文字列, オプション): doi を使用し、UNPAYWALL_EMAIL 環境変数がない場合に必須

    • truncate_chars (整数 >= 1000, オプション): 返される抽出テキストの最大文字数(デフォルト 20000)

  • 出力: text(切り詰められる可能性あり)、length_chars、truncated、pdf_url、およびPDFメタデータを含むJSON

LLMプロンプトのヒント (MCP)

MCP対応のLLMクライアントからこのサーバーを使用する場合、モデルに以下のように指示してください:

  • 検索してから取得: unpaywall_search_titles を簡潔なタイトルフレーズで使用し、結果を選択してから、選択したDOIに対して unpaywall_get_fulltext_links または unpaywall_fetch_pdf_text を呼び出します。

  • OAを優先: オープンアクセスのみが必要な場合は、検索時に is_oa: true を渡します。

  • サイズを制御: unpaywall_fetch_pdf_text で truncate_chars(デフォルト 20000)を設定し、処理を進める前に長いテキストを要約させます。

  • 回復力を持たせる: 最適なPDF URLが見つからない場合は、best_open_url にフォールバックし、ランディングページからコンテンツを抽出します(このサーバーの外部)。

  • レート制限を尊重: 多くの呼び出しを行う場合はリクエストの間隔を空け、同じ呼び出しを繰り返す代わりに以前のレスポンスを再利用します。

LLMへの良いユーザー指示の例:

  • 「'foundation models in biomedicine' に関するOA論文を3つ見つけ、その中で最も良いものの導入部を抽出して要約してください。」

  • 「'Graph Neural Networks survey 2024' を検索し、可能であればOAにフィルタリングしてから、PDFテキストを取得し、10個の箇条書きで要約を作成してください。」

ツール呼び出しペイロードの例

MCPクライアントによって構造は異なりますが、コアとなるペイロードは以下の通りです:

// Search titles
{
  "name": "unpaywall_search_titles",
  "arguments": {
    "query": "graph neural networks survey",
    "is_oa": true,
    "page": 1
  }
}
// Get best OA links for a DOI
{
  "name": "unpaywall_get_fulltext_links",
  "arguments": {
    "doi": "10.48550/arXiv.1812.08434"
  }
}
// Fetch and extract PDF text (by DOI)
{
  "name": "unpaywall_fetch_pdf_text",
  "arguments": {
    "doi": "10.48550/arXiv.1812.08434",
    "truncate_chars": 20000
  }
}

MCPクライアントでの設定

npm/npxを使用するClaude Desktop向けの推奨(ビルド不要)設定:

{
  "mcpServers": {
    "unpaywall": {
      "command": "npx",
      "args": ["-y", "unpaywall-mcp"],
      "env": {
        "UNPAYWALL_EMAIL": "you@example.com"
      }
    }
  }
}

コンパイル済みのdistを使用する代替(ローカルリポジトリ)設定:

{
  "mcpServers": {
    "unpaywall": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"],
      "env": {
        "UNPAYWALL_EMAIL": "you@example.com"
      }
    }
  }
}

追加後、クライアントにツールをリストアップさせ、以下を試してください:

  • query を指定した unpaywall_search_titles

  • doi を指定した unpaywall_get_fulltext_links

  • doi(または pdf_url)を指定した unpaywall_fetch_pdf_text

注意事項

  • Unpaywallのレート制限と利用ガイドラインを尊重してください: https://unpaywall.org/products/api

  • サーバーはstdioトランスポートと @modelcontextprotocol/sdk を使用します。

  • UNPAYWALL_EMAIL を設定するか、呼び出しごとに email を渡して、Unpaywallが利用状況について連絡できるようにしてください。

メンテナー向け: npmへの公開

# 1) Build the project (also runs automatically on publish)
npm run build

# 2) Bump version (choose patch/minor/major)
npm version patch

# 3) Publish (ensure you are logged in: npm login)
npm publish --access public

# 4) Tag a release on GitHub (optional, recommended)

ユーザーは上記のように npx -y unpaywall-mcp を使用してMCPクライアントを設定できます。クローンやビルドは不要です。

Available Tools

4 tools
unpaywall_fetch_pdf_textA

Download and extract text from best OA PDF for a DOI, or from a provided PDF URL.

ParametersJSON Schema
NameRequiredDescriptionDefault
doiNoDOI string or DOI URL. Used if pdf_url is not provided.
pdf_urlNoDirect PDF URL to download and parse (takes precedence over DOI).
emailNoEmail to identify requests to Unpaywall (required when resolving via DOI).
truncate_charsNoMax characters of extracted text to return (default 20000).

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions key behaviors like downloading, extracting text, and precedence rules, but lacks details on error handling, rate limits, authentication needs (beyond the email parameter), or what 'best OA PDF' means. This provides basic context but is incomplete for a tool with potential external dependencies.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Download and extract text') and includes essential qualifiers. Every word earns its place, with no wasted text, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides basic purpose and parameter context but lacks completeness. It doesn't explain return values (e.g., text format, error responses) or behavioral details like rate limits, which are important for a tool interacting with external services. This is adequate but has clear gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional semantic meaning beyond what's in the schema (e.g., it doesn't explain format details or usage nuances). This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Download and extract text') and the resource ('best OA PDF for a DOI, or from a provided PDF URL'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'unpaywall_get_fulltext_links' which might provide links rather than extracted text, so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning alternatives ('DOI, or from a provided PDF URL') and precedence rules ('pdf_url takes precedence over DOI'), but it doesn't explicitly state when to use this tool vs. siblings like 'unpaywall_get_by_doi' or provide clear exclusions. This leaves some ambiguity in tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

unpaywall_get_by_doiA

Fetch Unpaywall metadata for a DOI (accepts DOI, DOI URL, or 'doi:' prefix). Requires an email address via env UNPAYWALL_EMAIL or the optional 'email' argument.

ParametersJSON Schema
NameRequiredDescriptionDefault
doiYesDOI string or DOI URL, e.g. 10.1038/nphys1170 or https://doi.org/10.1038/nphys1170
emailNoEmail to identify your requests to Unpaywall (optional override)

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool requires an email address (via env or argument) for identification to Unpaywall, implying authentication needs. However, it lacks details on rate limits, error handling, or response format, leaving gaps in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with two sentences that efficiently convey purpose, input formats, and requirements without any wasted words. Every sentence adds essential information, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers authentication needs and input formats but lacks details on output (metadata structure), error cases, or performance constraints, which would be helpful for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds minimal value beyond the schema by mentioning the 'doi:' prefix as an accepted format and noting the email requirement, but does not provide additional syntax or usage details for parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Fetch Unpaywall metadata') and resource ('for a DOI'), distinguishing it from sibling tools like fetching PDF text or searching titles. It specifies the exact input formats accepted (DOI, DOI URL, or 'doi:' prefix), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool (for fetching metadata by DOI) and mentions an alternative (using the 'email' argument vs. env variable), but does not explicitly state when not to use it or differentiate from siblings like 'unpaywall_get_fulltext_links' beyond the metadata focus.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

unpaywall_search_titlesA

Search Unpaywall for article titles matching a query. Supports optional is_oa filter and pagination (50 results per page).

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesTitle search query (supports phrase, boolean operators per Unpaywall docs)
is_oaNoIf true, only return OA results; if false, only closed; omit for all
pageNoPage number (50 results per page)
emailNoEmail to identify your requests to Unpaywall (optional override)

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'Supports optional is_oa filter and pagination (50 results per page)', which provides useful operational context about filtering capabilities and pagination behavior. However, it doesn't address important behavioral aspects like rate limits, authentication requirements (beyond the optional email parameter), error conditions, or what the search results actually contain.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (two sentences) and front-loaded with the core purpose. Every sentence earns its place: the first establishes what the tool does, and the second provides key operational context about filters and pagination. There's zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 4 parameters, 100% schema coverage, and no output schema, the description provides adequate but minimal context. It covers the basic purpose and mentions key operational features (filtering, pagination), but doesn't explain what the search results contain, how comprehensive the search is, or any limitations. Given the lack of annotations and output schema, more completeness would be helpful for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already fully documents all 4 parameters. The description adds minimal value beyond what's in the schema - it mentions the optional is_oa filter and pagination (50 results per page), but these are already clearly documented in the parameter descriptions. The baseline score of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search Unpaywall for article titles matching a query') and specifies the resource ('article titles'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its siblings (unpaywall_fetch_pdf_text, unpaywall_get_by_doi, unpaywall_get_fulltext_links), which appear to have different functions but could potentially overlap in some search contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through 'Search Unpaywall for article titles matching a query' and mentions optional filters/pagination, but doesn't explicitly state when to use this tool versus alternatives like unpaywall_get_by_doi (for DOI-based lookups) or unpaywall_get_fulltext_links (for link retrieval). No explicit when-not-to-use guidance or prerequisite information is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updates
    • First observedunpaywall_fetch_pdf_text
    • First observedunpaywall_get_by_doi
    • First observedunpaywall_get_fulltext_links
    • First observedunpaywall_search_titles

TDQS

A4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: fetching PDF text, retrieving metadata, getting fulltext links, and searching titles. There is no overlap in functionality, making it easy for an agent to select the right tool for a specific task.

Naming Consistency5/5

All tools follow a consistent 'unpaywall_verb_noun' pattern, such as unpaywall_fetch_pdf_text and unpaywall_search_titles. This uniformity enhances readability and predictability across the toolset.

Tool Count5/5

With 4 tools, the server is well-scoped for handling Unpaywall-related operations, covering key actions like metadata retrieval, text extraction, link fetching, and title search without being overly sparse or bloated.

Completeness4/5

The toolset covers essential CRUD-like operations for accessing open-access content, including fetching, searching, and retrieving links. A minor gap might be the lack of update or delete tools, but this is reasonable given the server's read-only nature for external data.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    F
    maintenance
    Enables real-time search and retrieval of academic paper information from multiple sources, providing access to paper metadata, abstracts, and full-text content when available, with structured data responses for integration with AI models that support tool/function calling.
    3
    116
    AGPL 3.0
  • A
    license
    A
    quality
    D
    maintenance
    Enables academic research through the OpenAlex API, allowing users to search for papers, authors, and institutions, retrieve citations, and fetch full-text content when available. Perfect for building intelligent research assistants that can explore academic literature and related works.
    8
    7
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables looking up free-to-read versions of scholarly papers by DOI and searching article titles for Open Access matches via the Unpaywall API.
    2
    1
    -