Skip to main content
Glama
ZhaoXiTurtle

baidu-scholar-mcp

by ZhaoXiTurtle

baidu-scholar-mcp

百度学术论文查询 MCP server:输入论文标题(支持部分标题/关键词)→ 搜索候选列表 → 调用方大模型挑选 → 返回该论文完整详情。

  • 纯标准库实现 stdio JSON-RPC,不依赖任何 MCP SDK,运行时仅需 curl-cffi

  • 内置反爬自愈:Chrome TLS 指纹模拟(curl_cffi)+ cookie 自举 + 多级重试,无需浏览器

  • 自带两套自测(爬虫 13 项 + MCP 协议 8 项),拿到代码一键验证环境可用性

⚠️ 免责声明:本项目为非官方工具,基于对百度学术公开网页接口的逆向分析实现, 仅供个人学习与研究使用。使用时请遵守目标网站的服务条款,禁止用于商业用途或高频抓取。 百度接口随时可能变更,不保证本工具持续可用;因使用本工具产生的任何问题由使用者自行承担。

MCP 工具

工具

说明

search_papers(query, max_results=10)

按标题搜索,返回候选列表:paperid、标题、作者+机构、年份、期刊卷期页、被引、关键词、截断摘要、知网/万方/维普等来源链接。恰好只命中 1 篇时自动附带 paper_detail

get_paper_detail(paperid)

完整摘要、关键词、作者、期刊(卷/期/页码/ISSN/CN)、被引、DOI、基金、阅读量、研究领域、全部外部全文链接

get_paper_citations(paperid, cite_type)

参考文献(reference)/ 引证文献(citation)列表

典型调用流程(由调用方大模型完成"挑选"):search_papers("新技术革命下人工智能与高质量增长") → 从候选里选最匹配的 paperid → get_paper_detail(paperid)

Related MCP server: CNKI MCP Server

安装与配置

方式一:uvx(推荐,零安装)

发布到 PyPI 后,MCP 客户端配置一行即可(uv 会自动拉取并隔离运行):

{
  "mcpServers": {
    "baidu-scholar": { "command": "uvx", "args": ["baidu-scholar-mcp"] }
  }
}

方式二:pip 安装后直接作命令

pip install baidu-scholar-mcp
{ "command": "baidu-scholar-mcp" }

方式三:源码运行

git clone https://github.com/<you>/baidu-scholar-mcp.git
pip install curl-cffi
{
  "command": "<你的python解释器>",
  "args": ["<仓库路径>/baidu_scholar/mcp_server.py"]
}

Windows 注意:Python 3.12+ 无 distutils,若同时安装可选的浏览器兜底依赖 undetected-chromedriver,需先 pip install setuptools

自测

python tests/test_client.py        # 爬虫 13 项检查,应"全部通过"(需联网)
python tests/test_mcp_server.py    # MCP 协议 8 项检查,应"全部通过"

调试时可设环境变量 BAIDU_SCHOLAR_VERBOSE=1 查看过程日志(stderr)。

反爬实现要点

百度学术已全面 SPA 化,数据全走 JSON 接口,本客户端直接调接口(2026-09 逆向实测):

  • 搜索 GET /usercenter/paper/search?type=related&wd=<标题>&rn=20&page_no=N 详情 GET /scholarai/paper/detail/info?paperId=<id> 引文 同搜索接口,wd=citepaperuri:(<id>) / refpaperuri:(<id>)

  • 新版搜索接口 /search/api/search 必须携带混淆 JS 生成的 acs-token,已弃用,上述老接口数据等价。

  • TLS 指纹是核心风控点:python-requests 的 OpenSSL 指纹无论带什么 cookie 都会被 /usercenter 系列接口拒(206 + "请输入验证码"),必须用 curl_cffi impersonate='chrome'

  • cookie 自举无需浏览器:先 GET https://www.baidu.com/ 拿 5 条 Set-Cookie (BAIDUID/BIDUPSID/PSTM 等)即可通过风控;详情接口更宽松,单条 BAIDUID 就够。

  • 风控自愈阶梯:请求被拦 → 重新 cookie 自举重试 → (可选)无头浏览器收割 cookie → 报错。

  • 数据坑已处理:机构字段内嵌 \u0001 分隔符、<em> 高亮标签、"查看全部>>"截断尾巴; 搜索接口摘要服务端截断,完整摘要由详情接口补全。

已知限制

  • 任意乱词百度都会模糊匹配出结果,调用方需自行比对标题相关性。

  • 论文本身没有参考文献/引文数据时,get_paper_citations 返回业务错误 code=1001,属正常现象。

  • 接口为非官方逆向所得,若百度调整风控或字段结构,优先重新抓包核对 baidu_scholar/scholar_client.py 顶部的接口说明。

License

MIT

Available Tools

3 tools
get_paper_citationsA

按 paperid 返回该论文的参考文献(cite_type=reference)或引证文献(cite_type=citation)列表,字段同搜索结果。论文本身无引文数据时会返回业务错误。

ParametersJSON Schema
NameRequiredDescriptionDefault
paperidYes论文 id,来自 search_papers 结果
cite_typeNoreference=参考文献(默认),citation=引证文献reference
max_resultsNo返回条数上限,默认 10,最大 20

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it discloses a genuinely useful behavioral trait: '论文本身无引文数据时会返回业务错误' (returns a business error when the paper has no citation data). It also pins the output shape to search results via '字段同搜索结果'. It does not describe the error's structure or list ordering, but for a simple read-only list tool this is solid coverage.

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?

Two tight sentences: the first front-loads the core function and the cite_type selector, the second captures the important edge case. Every clause earns its place with no filler or repetition of schema content.

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

Completeness4/5

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

For a 3-parameter tool with fully documented schema, no output schema, and no annotations, the description covers the input requirement (paperid), the mode selection (cite_type), the output shape by reference to search results, and the error case. The main gap is that 'fields same as search results' assumes the agent already knows search_papers' return structure, and no detail is given on the business error's format.

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% with paperid, cite_type, and max_results all documented, so the baseline is 3. The description reinforces the cite_type modes (reference/citation) already present in the schema enum and adds the 'fields same as search results' output hint, but adds no materially new parameter-level meaning.

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 states a specific verb and resource: '按 paperid 返回该论文的参考文献...或引证文献...列表' (return the reference/citation list by paperid). It clearly distinguishes itself from siblings search_papers (finding papers by query) and get_paper_detail (single-paper metadata) by centering on the citation relationship of a known paper.

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 opening '按 paperid' establishes the key prerequisite: the caller already has a paper id, and the schema notes paperid comes from search_papers results, implying a follow-up workflow. The cite_type semantics (reference vs citation) are explicit, but the description never names alternatives or states when not to use this tool versus get_paper_detail.

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

get_paper_detailA

按 paperid 返回论文完整详情:完整摘要、关键词、作者、期刊(卷/期/页码/ISSN/CN)、被引、DOI、基金、阅读量、研究领域,以及知网/万方/维普等全部外部全文链接。paperid 来自 search_papers 返回结果。

ParametersJSON Schema
NameRequiredDescriptionDefault
paperidYes论文 id,来自 search_papers 结果的 paperid 字段

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, description carries burden. It fully discloses what the operation returns (full details, external links) and is clearly a read operation; no side effects or hidden behavior. Lacks notes on edge cases like missing paperid, but core behavior is transparent.

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?

One dense, structured sentence front-loads the verb and resource, enumerates all returned fields, then gives the paperid source. No filler, ideal length.

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

Completeness4/5

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

For a single-parameter tool with no output schema, the description provides the core semantics, return content list, and the paperid origin. It is sufficient for an agent to invoke it, though it does not describe result format or edge cases; sibling context rounds it out.

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 covers paperid at 100%, so baseline 3 applies. Description restates the source of paperid ('来自 search_papers'), matching the schema, adding no new meaning beyond what the schema already provides.

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?

Description clearly states the tool returns complete paper details by paperid, enumerating specific fields (abstract, keywords, authors, journal, citations, DOI, etc.), and differentiates from search_papers and get_paper_citations by full-detail scope rather than search or citation-specific.

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?

States that paperid must come from search_papers results, giving clear context on how to invoke it. Doesn't explicitly contrast with get_paper_citations or state when not to use the tool, but the purpose itself implies it for full details.

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

search_papersA

按论文标题搜索百度学术(支持部分标题/关键词),返回候选论文列表,含 paperid、标题、作者及机构、年份、期刊、被引、来源链接(知网/万方/维普等)和截断摘要。典型流程:先 search_papers 拿候选列表,自行挑选最匹配的一篇,再调 get_paper_detail 取完整详情。

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes论文标题,支持部分标题或关键词
max_resultsNo返回条数上限,默认 10,最大 50
auto_detail_on_singleNo搜索恰好只命中 1 篇时自动附带完整详情(paper_detail 字段),默认开启

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the result is a candidate list, includes truncated abstracts, and requires the caller to choose the most matching paper—useful behavioral context. It does not mention any side effects or response structure details, but for a read-only search this is largely sufficient.

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 concise: two sentences, with the primary function and return fields front-loaded, followed by the workflow guidance. Every sentence contributes value and there is no redundancy.

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

Completeness4/5

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

For a relatively simple search tool with full schema coverage and no output schema, the description provides the essential context: what the tool returns, the expected workflow, and the caller's responsibility to pick a match. The connection between paperid and get_paper_detail is implied but could be slightly more explicit.

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 baseline is 3. The description reinforces the query semantics (title/partial/keyword) but does not add meaningful detail about max_results or auto_detail_on_single beyond what the schema already provides.

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 tool searches Baidu Academic by paper title (supporting partial titles/keywords) and returns a candidate list with a detailed set of fields. It also differentiates itself from the sibling get_paper_detail by describing the typical flow of first searching then fetching details.

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 'typical flow' explicitly positions search_papers as the initial step before calling get_paper_detail, and instructs the caller to manually select the best match. However, it does not explicitly contrast with get_paper_citations or state when not to use the tool.

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. 3 tool updatesv0.1.0
    • First observedget_paper_citations
    • First observedget_paper_detail
    • First observedsearch_papers

TDQS

A4.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct role: search_papers finds candidate papers, get_paper_detail retrieves full metadata for one paper, and get_paper_citations returns reference/citation lists. There is no meaningful overlap between them.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: search_papers, get_paper_detail, get_paper_citations. The naming style is uniform and predictable across the server.

Tool Count5/5

Three tools is appropriate for a focused academic search MCP server: discovery, detail retrieval, and citation exploration. Each tool earns its place without redundancy or bloat.

Completeness5/5

The tool surface covers the core academic paper workflow: searching, viewing full details, and exploring reference/citation relationships. No obvious missing operation is apparent for the stated domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

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
    117
    AGPL 3.0
  • F
    license
    A
    quality
    D
    maintenance
    Enables AI agents to search and retrieve academic papers from China National Knowledge Infrastructure (CNKI), supporting various search types including subject, keyword, author, and DOI lookups.
    3
    21
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables searching and retrieving academic paper metadata from Semantic Scholar, including paper details, citations, and author information.
    21
    MIT