Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 197 additions & 0 deletions plugins/NkAntony777/scansci-pdf/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work.

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to the Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by the Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding any notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

Copyright 2024-2026 scansci-pdf contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

---

EXCEPTION: The compiled Cython extensions in src/scansci_pdf/_core/ (*.pyd, *.so)
are distributed as pre-compiled binaries via PyPI only. Their Cython source
code (*.pyx) is proprietary and not included in this repository. The pure
Python fallback implementations in the main source files are fully functional
and licensed under the Apache 2.0 license above.
81 changes: 81 additions & 0 deletions plugins/NkAntony777/scansci-pdf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# ScanSci PDF

Academic paper retrieval for MiniMax Code: turn a DOI, an arXiv ID, a keyword query, or a
thousand-row reading list into downloaded PDFs with per-item source reporting. The plugin wraps
the [scansci-pdf](https://github.com/Rimagination/scansci-pdf) engine — 20+ sources raced in a
hedged cascade (publisher links, OpenAlex / Unpaywall / Europe PMC / arXiv open-access
resolution, Sci-Hub / LibGen mirrors, and user-authorized institutional routes) — as two Skills
plus a local stdio MCP server.

Two Skills are included:

- **scansci-pdf** — single-paper download, search & citations, batch download with lane
scheduling, institutional access setup (Elsevier API, WebVPN / CARSI), and troubleshooting
(Cloudflare / Turnstile, proxies, session expiry).
- **scansci-sort** — triage for large lists (hundreds to thousands of DOIs): sniff-only
classification into open-access / grey-source-available / needs-institutional-access buckets,
then bucket-routed batch downloading.

## Try it

```text
Download this paper for me: 10.1038/s41586-024-07386-0, and give me the BibTeX entry.
```

Expected result: the agent resolves the DOI, reports which source produced the file (for example
an open-access PDF direct link, ~a few seconds), saves it to the working directory, and returns
a verified BibTeX record from the metadata source.

```text
Here is reading_list.xlsx with ~800 DOIs. Sort out which are open access, which Sci-Hub has,
and which need my university login, then download everything you can.
```

Expected result: the agent runs the sniff-first triage workflow, writes back a classification
report (UTF-8 CSV) plus bucket queue files, then batch-downloads the OA and grey buckets and
tells you which papers remain behind institutional auth.

## Requirements

- **Python >= 3.11** on the machine, and the `scansci-pdf` executable on `PATH`:

```bash
pip install scansci-pdf # or: uv tool install scansci-pdf
scansci-pdf check # verify dependencies
```

- The PyPI wheel ships a prebuilt Cython core (`scansci_pdf._core`); no compiler is needed at
install time. Some fallback sources use a headless browser (optional extra
`pip install scansci-pdf[camoufox]`).
- Platforms: Windows / macOS / Linux. Mainland-China network conditions are handled explicitly
(mirror selection, proxy detection) but not required.
- No MiniMax Code host tools are required; everything runs through the MCP server (`stdio`,
launched as `scansci-pdf run`) or falls back to the CLI.
- Institutional routes need **the user's own credentials**: an Elsevier API key on a campus
network, or a WebVPN / CARSI login performed by the user in a browser session. Grey-source
(Sci-Hub / LibGen) lanes are on by default upstream; users can restrict to legal-only sources
(`legal_only` strategy).

## Data and network

- Outbound requests go to scholarly APIs and mirrors: OpenAlex, Unpaywall, Crossref, Semantic
Scholar, Europe PMC / PMC, arXiv, DOAJ, OpenAIRE, publisher sites and CDNs (e.g. Elsevier,
Springer, MDPI), Sci-Hub mirrors, LibGen, and the user's own institutional WebVPN / CARSI
endpoints. Unpaywall requires the user's real email address (requested via MCP when missing).
- Configuration, credentials, and browser session cookies are stored locally under
`~/.scansci-pdf/`. The plugin folder itself contains only markdown and JSON — no binaries,
no credentials, no telemetry.
- The engine's proprietary compiled core is distributed only through the PyPI wheel; source for
the rest of the project is on GitHub (Apache-2.0).

## Upstream, license, and maintenance

- Upstream project: <https://github.com/Rimagination/scansci-pdf> (Apache-2.0,
Copyright 2024-2026 scansci-pdf contributors). This package redistributes the two Skill
documents and the MCP wiring from upstream release **v1.17.0**; the engine itself is installed
from PyPI, never vendored here.
- Submitted and maintained in this registry by [NkAntony777](https://github.com/NkAntony777).
Some advanced workflows in `scansci-sort` reference helper scripts that live in the upstream
repository, not in this folder.
- Version numbers here track upstream releases.

48 changes: 48 additions & 0 deletions plugins/NkAntony777/scansci-pdf/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ScanSci PDF 学术文献下载

给 MiniMax Code 用的学术论文获取插件:把一个 DOI、arXiv ID、关键词检索或上千行的文献清单变成下载完成的 PDF,并为每一篇报告实际来源。插件封装的是 [scansci-pdf](https://github.com/Rimagination/scansci-pdf) 引擎——20+ 数据源对冲级联竞速(出版商直链、OpenAlex / Unpaywall / Europe PMC / arXiv 开放获取解析、Sci-Hub / LibGen 镜像、用户授权的机构通道)——以两个 Skill 加一个本地 stdio MCP server 的形式提供。

包含两个 Skill:

- **scansci-pdf** —— 单篇下载、检索与引文、批量车道调度下载、机构渠道配置(Elsevier API、WebVPN / CARSI)与排障(Cloudflare / Turnstile、代理、会话过期)。
- **scansci-sort** —— 大清单摸底(数百到数千条 DOI):先只嗅探不下载,分类为"开源 OA / 灰色源可得 / 需机构权限"三桶,再按桶路由批量下载。

## 试试看

```text
帮我下载这篇论文:10.1038/s41586-024-07386-0,顺便给我 BibTeX 条目。
```

预期结果:agent 解析 DOI、下载 PDF 并报告来源(通常是开放获取直链,几秒内完成)、保存到工作目录,并返回经过校验的 BibTeX 记录。

```text
这是 reading_list.xlsx,约 800 个 DOI。先分清哪些开源、哪些 Sci-Hub 有、哪些要走我校登录,然后把能下的都下了。
```

预期结果:agent 执行嗅探优先的摸底流程,产出分类报告(UTF-8 CSV)和分桶队列文件,批量下载 OA 桶和灰色桶,并列出仍需机构权限的论文。

## 环境要求

- 本机 **Python >= 3.11**,且 `scansci-pdf` 可执行文件在 `PATH` 上:

```bash
pip install scansci-pdf # 或:uv tool install scansci-pdf
scansci-pdf check # 校验依赖
```

- PyPI wheel 自带预编译的 Cython 核心(`scansci_pdf._core`),安装无需编译器。部分兜底数据源需要无头浏览器(可选扩展 `pip install scansci-pdf[camoufox]`)。
- 平台:Windows / macOS / Linux。明确处理大陆网络环境(镜像选择、代理探测),但非必需。
- 不依赖 MiniMax Code 宿主工具;一切通过 MCP server(stdio,`scansci-pdf run` 启动)或 CLI 兜底完成。
- 机构通道需要**用户自己的凭据**:校园网环境下的 Elsevier API key,或用户在浏览器里完成的 WebVPN / CARSI 登录。灰色源(Sci-Hub / LibGen)通道上游默认开启;用户可切换 `legal_only` 策略仅用合法来源。

## 数据与网络

- 出站请求面向学术 API 与镜像:OpenAlex、Unpaywall、Crossref、Semantic Scholar、Europe PMC / PMC、arXiv、DOAJ、OpenAIRE、出版商站点与 CDN(Elsevier、Springer、MDPI 等)、Sci-Hub 镜像、LibGen,以及用户自己的机构 WebVPN / CARSI 端点。Unpaywall 要求用户真实邮箱(缺失时经 MCP 交互式索要)。
- 配置、凭据、浏览器会话 cookie 均保存在本地 `~/.scansci-pdf/`。插件目录本身只含 markdown 与 JSON——无二进制、无凭据、无遥测。
- 引擎的闭源编译核心只经 PyPI wheel 分发;项目其余源码在 GitHub(Apache-2.0)。

## 上游、许可与维护

- 上游项目:<https://github.com/Rimagination/scansci-pdf>(Apache-2.0,Copyright 2024-2026 scansci-pdf contributors)。本包再分发上游 **v1.17.0** 的两个 Skill 文档与 MCP 接线;引擎本体从 PyPI 安装,从不 vendor 进本目录。
- 由 [NkAntony777](https://github.com/NkAntony777) 在本注册表提交并维护。`scansci-sort` 中部分进阶流程引用的辅助脚本位于上游仓库,不在本目录内。
- 版本号跟随上游发布。
10 changes: 10 additions & 0 deletions plugins/NkAntony777/scansci-pdf/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
"mcpServers": {
"scansci-pdf": {
"type": "stdio",
"command": "scansci-pdf",
"args": ["run"]
}
}
}
Loading