cnki-mcp
Use this stdio MCP server to search CNKI and retrieve paper metadata/citations with managed sessions, caching, and quotas.
Search CNKI by keyword with field-specific search (
SU,TI,AU,KY,AB,FT), sorting, paging, resource filters, and year filters.Fetch full paper details from a CNKI detail URL: authors, institutions, journal/year/volume/issue/pages, DOI, abstract, keywords, fund, classification, etc.
Generate citations in GB/T 7714, APA, BibTeX, or RIS, including batch citation for up to 20 URLs.
Re-solve the slider captcha/rebuild the CNKI session (
cnki_warm) and inspect session, quota, cache, and configuration status (cnki_status).Benefit from serial rate limiting, 24h query caching, daily quota control, and automatic warm-up on session expiry.
Click on "Deploy 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-mcp Find CNKI papers on 二语写作反馈 from 2020 on, with GB/T 7714 citations"
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
Self-maintained CNKI MCP server in TypeScript. Pure HTTP with an in-process slider-captcha solver — no browser, no Python, no pinned SDK.
Requirements
Node >= 20 (
NODE_USE_ENV_PROXYneeds Node >= 24)Egress from mainland China — the domestic CNKI site refuses cross-border access (see Network)
Related MCP server: HUST CNKI Research MCP
Quick start
git clone https://github.com/fabea87/cnki-mcp.git
cd cnki-mcp
npm install
npm run build
node dist/scripts/net-check.js # egress + captcha-gate check
node dist/scripts/smoke.js "corpus linguistics" # end-to-end checkOptional global install: npm install -g . provides a cnki-mcp binary.
Session, cache, and quota state live in ~/.pi/agent/state/cnki-mcp; override with CNKI_STATE_DIR.
MCP client setup
This is a stdio server. Any stdio MCP client accepts:
{ "command": "node", "args": ["/abs/path/to/cnki-mcp/dist/src/index.js"] }
// or after a global install:
{ "command": "cnki-mcp" }Claude Desktop, Cursor, VS Code, and Codex use the same command/args under their own mcpServers / servers keys. Claude Code:
claude mcp add cnki -- node /abs/path/to/cnki-mcp/dist/src/index.jsFor pi, put the same object under mcpServers.cnki in ~/.pi/agent/mcp.json, then /reload or /mcp reconnect cnki.
HTTP/SSE-only clients need a bridge:
npx -y mcp-remote@latest --transport stdio -- node /abs/path/to/cnki-mcp/dist/src/index.jsTools
Tool | Purpose |
| Search by keyword, with search type, paging, sort, resource and year filters. |
| Full metadata plus GB/T 7714 / APA / BibTeX / RIS citations. |
| Batch citations (up to 20). |
| Re-solve the captcha and rebuild the session. |
| Session, quota, and cache status. |
In list results, cited=null means zero citations (CNKI omits empty cells).
Network
Domestic CNKI (www.cnki.net, kns.cnki.net) serves mainland IPs only; overseas access requires a different, unsupported platform. A fresh session is always redirected to a slider captcha — session admission, not rate limiting. Keep CNKI on a mainland route:
rules:
- DOMAIN-SUFFIX,cnki.net,DIRECT
- DOMAIN-SUFFIX,cnki.com.cn,DIRECT
- DOMAIN-SUFFIX,kns.cnki.net,DIRECTNode's fetch ignores proxy environment variables unless enabled: set NODE_USE_ENV_PROXY=1 alongside HTTP_PROXY / HTTPS_PROXY, and keep CNKI hosts in NO_PROXY. With a system-level TUN / transparent proxy, no variables are needed (net-check reports DISABLED -> requests go out directly). If mainland egress is unavailable, run the server on a mainland machine and bridge it with mcp-remote / supergateway.
Configuration
Variable | Default | Purpose |
|
| Session, cache, quota files |
|
| Minimum gap between requests |
|
| Rolling 24-hour request cap |
|
| Query cache TTL |
|
| Per-request timeout |
|
| Re-solve captcha on session expiry |
| Built-in Chrome UA | Custom User-Agent |
Layout
src/index.ts MCP tool registration (stdio)
src/cnki/ HTTP, session, captcha, search, detail, citations
src/store/ JSON cache, serial rate limiter
scripts/ smoke, net-check, paging-test, captcha probeLimitations
Online-first papers have no volume/issue/pages; pass
hint_journal/hint_datefrom the search row.Paging requires page 1 first (server-side
turnpagetoken); the client caches it.Only relevance and date sorting are exposed; citation/download sorting is unverified.
Reference and citation lists use a separate AJAX endpoint (not implemented).
CNKI prohibits automated scraping; raising quotas is at your own risk.
stdio only; no HTTP endpoint.
Available Tools
5 toolscnki_cite批量引文A
批量抓取多条文献并只返回引文文本(GB/T 7714 / APA / BibTeX / RIS)。可直接粘进 Zotero 或稿件。
Inputs: urls (required), style.
cnki_get_paper_detail知网文献详情A
根据详情页 URL 抓取完整元数据:题名、作者、机构、刊名/年/卷/期/页、DOI、摘要、关键词、基金、分类号,并本地生成 GB/T 7714、APA、BibTeX、RIS 引文。
Inputs: url (required), hint_date, use_cache, hint_journal.
cnki_search知网检索A
检索中国知网(CNKI)。返回题名、作者、来源刊、发表时间、被引、下载量与详情页 URL。慢速串行、带 24h 缓存与每日配额。
Inputs: keyword (required), sort, year_to, page_num, +5 more.
cnki_status会话与配额状态A
显示 cookie 会话状态、今日请求配额、缓存条数与当前配置。
Inputs: no named parameters.
cnki_warm重建知网会话A
重新通过安全验证(自动解拼图滑块)并保存 cookie 会话。会话失效或换网络后调用。
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear anchor: session warm-up, search, single-paper metadata, batch citations, and status. The only real overlap is between cnki_get_paper_detail and cnki_cite, which both fetch metadata and emit citations, but the descriptions differentiate them (single paper + full metadata vs. batch + citation text only) well enough to avoid misselection.
All tools share the cnki_ prefix and snake_case with an action-oriented second segment (warm, search, get_paper_detail, cite, status). The pattern is predictable and readable throughout.
Five tools map cleanly onto the domain's lifecycle (auth, search, detail, cite, diagnostics) with no filler. It is slightly lean — no export or batch-search variant — but nothing feels redundant.
The path search → detail → cite is fully covered, plus session recovery and quota introspection which are real operational needs for a scraped source. Minor gaps remain around advanced querying (author/journal filters, pagination control) and bulk export, but agents can work around them with the existing tools.
Related MCP Connectors
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Google Scholar search results, citation counts and citation export formats, as structured JSON.
Academic literature search, retrieval, and private library management on top of OpenAlex.
Catch AI-fabricated citations (real DOI + fake title). Retraction, open-access, 10,000+ CSL styles.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search CNKI (China National Knowledge Infrastructure), download PDFs, and import them into Zotero with automatic PDF attachment.34MIT
- FlicenseAqualityDmaintenanceEnables AI agents to search, read, and cite Chinese academic papers from CNKI using HUST single sign-on, with support for full-text retrieval, BibTeX export, and PDF download.74-
- AlicenseAqualityCmaintenanceMCP server for deep CNKI academic search, retrieving multi-dimensional data (abstracts, keywords, references, citations, similar papers, keyword weights) and enabling citation network traversal via Playwright-based API interception.1616MIT
- AlicenseAqualityCmaintenanceMCP server for searching Chinese academic literature from CNKI Space, returning metadata such as title, authors, year, and links, and retrieving abstracts and degree details. Enables agents to query CNKI without an account.22MIT