MCP server for CNKI (China National Knowledge Infrastructure) literature search, PDF download, and Zotero import
Server has 7 tools with explicit FastMCP registration and visible schemas. Naming follows verb_noun convention (cnki_login_status, cnki_search, cnki_download_pdf). Descriptions are present but vary in quality: some are detailed (cnki_batch at ~400 chars), others minimal (cnki_save_cookies at ~80 chars). All tools have input schemas with type definitions. However, critical gaps: (1) No output schemas documented, LLMs cannot predict return structure; (2) Parameter descriptions lack constraints (e.g., year_start/year_end have no min/max bounds, db_code has no enum); (3) No error handling guidance, tools return dicts but no recovery hints; (4) STDIO transport caps score at 50 hard limit. cnki_batch is complex (7 params, irreversible) but lacks confirmation/dry-run pattern.
一键完成:搜索 → 多排序 → 去重 → 可选下载 PDF → 可选导入 Zotero。 排序策略: - 分别按「发表时间」和「引用量」排序,各取前 N 篇,合并去重后得到工作集。 - top_n_by_time=0 则跳过时间排序;top_n_by_citations=0 则跳过引用排序。 - 两者均为 0 时退化为按相关度取前 50 篇。 去重策略: 1. 两种排序结果之间按标题去重(内部合并)。 2. 若 check_zotero_dup=True,与 Zotero 已有文献对比,跳过已存在的条目。 下载风控策略: - 两篇之间随机等待 download_interval_min~download_interval_max 秒(默认 6-12 秒)。 - 触发 CNKI 人机验证时,自动暂停并在控制台提示用户在浏览器中手动完成验证, 等待最多 captcha_wait 秒后自动重试当前文件。 - 验证后额外延长等待(= download_interval_max × 2),保证服务端冷却。 元数据预览(仅当 download_pdf=True 时触发): 下载 PDF 后自动提取 PDF 元数据,与 CNKI 搜索元数据比对; 存在差异时将差异写入结果 metadata_preview 字段, 可调用 cnki_apply_metadata_updates 确认后更新 Zotero 条目。
下载单篇论文的 PDF 或 CAJ 文件。 触发 CNKI 人机验证时,浏览器窗口保持打开,控制台打印提示, 等待用户在浏览器中手动完成验证后自动重试。
将论文元数据列表导入 Zotero(优先本地 API,失败降级云 API)。
检查当前 CNKI 登录状态。 返回 {"logged_in": bool, "detail": str}。 若未登录,请调用 cnki_open_login_page 完成机构登录。
打开 CNKI 机构登录页,等待用户手动完成登录,然后自动保存 Cookie。 登录流程(手动操作): 1. 点击"机构登录" 2. 点击"校外登录" 3. 输入学校名称,确定 4. 输入账号密码,接受条款
No output schemas documented. Tools return dicts but LLMs cannot predict field names, types, or structure. E.g., cnki_search returns {success, query, count, papers, message} but this is only visible in docstring, not in schema.
Parameter constraints missing. year_start/year_end lack min/max bounds (should be 1900 - 2100). db_code should be an enum (CJFD|CDFD|CMFD), not free-form string. max_results unbounded (should be 1 - 100). LLMs will pass invalid values.
No error handling guidance. Tools return success/failure dicts but do not tell LLM what to do on failure. E.g., cnki_download_pdf may fail due to CAPTCHA or network, no recovery hint provided.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | 2026-07-28+ | v2 |
保存当前浏览器上下文中所有 CNKI Cookie 到本地文件。 下次启动时自动恢复,无需重新登录。
搜索 CNKI 期刊论文(主题检索,按相关度)。
cnki_batch is irreversible (downloads PDFs, modifies Zotero) but lacks confirmation/dry-run pattern. No way for agent to preview results before committing. High risk of unintended side effects.
STDIO transport only. Server is not remotely accessible and cannot be used by hosted MCP clients. Limits deployment to local-only scenarios.