cnki-mcp
Allows searching CNKI, downloading PDFs, and importing them into Zotero with deduplication, PDF auto-attachment, and metadata reconciliation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cnki-mcpsearch for 'deep learning in agriculture' and import recent papers into Zotero"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cnki-mcp
把中国知网(CNKI)的文献检索 → 双排序去重 → PDF 下载 → 导入 Zotero(含 PDF 自动关联)→ 元数据核对更新封装成 MCP 工具,供 Claude 等 AI 助手一键调用。
An MCP server that lets an AI assistant search CNKI, download article PDFs, and import them into Zotero — with built-in deduplication, citation-based sorting, and PDF metadata reconciliation.
✨ 功能
多维排序检索:分别按「发表时间」和「引用量」取前 N 篇,合并去重后作为工作集
两级去重:(1) 两种排序结果间按标题去重;(2) 与 Zotero 已有文献对比,跳过已存在条目
引用量采集:检索结果中自动提取每篇论文的引用次数(CNKI
td.quote)下载 单篇或批量 PDF/CAJ 到本地
导入 Zotero:优先本地 connector(
localhost:23119),PDF 直接上传并关联为子附件;Zotero 未运行时降级云 API(仅元数据)元数据核对与更新:通过 PyMuPDF 提取 PDF 内嵌元数据(标题/作者/DOI),与 Zotero 条目比对生成差异表,用户确认后一键 PATCH 更新
登录态持久化:Cookie 保存/恢复,几小时内免重复登录
Related MCP server: CNKI MCP Server
🧰 MCP 工具
工具 | 说明 |
| 检查机构登录状态 |
| 打开登录页,等待手动完成机构登录并保存 Cookie |
| 手动保存当前 Cookie |
| 按关键词检索期刊论文(相关度排序,含引用量) |
| 下载单篇 PDF/CAJ |
| 把元数据列表导入 Zotero(可带 |
| 一键:多排序检索 → 去重 → 下载 → 导入 Zotero → 元数据差异预览 |
| 对指定 PDF 列表提取元数据,生成与现有数据的差异对比表 |
| 将用户确认的差异 PATCH 更新到 Zotero 条目 |
cnki_batch 主要参数
参数 | 默认值 | 说明 |
| 50 | 按发表时间取前 N 篇(0 = 禁用此排序) |
| 50 | 按引用量取前 N 篇(0 = 禁用此排序) |
| True | 跳过 Zotero 中已有的文献 |
| True | 是否下载 PDF |
| True | 是否导入 Zotero |
| 6.0 | 两篇之间最小间隔(秒),防风控 |
| 12.0 | 两篇之间最大间隔(秒),随机化 |
| 120 | 等待用户完成验证码的最长秒数;0 = 跳过 |
📦 环境要求
Python 3.10+(MCP SDK 要求)
Playwright + 系统 Chrome(或内置 Chromium)
有效的 CNKI 机构访问权限(校园网/VPN/机构账号)
可选:Zotero 7+ 桌面端(用于 PDF 自动关联)
可选:Zotero API Key + Library ID(用于 Zotero 查重、元数据更新)
🚀 安装
方式 A:pip 安装(推荐,提供 cnki-mcp 命令)
pip install git+https://github.com/wuruiqi/cnki-mcp.git
python -m playwright install chromium # 若无系统 Chrome方式 B:克隆源码
git clone https://github.com/wuruiqi/cnki-mcp.git
cd cnki-mcp
pip install -r requirements.txt
python -m playwright install chromium
cp .env.example .env # 按需修改配置注册到 MCP 客户端
pip 安装后(最简洁):
{
"mcpServers": {
"cnki": { "type": "stdio", "command": "cnki-mcp" }
}
}克隆源码方式:
{
"mcpServers": {
"cnki": {
"type": "stdio",
"command": "python",
"args": ["/abs/path/to/cnki-mcp/server.py"]
}
}
}⚙️ 配置(.env)
所有项均可选。详见 .env.example。
变量 | 默认 | 说明 |
|
| Zotero 本地 connector 地址 |
| — | Zotero Web API Key(Zotero 查重 + 元数据更新需要) |
| — | Zotero 用户/库 ID(同上) |
|
| PDF 暂存目录 |
|
| 浏览器持久化目录 |
|
| Cookie 存储文件 |
|
| 成功关联 Zotero 后删除暂存 PDF |
提示:若需在导入后用
cnki_preview_metadata_updates核对 PDF 元数据,请先将DELETE_PDF_AFTER_IMPORT=false,或直接使用cnki_batch返回结果中自动生成的metadata_preview。
📖 典型使用流程
1. cnki_login_status → 检查登录态
2. cnki_open_login_page → 机构登录(如需)
3. cnki_batch "螺旋推进 散粒体" → 检索+排序+去重+下载+导入
↳ 返回 metadata_preview → 查看 PDF 与 CNKI 元数据差异
4. cnki_apply_metadata_updates → 确认后更新 Zotero 条目⚠️ 说明与限制
PDF 自动关联需 Zotero 桌面端在运行;未运行则降级为仅写元数据。
cnki_apply_metadata_updates需要 Zotero 云 API(在.env中配置ZOTERO_API_KEY+ZOTERO_LIB_ID)。CNKI 每页约显示 20 条,
top_n > 20时实际返回数量受限(分页支持规划中)。若系统配置了 HTTP 代理,访问 Zotero 本地端口已通过
httpx(trust_env=False)处理。CNKI 验证码(CAPTCHA):批量下载时如触发人机验证,下载将自动暂停并在控制台打印提示,请在保持打开的浏览器窗口中手动完成滑块验证后继续(等待上限
captcha_wait秒,默认 120 秒)。浏览器须保持可见(headless=False,默认已满足)。仅供个人学习研究用途,请遵守 CNKI 服务条款与所在机构的使用规定。
🛠 开发
pytest tests/test_unit.py -v # 离线单元测试(19 个用例)诊断脚本见 tests/(inspect_* 检查 DOM 选择器,probe_* 测试 Zotero 端点)。
实测要点与 2026 改版适配记录见 CLAUDE.md。
License
This server cannot be installed
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
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/wuruiqi/cnki-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server