Unpaywall MCP Server
Unpaywall MCP Server
Сервер MCP (Model Context Protocol), предоставляющий инструменты Unpaywall, чтобы ИИ-клиенты могли:
Получать метаданные по DOI
Искать по названиям статей
Получать лучшие ссылки на полные тексты в открытом доступе (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
Описание: Получение метаданных Unpaywall для DOI
Схема входных данных:
doi(строка, обязательно): например,10.1038/nphys1170email(строка, опционально): переопределяетUNPAYWALL_EMAIL, если указан
Выходные данные: JSON-ответ от Unpaywall
unpaywall_search_titles
Описание: Поиск по названиям статей и возврат метаданных OA в стиле Unpaywall для каждого совпадения (50 результатов на страницу)
Схема входных данных:
query(строка, обязательно): поисковый запрос по названиюis_oa(логическое, опционально): если true, только результаты в открытом доступе; если false, только закрытые; пропустите для всехpage(целое число >= 1, опционально): номер страницыemail(строка, опционально): переопределяетUNPAYWALL_EMAIL
Выходные данные: JSON, соответствующий формату поиска Unpaywall —
results[].responseявляется записью в стиле DOI (doi,title,is_oa,oa_status,best_oa_location,oa_locations), сscoreиsnippetдля каждого результата._source: "openalex"указывает на источник.Примечание: Работает на базе эндпоинта
/worksот OpenAlex, так как собственный/v2/searchот Unpaywall возвращает HTTP 500 с момента обновления в мае 2025 года. Unpaywall теперь работает как подпрограмма OpenAlex, поэтому это канонический современный эквивалент.
unpaywall_get_fulltext_links
Описание: Возврат лучшего URL PDF в открытом доступе и Open URL для DOI, а также всех локаций OA
Схема входных данных:
doi(строка, обязательно)email(строка, опционально): переопределяетUNPAYWALL_EMAIL
Выходные данные: JSON с полями:
best_pdf_url,best_open_url,best_oa_location,oa_locationsи избранными метаданными
unpaywall_fetch_pdf_text
Описание: Скачивание и извлечение текста из лучшего PDF в открытом доступе для DOI или из предоставленного
pdf_urlСхема входных данных:
pdf_url(строка, опционально): прямой URL PDF (имеет приоритет)doi(строка, опционально): используется для определения лучшего PDF в открытом доступе, еслиpdf_urlне предоставленemail(строка, опционально): требуется при использованииdoiи отсутствии переменной окруженияUNPAYWALL_EMAILtruncate_chars(целое число >= 1000, опционально): максимальное количество символов извлеченного текста для возврата (по умолчанию 20000)
Выходные данные: JSON с
text(возможно, обрезанным),length_chars,truncated,pdf_urlи метаданными PDF
Советы по промптингу LLM (MCP)
При использовании этого сервера из LLM-клиента с поддержкой MCP, попросите модель:
Сначала искать, потом получать: Используйте
unpaywall_search_titlesс кратким названием; выберите результат; затем вызовитеunpaywall_get_fulltext_linksилиunpaywall_fetch_pdf_textдля выбранного DOI.Предпочитать OA: Передавайте
is_oa: trueв поиске, если вам нужны только материалы в открытом доступе.Контролировать размер: Установите
truncate_charsвunpaywall_fetch_pdf_text(по умолчанию 20000) и суммируйте длинные тексты перед продолжением.Быть устойчивой: Если лучший URL PDF отсутствует, переходите к
best_open_urlи извлекайте контент с целевой страницы (вне этого сервера).Соблюдать лимиты запросов: Делайте паузы между запросами, если их много; повторно используйте предыдущие ответы вместо повторения того же вызова.
Хорошие инструкции для LLM:
"Найди 3 статьи в открытом доступе о 'фундаментальных моделях в биомедицине', затем извлеки и суммируй введение лучшей из них."
"Найди 'обзор графовых нейронных сетей 2024', отфильтруй по открытому доступу, если возможно, затем получи текст 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-клиенте
Рекомендуемая конфигурация (без сборки) для Claude Desktop с использованием npm/npx:
{
"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"
}
}
}
}После добавления попросите клиент вывести список инструментов и попробуйте:
unpaywall_search_titlesс параметромqueryunpaywall_get_fulltext_linksс параметромdoiunpaywall_fetch_pdf_textс параметромdoi(илиpdf_url)
Примечания
Соблюдайте лимиты запросов и правила использования 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)Пользователи смогут настроить свой MCP-клиент с помощью npx -y unpaywall-mcp, как показано выше. Клонирование или сборка не требуются.
Available Tools
4 toolsunpaywall_fetch_pdf_textA
Download and extract text from best OA PDF for a DOI, or from a provided PDF URL.
| Name | Required | Description | Default |
|---|---|---|---|
| doi | No | DOI string or DOI URL. Used if pdf_url is not provided. | |
| pdf_url | No | Direct PDF URL to download and parse (takes precedence over DOI). | |
| No | Email to identify requests to Unpaywall (required when resolving via DOI). | ||
| truncate_chars | No | Max characters of extracted text to return (default 20000). |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| doi | Yes | DOI string or DOI URL, e.g. 10.1038/nphys1170 or https://doi.org/10.1038/nphys1170 | |
| No | Email to identify your requests to Unpaywall (optional override) |
TDQS
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.
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.
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.
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.
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.
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_get_fulltext_linksA
Given a DOI, return best open-access links (best PDF URL and open URL) plus Unpaywall locations metadata.
| Name | Required | Description | Default |
|---|---|---|---|
| doi | Yes | DOI string or DOI URL | |
| No | Email to identify your requests to Unpaywall (optional override) |
TDQS
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 describes what the tool returns (links and metadata) but does not mention rate limits, authentication needs (though 'email' is optional), error handling, or data freshness. It adds basic context but lacks details on operational traits like performance or constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core functionality ('return best open-access links') and includes key details (PDF URL, open URL, metadata) without waste. Every word earns its place, 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.
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 reasonably complete. It specifies the input (DOI) and output (links and metadata), but without an output schema, it could benefit from more detail on return values (e.g., structure or examples). It covers the essentials but has minor gaps in output clarification.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 ('doi' as required string and 'email' as optional override). The description adds no additional meaning beyond what the schema provides, such as format examples or usage tips for parameters. Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('return best open-access links') and resource ('given a DOI'), distinguishing it from siblings like 'unpaywall_fetch_pdf_text' (which extracts text) and 'unpaywall_search_titles' (which searches titles). It explicitly mentions the output includes 'best PDF URL and open URL' plus metadata, making the purpose highly specific and differentiated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying 'given a DOI' for retrieving open-access links, but it does not explicitly state when to use this tool versus alternatives like 'unpaywall_get_by_doi' (which might return different data) or 'unpaywall_fetch_pdf_text' (which focuses on text extraction). It provides clear context but lacks explicit exclusions or named alternatives.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Title search query (supports phrase, boolean operators per Unpaywall docs) | |
| is_oa | No | If true, only return OA results; if false, only closed; omit for all | |
| page | No | Page number (50 results per page) | |
| No | Email to identify your requests to Unpaywall (optional override) |
TDQS
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.
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.
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.
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.
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.
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.
4 tool updates
- First observed
unpaywall_fetch_pdf_text - First observed
unpaywall_get_by_doi - First observed
unpaywall_get_fulltext_links - First observed
unpaywall_search_titles
TDQS
Scored across 4 tools
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.
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.
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.
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
Related MCP Connectors
Unpaywall MCP — open-access lookup for scholarly papers (free, no key)
Academic literature search, retrieval, and private library management on top of OpenAlex.
Find research papers and arXiv preprints, and get an abstract and free full text from a DOI or id.
Scrape arXiv, OpenAlex and Crossref papers by author, topic, journal or DOI. Pay per row.
Related MCP Servers
- AlicenseCqualityFmaintenanceEnables 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.3116AGPL 3.0
- AlicenseAqualityDmaintenanceEnables 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.87MIT
- AlicenseAqualityDmaintenanceEnables querying open-access availability of scholarly articles via Unpaywall API, including DOI lookup, title search, and citation export.417 PyPIMIT
- FlicenseAqualityDmaintenanceEnables looking up free-to-read versions of scholarly papers by DOI and searching article titles for Open Access matches via the Unpaywall API.21-