学术论文检索服务

一个提供从6大学术资源实时获取科学论文的MCP服务器,支持论文搜索、全文提取和引用分析等功能。

  • by luozhy88
  • R
  • 本地部署
  • 更新于
在 GitHub 查看 luozhy88/scientific.papers.mcp

使用说明

科学论文收割机MCP服务器

一个全面的模型上下文协议(MCP)服务器,为LLM提供实时访问来自 6主要学术来源:arXiv、OpenAlex、PMC(PubMed Central)、欧洲PMC、bioRxiv/medRxiv和CORE。

🚀 特性

全面的来源覆盖

  • arXiv:计算机科学、物理、数学预印本和论文
  • OpenAlex:包含引文数据的开放式学术论文目录
  • 私人军事公司:PubMed中央生物医学和生命科学文献
  • 欧洲PMC:欧洲生命科学文献数据库
  • 生物Rxiv/medRxiv:生物学和医学预印本服务器
  • 核心:世界上最大的开放获取研究论文集

高性能

  • 取纸:按类别/概念从任何来源获取最新论文
  • 论文搜索:在4个主要来源中按标题、摘要、作者或全文搜索论文
  • 全文提取:使用智能回退策略提取完整的文本内容
  • 引文分析:查找OpenAlex自特定日期以来被引用最多的论文
  • 纸张查找:按ID检索特定论文的完整元数据
  • 类别发现:浏览所有来源的可用类别
  • 智能速率限制:尊重API使用,每个源速率限制
  • DOI决议:带Unpaywall的高级DOI解析器→ Crossref→ 语义学者回退
  • 双接口:MCP协议和CLI访问
  • TypeScript:配备ESM模块的全类型安全

📊 覆盖率统计

  • 总来源:6个学术数据库
  • 类别覆盖范围:所有学科100多个类别
  • 纸张存取:2亿多篇论文,具有智能文本提取功能
  • 文本提取成功:支持的纸张类型>90%
  • 响应时间:取纸平均时间<15秒

🛠 安装

npm install
npm run build

📋 MCP客户端配置

要将此服务器与MCP客户端(如Claude Desktop)一起使用,请在MCP客户端配置中添加以下内容:

对于已发布的包(可在npm上获得):

选项1:使用npx(推荐用于Claude等AI工具)

{
  "mcpServers": {
    "scientific-papers": {
      "command": "npx",
      "args": [
        "-y",
        "@futurelab-studio/latest-science-mcp@latest"
      ]
    }
  }
}

选项2:全局安装

npm install -g @futurelab-studio/latest-science-mcp

然后配置:

{
  "mcpServers": {
    "scientific-papers": {
      "command": "latest-science-mcp"
    }
  }
}

📖 用法

CLI接口

列表类别

# List arXiv categories
node dist/cli.js list-categories --source=arxiv

# List OpenAlex concepts
node dist/cli.js list-categories --source=openalex

# List PMC biomedical categories
node dist/cli.js list-categories --source=pmc

# List Europe PMC life science categories
node dist/cli.js list-categories --source=europepmc

# List bioRxiv/medRxiv categories (includes both servers)
node dist/cli.js list-categories --source=biorxiv

# List CORE academic categories
node dist/cli.js list-categories --source=core

获取最新论文

# Get latest AI papers from arXiv
node dist/cli.js fetch-latest --source=arxiv --category=cs.AI --count=10

# Get latest biology papers from bioRxiv
node dist/cli.js fetch-latest --source=biorxiv --category="biorxiv:biology" --count=5

# Get latest immunology papers from PMC
node dist/cli.js fetch-latest --source=pmc --category=immunology --count=3

# Get latest papers from CORE by subject
node dist/cli.js fetch-latest --source=core --category=computer_science --count=5

# Search by concept name (OpenAlex)
node dist/cli.js fetch-latest --source=openalex --category="machine learning" --count=3

获取被引用最多的论文

# Get top 20 cited papers in machine learning since 2024
node dist/cli.js fetch-top-cited --concept="machine learning" --since=2024-01-01 --count=20

# Get top cited papers by concept ID
node dist/cli.js fetch-top-cited --concept=C41008148 --since=2023-06-01 --count=10

搜索论文

# Search by keywords across all fields
node dist/cli.js search-papers --source=arxiv --query="machine learning" --count=10

# Search by paper title
node dist/cli.js search-papers --source=openalex --query="neural networks" --field=title --count=5

# Search by author name
node dist/cli.js search-papers --source=europepmc --query="John Smith" --field=author --count=10

# Search full-text content sorted by citations
node dist/cli.js search-papers --source=core --query="climate change" --field=fulltext --sortBy=citations --count=20

获取特定纸张内容

# Get arXiv paper by ID
node dist/cli.js fetch-content --source=arxiv --id=2401.12345

# Get bioRxiv paper by DOI
node dist/cli.js fetch-content --source=biorxiv --id="10.1101/2021.01.01.425001"

# Get PMC paper by ID
node dist/cli.js fetch-content --source=pmc --id=PMC8245678

# Get CORE paper by ID
node dist/cli.js fetch-content --source=core --id=12345678

# Show text content with preview
node dist/cli.js fetch-content --source=arxiv --id=2401.12345 --show-text --text-preview=500

🔧 可用工具

list_categories

列出任何数据源中的可用类别/概念。

参数:

  • source: "arxiv" | "openalex" | "pmc" | "europepmc" | "biorxiv" | "core"

退货:

  • 类别对象数组 id, name,可选 description

示例:

{
  "name": "list_categories",
  "arguments": {
    "source": "biorxiv"
  }
}

fetch_latest

从任何来源获取给定类别的最新论文 仅元数据 (无文本提取)。

参数:

  • source: "arxiv" | "openalex" | "pmc" | "europepmc" | "biorxiv" | "core"
  • category:类别ID或概念名称(因来源而异)
  • count:要获取的纸张数量(默认值:50,最大值:200)

按来源分类的示例:

  • arXiv: "cs.AI", "physics.gen-ph", "math.CO"
  • OpenAlex: "artificial intelligence", "machine learning", "C41008148"
  • 私人军事公司: "immunology", "genetics", "neuroscience"
  • 欧洲PMC: "biology", "medicine", "cancer"
  • 生物Rxiv/medRxiv: "biorxiv:neuroscience", "medrxiv:psychiatry"
  • 核心: "computer_science", "mathematics", "physics"

退货:

  • 包含元数据(id、标题、作者、日期、pdf_url)的论文对象数组
  • 文本字段:空字符串(text: "")-使用 fetch_content 全文

fetch_top_cited

从OpenAlex获取自特定日期以来给定概念的最高引用论文。

参数:

  • concept:概念名称或OpenAlex概念ID
  • since:YYYY-MM-DD格式的开始日期
  • count:要获取的纸张数量(默认值:50,最大值:200)

search_papers

使用特定领域的搜索和排序选项在多个学术来源中搜索论文。

参数:

  • source: "arxiv" | "openalex" | "europepmc" | "core"
  • query:搜索查询字符串(最多1500个字符)
  • field: "all" | "title" | "abstract" | "author" | "fulltext" (默认值:“全部”)
  • count:要返回的结果数(默认值:50,最大值:200)
  • sortBy: "relevance" | "date" | "citations" (默认:“相关性”)

按来源搜索功能:

  • arXiv:使用布尔运算符进行标题、摘要、作者和一般搜索
  • OpenAlex:具有相关性评分和引文排序的高级搜索
  • 欧洲PMC:使用MeSH术语和全文搜索的生物医学文献
  • 核心:具有高级查询语言的全球学术论文

查询示例:

  • 关键词: "machine learning", "climate change"
  • 短语: "artificial intelligence" (使用引号表示确切的短语)
  • 布尔值: "deep learning AND neural networks" (arXiv支持此功能)
  • 作者: "John Smith", "Smith J"

退货:

  • 包含元数据(id、标题、作者、日期、pdf_url)的论文对象数组
  • 文本字段:空字符串(text: "")-使用 fetch_content 全文

fetch_content

通过ID获取特定论文的完整元数据和文本内容 完整文本提取.

参数:

  • source:6个支持的来源中的任何一个
  • id:纸张ID(格式因来源而异)

按来源列出的ID格式:

  • arXiv: "2401.12345", "cs/0601001", "1234.5678v2"
  • OpenAlex: "W2741809807" 或数字 2741809807
  • 私人军事公司: "PMC8245678" 或 "12345678"
  • 欧洲PMC: "PMC8245678", "12345678",或DOI
  • 生物Rxiv/medRxiv: "10.1101/2021.01.01.425001" 或 "2021.01.01.425001"
  • 核心:类似数字ID "12345678"

📄 纸张元数据格式

所有工具返回具有以下结构的纸张对象:

{
  id: string;                    // Paper ID
  title: string;                 // Paper title
  authors: string[];             // List of author names
  date: string;                  // Publication date (ISO format)
  pdf_url?: string;              // PDF URL (if available)
  text: string;                  // Extracted full text content
  textTruncated?: boolean;       // Warning: text was truncated due to size limits
  textExtractionFailed?: boolean; // Warning: text extraction failed
}

🧠 高级文本提取

多源战略

每个来源都有专门的文本提取方法:

  • arXiv:HTML来自 arxiv.org/html 随着 ar5iv.labs.arxiv.org 后备方案
  • OpenAlex:带有DOI解析器回退链的HTML源代码
  • 私人军事公司:具有XML/HTML提取功能的电子实用程序API
  • 欧洲PMC:具有多种URL策略的REST API
  • 生物Rxiv/medRxiv:使用抽象回退进行直接HTML提取
  • 核心:PDF/HTML,源URL回退

DOI解析链

具有多种回退策略的高级DOI解析器:

  1. 未付费墙 → 免费全文资源
  2. Crossref → 发布者元数据和链接
  3. 语义学者学术图谱 → 替代访问

性能和可靠性

  • 文本提取成功:HTML可用论文>90%
  • 故障弱化:即使文本提取失败,也始终返回元数据
  • 尺寸管理:6MB文本限制,智能截断
  • 缓存:24小时LRU缓存用于DOI解析

🔄 速率限制

尊重API使用,每个源速率限制:

  • arXiv:每分钟5个请求
  • OpenAlex:每分钟10个请求
  • 私人军事公司:每秒3个请求
  • 欧洲PMC:每分钟10个请求
  • 生物Rxiv/medRxiv:每分钟5个请求
  • 核心:每分钟10个请求(公共),API密钥更高

CORE API配置

要增强CORE访问,请设置环境变量:

export CORE_API_KEY="your-api-key"

🧪 测试

运行测试套件

# Run all tests
npm test

# Run integration tests
npm run test -- tests/integration

# Run end-to-end workflow tests
npm run test -- tests/e2e

# Run performance benchmarks
npm run test -- tests/integration/performance.test.ts

测试覆盖率

  • 集成测试:所有6个源端到端测试
  • 性能测试:响应时间和吞吐量基准
  • 工作流测试:跨多个来源的真实研究场景
  • 单元测试:核心组件和边缘案例

🏗 建筑

模块化驱动系统

  • 源头之间的清洁隔离
  • 所有驱动程序的一致界面
  • 每个源的专门文本提取

高级功能

  • DOI决议:多提供商回退链
  • 速率限制:每个源的令牌桶算法
  • 文本处理:HTML清理和规范化
  • 错误处理:有条理的回应和可操作的建议
  • 缓存:用于DOI解析的智能缓存

技术栈

  • TypeScript+ESM:具有完全类型安全的现代JavaScript
  • 模块化设计:明确区分关注点
  • 故障弱化:即使部分故障,也始终正常工作
  • 响应大小管理:自动截断和警告

📊 来源比较

来源 论文 学科 全文 引文数据 预印本 搜索
arXiv 2.3M+ STEM HTML✓ 有限 ✓ ✓✓✓
OpenAlex 200M+ 全部 可变 ✓✓✓ ✓ ✓✓✓
PMC 7M+ 生物医学 XML/HTML✓ 有限 ✗ 有限
欧洲PMC 4000万+ 生命科学 HTML✓ 有限 ✓ ✓✓✓
bioRxiv/medRxiv 500K+ 生物/医学 HTML✓ 有限 ✓✓✓ 有限
核心 200M+ 全部 PDF/HTML✓ 有限 ✓ ✓✓✓

🔧 发展

构建

npm run build

测试单个来源

# Test specific sources
node dist/cli.js list-categories --source=arxiv
node dist/cli.js fetch-latest --source=biorxiv --category="biorxiv:biology" --count=3
node dist/cli.js fetch-content --source=core --id=12345678

# Test search functionality
node dist/cli.js search-papers --source=arxiv --query="artificial intelligence" --count=5
node dist/cli.js search-papers --source=openalex --query="quantum computing" --field=title --count=3

性能测试

# Run performance benchmarks
npm run test -- tests/integration/performance.test.ts

# Test memory usage
npm run test -- --reporter=verbose

🚨 错误处理

针对所有来源的全面错误处理:

  • 格式建议的纸张ID无效
  • 信息后重试的速率限制
  • API超时和服务器错误
  • 缺少身份验证(CORE API密钥)
  • 网络连接问题
  • 采用回退策略的文本提取失败

🔍 故障排除

常见问题

  • 速率限制:使用指数回退自动重试
  • 丢失的文件:尝试相同内容的其他来源
  • 文本提取失败:回退到抽象或元数据
  • CORE API限值:设置 CORE_API_KEY 环境变量

性能优化

  • 使用适当 count 参数(更小,响应更快)
  • 尽可能缓存结果
  • 使用 fetch_latest 为了发现, fetch_content 详细阅读

📝 许可证

麻省理工学院


准备好探索世界科学知识了吗?从6个来源中的任何一个开始,发现所有学科的论文! 🔬📚