Skip to main content
Glama
pastchais

Academic Paper MCP HTTP/SSE Server

by pastchais

学术论文 MCP HTTP/SSE 服务

一个用于学术文献检索的 HTTP/SSE 服务,基于 Model Context Protocol (MCP)。聚合 arXiv、Crossref、OpenAlex、PubMed、Semantic Scholar(可选:Google Scholar via SerpApi)等数据源,向 AI 助手与应用提供标准化的检索、详情、引用、趋势与推荐能力。

目录速览:快速开始|API 概览|SSE 用法|环境变量|Docker|示例

功能特性

  • REST API 与 SSE(MCP)双协议,易于集成

  • 学科智能选择:根据研究领域自动选择最优数据源组合

  • 多数据源聚合:支持13+学术数据库(免费+付费)

  • 开放获取支持:自动查找论文的合法OA版本

  • 开箱即用的 CORS 与简洁的请求体设计

  • TypeScript 编写,构建产物位于 dist/

  • 提供 Docker 与 Compose 部署脚本

支持的数据源

免费数据源(开箱即用):

  • arXiv - 物理、数学、计算机科学预印本

  • Crossref - DOI元数据和引用

  • OpenAlex - 跨学科开放索引

  • PubMed - 生物医学文献

  • Semantic Scholar - AI驱动的学术搜索

  • DBLP - 计算机科学文献

  • Europe PMC - 欧洲生命科学全文

  • bioRxiv/medRxiv - 生物医学预印本

需注册但免费:

  • CORE - 开放获取聚合器(需API Key)

  • Unpaywall - OA版本查找(只需邮箱)

付费/订阅数据源(可选):

  • IEEE Xplore - 电子工程 (TODO)

  • ACM Digital Library - 计算机科学(TODO)

  • Springer - 跨学科(TODO)

  • Web of Science - 引文索引(TODO)

  • Scopus - 全面覆盖(TODO)

  • JSTOR - 人文社科(TODO)

  • Google Scholar - 通过SerpAPI

主要工具(Tools)

搜索功能:

  • search_papers:智能跨源检索(支持学科自动选择)

  • search_papers_by_discipline:按学科搜索并自动选择数据源

  • search_papers_by_author:按作者检索

  • search_papers_by_journal:按期刊检索

  • search_papers_by_conference:按会议检索

论文信息:

  • get_paper_details:论文详情

  • get_citation_info:引用/被引信息

  • get_recommended_papers:相关推荐

  • get_open_access_link:查找OA版本

趋势分析:

  • get_research_trends:研究趋势

  • get_recent_papers:最新论文

  • search_influential_papers:高影响力论文

Prompts(研究助手)

research-advisorliterature-finderresearch-plantrend-analysispaper-comparison

快速开始

本地运行(Node.js ≥ 18):

npm install
npm run build
npm start
# 服务启动于 http://localhost:3000

健康检查与基本验证:

curl http://localhost:3000/health

curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "machine learning", "max_results": 5}'

更多脚本:npm run dev(编译后直启)、npm run watch(监听编译)、npm test(示例 API 测试)。

API 概览(HTTP)

基础路由:

  • GET /:服务信息

  • GET /health:健康检查

  • GET /sse:建立 SSE(MCP)连接

REST 路由:

  • POST /api/search:关键字检索(支持 disciplineauto_detect_disciplinesourcesmax_results

  • POST /api/search/author:作者检索(author_name,可选 sourcedisciplinemax_results

  • POST /api/paper:论文详情(paper_idsource

  • POST /api/citations:引用信息(paper_id,可选 sourcemax_results

  • POST /api/recommendations:相关推荐(paper_id,可选 sourcemax_results

  • POST /api/trends:研究趋势(field,可选 sourcemax_results

  • POST /api/recent:近期论文(topic,可选 dayssourcemax_results

  • POST /api/influential:高影响力论文(field,可选 max_results

示例:

# 普通搜索
curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "quantum computing",
    "sources": ["arxiv", "semantic_scholar"],
    "max_results": 5
  }'

# 学科智能搜索(自动选择数据源)
curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "machine learning",
    "discipline": "machine_learning",
    "max_results": 10
  }'

# 自动检测学科
curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "CRISPR gene editing",
    "auto_detect_discipline": true,
    "max_results": 10
  }'

更多示例与字段说明见:HTTP_API_GUIDE.mdAPI_REFERENCE.mdexamples/

SSE(MCP)用法

建立连接:

const es = new EventSource('http://localhost:3000/sse');
es.onmessage = (e) => {
  console.log('event', e.data);
  // 首次消息中可获取并保存会话信息(如 sessionId)
};

发送消息:使用 POST /sse?sessionId=...,请求体为 MCP 请求消息(例如调用工具)。具体消息格式与示例,请参考 HTTP_API_GUIDE.md

提示:服务端会为每个 SSE 连接维护会话,需在同一 sessionId 下以 POST 发送后续消息。

环境变量

复制模板并按需填写:

cp env-template .env

可用变量(均为可选):

  • PORT(默认 3000

  • HOST(默认 0.0.0.0

  • CORS_ENABLED(默认开启)

基础数据源(推荐配置):

  • OPENALEX_EMAIL(强烈推荐,用于提升 OpenAlex 响应质量)

  • PUBMED_API_KEY(提高 PubMed 速率上限)

  • SEMANTIC_SCHOLAR_API_KEY(提高速率上限)

  • UNPAYWALL_EMAIL(查找OA版本,强烈推荐)

  • CORE_API_KEY(开放获取聚合器,免费注册)

可选数据源:

  • SERPAPI_KEY(启用 Google Scholar,付费服务)

  • IEEE_API_KEY(电子工程,需订阅)

  • ACM_API_KEY(计算机科学,需订阅)

  • SPRINGER_API_KEY(跨学科)

  • WOS_API_KEY(Web of Science,需机构订阅)

  • SCOPUS_API_KEY(Scopus,需订阅)

  • JSTOR_API_KEY(人文社科,需订阅)

详见:API_KEY_GUIDE.md

Docker/Compose

使用 Compose:

npm run compose:up      # 启动
npm run compose:logs    # 查看日志
npm run compose:restart # 重启
npm run compose:down    # 停止

本地镜像:

npm run docker:build
npm run docker:run
# 其他:docker:stop / docker:logs / docker:restart / docker:remove

示例与测试

  • examples/http-api-examples.js|py|sh:HTTP API 示例

  • test-http-api.js:简单连通性与接口演示(npm test

  • 进一步指引:HTTP_QUICKSTART.mdHOW_TO_TEST.md

目录结构(简要)

  • src/clients/:数据源客户端(arXiv/Crossref/OpenAlex/PubMed/Semantic Scholar/Google Scholar)

  • src/tools/:MCP 工具注册与实现

  • src/prompts/:MCP Prompt 定义

  • src/index.ts:HTTP/SSE 服务入口

  • examples/:调用示例

许可证

MIT License

A
license - permissive license
-
quality - not tested
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pastchais/academic-paper-mcp-http'

If you have feedback or need assistance with the MCP directory API, please join our Discord server