litMcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENALEX_API_KEY | No | OpenAlex API key, configured in .env (recommended at ~/.config/litMcp/.env; falls back to ~/.config/openalex-mcp/.env). Required for searching OpenAlex, but not required to start the server or run basic tools such as library_stats. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Literature research server over OpenAlex (250M+ academic papers), arXiv, PubMed, preprint servers, Crossref, Semantic Scholar, and CNKI. TRIGGER this server automatically whenever the task involves finding, searching, screening, or citing academic papers / literature / references, building a bibliography or related-work section, checking research progress or novelty, or analyzing citation networks — 文献检索、找论文、查文献资料、配参考文献、写综述、调研研究进展、引文分析。 工作流:
search_keyword / search_semantic / search_ids → OpenAlex 检索,结果自动入库 SQLite 中文期刊用 search_chinese;最新论文/预印本用 search_multi;知网(含学位论文)用 search_cnki(需本机浏览器与机构权限)。检索结果都会入库。 用户询问具体操作、方法参数或正文细节时,设置 fetch_fulltext=true;默认不要抓全文。随后用 library_query 的 substr(fulltext, 1, N) 取适量证据。 库内全文关键词检索用 FTS5 索引(比 LIKE 快且带相关性排序,rank 越小越相关):
SELECT w.id, w.title, bm25(works_fts) AS rank FROM works_fts JOIN works w ON w.rowid = works_fts.rowid WHERE works_fts MATCH '关键词' ORDER BY rank LIMIT 20中文关键词必须写成MATCH cjk_fts('锂电池 极耳')(自动按双字切分)。 扫描版 PDF 需要 OCR 时设置环境变量 FULLTEXT_OCR=true。library_query → 通用 SQLite SQL 查询(SELECT name FROM sqlite_master 探索结构;PRAGMA table_info(table) 查看列)。
迭代 library_query → 根据结果调整 SQL/filters/LIMIT
library_export → 将精选论文导出为 BibTeX 文件
library_stats → 查看库统计概览
library_delete → 从库中删除论文
download_pdf → 按 OpenAlex 或原生 ID 下载 PDF:先用免费来源(自带 OA 链接、arXiv、Elsevier 接口,落空再查 Unpaywall、DOI 落地页、Semantic Scholar),付费接口垫底;知网记录走本机浏览器单篇下载,每次最多 5 篇,有的学位论文只有 CAJ。知网检索或下载返回 job_id 时,用户在原窗口完成人工验证后,调用 cnki_job 并传入同一 job_id 续办;取消时传 action='cancel'。 严格规则:除非用户明确要求“保存到项目目录”,否则必须保持 save_to_project=false,PDF 只能写入 ~/.AI-CACHE/openalex/pdfs/。不得根据上下文、Agent 偏好或任意路径推断项目目录需求。
autocomplete → 快速获取作者/期刊/机构/出版商/资助方 ID
graph_analyze / graph_neighbors / graph_visualize → 对选中的一批论文做引文网络分析(work_ids 必填,先用 library_query 按 cited_by_count 等选出论文)
fetch_elsevier_abstracts → 用 Elsevier Abstract API 按 DOI/库内 ID 获取并回填摘要
literature_review_prompt → 在用户已于会话提供 BibTeX,或外层模型已读取本地 .bib 文件时,取得文献综述写作提示词,并由外层模型完成综述
find_literature → 为论点多路召回并提取摘要证据。verdict 是词汇启发式,supports 也需核验语境;partial/none 不得当成已证实。
summarize_paper → 分块读取已存正文并梳理,按 next_offset 续读。complete 仅代表已存文本结尾,abstract_only 不能声称已读全文。 检索有预算和输出上限。已有足够证据就回答;超时或某路失败时报告限制,不要无限重试或自动翻页。
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_keywordA | Search academic papers by keyword across 250M+ OpenAlex works. TRIGGER automatically whenever the user asks to 检索/查找/搜集相关文献
或资料, find/search/review papers, references, related work, or surveys
by topic, keyword, author, journal, institution, or funder. Prefer this
over generic web search when scholarly sources are needed, and call it
before answering the research question. For paragraph-length research
ideas or conceptual matching prefer Results are automatically added to the local library (UPSERT by work ID).
Use The Leave Use |
| search_semanticA | Search academic papers by meaning — AI-powered semantic search. TRIGGER when the user describes a research idea, problem, draft
paragraph, or abstract and wants conceptually related papers
(按研究思路/想法/主题找语义相关文献, find papers similar to this
idea/abstract), even without exact keywords. For exact terms, author
names, or venue strings prefer Results are automatically added to the local library (UPSERT by work ID).
Use This uses OpenAlex's server-side semantic search and needs no extra key. Best for paragraph-length queries (research descriptions, abstracts).
Matches by conceptual meaning, not exact keywords. Max 50 results
per page, rate-limited to 1 request per second. Defaults to
Use |
| search_idsA | Fetch specific papers by OpenAlex ID or DOI. TRIGGER when the user provides one or more DOIs / OpenAlex IDs, or
points at specific known papers (按 DOI 获取论文、查指定的某几篇文献)
— no filters, no pagination. For topic-based discovery use
Results are automatically added to the local library (UPSERT by work ID).
Use |
| autocompleteA | Resolve names to OpenAlex entity IDs — fast typeahead (~200ms). TRIGGER whenever the user names a specific author, journal, institution, publisher, or funder (指定作者/期刊/机构/出版商/资助方) and you need its OpenAlex ID for search filters. Use this before Returns up to 10 results. Autocomplete is free (not billed as a search). |
| search_chineseA | Search Chinese journal literature (中文期刊文献检索). TRIGGER when the user asks for 中文文献/中文期刊/国内研究 and the
query is written in Chinese keywords (找中文论文、国内研究现状).
It searches OpenAlex restricted to sources whose country is China,
so it covers Chinese journals that register a DOI.
CNKI/Wanfang theses and journals without DOIs are NOT covered; use
Page 1 first looks for an exact match of all keywords in the title
or abstract (most relevant first). When nothing matches exactly, it
falls back to a loose match and says so in the summary; Results are automatically added to the local library (UPSERT by work ID).
Use |
| search_cnkiA | Search CNKI (知网) through a local browser (知网检索). TRIGGER when the user asks for 知网/CNKI 文献, 硕士/博士论文, or Chinese work that OpenAlex does not index (知网上的中文文献、学位论文). Requires local Chrome or Edge, institutional access and the cnki extra. Stores the newest 20 records with detail-page abstracts, DOIs and page numbers. Each call waits up to 20 seconds. On verification it returns a job_id immediately. Ask the user to complete verification in the original window and say “继续” within 4 minutes, then call cnki_job with that ID. For a progress response, use the same ID to check again. |
| cnki_jobA | Continue or cancel a CNKI search or PDF download by job_id. When the user says “继续” after verification in the original window, call with the same job_id. Use action='cancel' to release the window. Each call waits up to 20 seconds. Verification expires after 4 minutes and completed results can be read again for 4 minutes. Restarting the server clears job IDs. If the ID has expired, restart the original call. |
| search_multiA | Search preprints and fresh publications beyond OpenAlex. TRIGGER when the user needs the newest papers, preprints, or work OpenAlex may not have indexed yet (最新论文、预印本、arXiv、bioRxiv、 PubMed、刚上线的期刊论文). Sources run concurrently and every hit is stored in the local library:
A hit that shares a DOI with an OpenAlex work is stored as that
OpenAlex work (id |
| library_exportA | Export screened papers from the library to a BibTeX file. TRIGGER when the user wants a reference list, citation export, or a .bib file for Zotero / EndNote / JabRef (导出参考文献、生成 BibTeX). Generates BibTeX entries directly from library columns and saves
them to Use this as the FINAL step — after iteratively screening with
|
| literature_review_promptA | Return the system prompt for a BibTeX-grounded literature review. TRIGGER when the user asks to write a literature review / related-work section from BibTeX (根据 BibTeX 写综述、文献回顾、研究现状). This tool deliberately has no BibTeX argument and does not call an LLM. The outer model must read the BibTeX supplied in the conversation or a local .bib export, then follow the returned prompt to write the review. This preserves a single source of truth for citation keys and keeps the final prose generation under the outer model's control. |
| library_statsA | Show an overview of the local literature library. TRIGGER when the user asks what has been collected so far (库里有哪些文献/文献库概况), or before screening to plan queries. Returns Markdown with total works, year range, abstract and full-text coverage, open-access rate, top 10 sources, and top 10 concepts. Use this to understand what's in your library before searching. |
| library_deleteA | Delete works from the local library. DESTRUCTIVE — call ONLY on an explicit user delete request; never call proactively during a literature workflow. Removes works by ID from the local library. ⚠️ 谨慎使用:删除不可恢复。除非用户明确要求删除,否则 AI 不应
调用本工具——尤其是 |
| library_closeA | Close the local library connection and release the file lock. Maintenance only — call when another program needs the database file; not part of a normal literature-search workflow. After closing, any subsequent tool that accesses the library will automatically reconnect. Use this when you need another program to access the library database file without lock conflicts. |
| library_queryA | Query the local literature library with read-only SQL. TRIGGER after any search to screen, filter, or rank the collected papers (从已检索文献库中筛选/排序, e.g. top-N by citations, year/journal/author filters, substr(fulltext,1,N) evidence extraction). This is the universal query tool — freely explore schema and run ad-hoc queries:
Schema:
Work ids are OpenAlex ids ( Full-text search: the Chinese full-text search: CJK text is indexed as character
bigrams, so wrap Chinese keywords with WAL mode allows concurrent reads + writes — Output is capped: BLOB columns render as |
| find_literatureA | Find literature evidence for a paragraph or explicit claims. TRIGGER when the user asks for sources supporting a statement. Recall uses local full-text search and OpenAlex keyword and semantic search. Remote results are not automatically ingested. Evidence verdicts supports/partial/none are conservative lexical heuristics, not entailment judgments: verify quoted abstract context. Titles alone cannot support a claim. not_found means no evidence in returned windows, not evidence of absence. For Chinese claims, supply aligned claims_en translations to search and match English abstracts. Output is intact JSON capped at 12,000 characters. At most eight claims, four remote claims, and five seconds per route are processed; timeout_seconds bounds the full recall (maximum 60 seconds). Failed and skipped routes are reported. No implicit PDF download. Stop searching once enough source evidence is available. |
| summarize_paperA | Read bounded source windows for a grounded paper summary. TRIGGER when asked to explain a known library paper. The tool returns source text and summary instructions; the outer model writes the summary. Continue with next_offset until complete, tracking every window read. complete only means the end of stored text, whose PDF extraction coverage is unknown. abstract_only=true cannot justify a full-paper summary. Offsets count Unicode characters, not PDF pages. Purely local by default. Explicit fetch_fulltext allows one stored paper's OA PDF extraction (100 pages, 100,000 chars, 60-second deadline); use_openalex_content_api explicitly permits the paid fallback. Output stays intact JSON within 12,000 characters, with accurate cursors. |
| download_pdfA | Download paper PDFs by OpenAlex work ID or by native id. TRIGGER when the user asks to 下载论文/PDF/全文, download or save paper PDF files. Sources are tried in this order and the first one that returns a
real PDF wins: STRICT RULE: PDFs must be saved to
Limits: at most 25 works per call (split larger batches); remote URLs are fetched only over validated public http(s) hosts, must prove to be PDFs, and are size-capped. Sites that answer with a CAPTCHA or bot check are reported as failures, never solved. |
| fetch_elsevier_abstractsA | Fetch missing paper abstracts from Elsevier by DOI or local work ID. TRIGGER when retrieved papers lack abstracts and the user wants fuller summaries (补全/回填文献摘要). Requires |
| graph_analyzeA | Analyze the citation network among a selected set of papers. TRIGGER when the user asks about citation relationships, who cites whom, core/classic papers, or research clusters among collected literature (引文网络分析、引用关系、找关键文献/文献簇). Builds a directed citation graph over the given works — node =
paper, edge work_ids 必填:不填/为空会报错。请先用
返回 PageRank、被引最多(入度)、引用最多(出度)、中介中心度、 社区划分(密集互引的论文簇)等结构化分析。 |
| graph_neighborsA | Show the citation neighbors (who cites it / whom it cites) of papers. TRIGGER when the user asks 某篇文献被谁引用、它引用了谁, or wants the local citation context of specific papers. For each requested work, lists who cites it (in / predecessors) and whom it cites (out / successors), within the selected set. work_ids 必填:同 |
| graph_visualizeA | Generate an interactive HTML visualization of the citation network. TRIGGER when the user asks to 可视化/画出引文网络图, or wants a visual map of how collected papers cite each other. Renders the selected works as an interactive graph (vis.js) saved to
Visual encoding:
work_ids 必填:同 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 21 tools
Six search variants coexist (search_keyword, search_semantic, search_ids, search_chinese, search_cnki, search_multi), but each description carries explicit TRIGGER conditions and cross-references telling the agent when to prefer another tool, so routing is learnable. Library tools (library_query vs library_stats vs find_literature vs summarize_paper) are also cleanly separated by task stage; the only residual ambiguity is choosing among the search family under vague requests.
All names are snake_case and grouped by domain prefixes: search_*, library_*, graph_*. Deviations are minor: cnki_job is noun-first, autocomplete has no object, and standalone verbs (summarize_paper, download_pdf, find_literature) break the prefix pattern but remain readable and predictable.
21 tools is on the heavy side, but the server covers a genuinely broad pipeline (multi-source search, SQL library, PDF acquisition, summarization, citation graphs, export), and each tool maps to a distinct step. Only library_close (pure maintenance) and literature_review_prompt feel like marginal additions.
Coverage is unusually thorough: six search backends, SQL screening, BibTeX export, PDF download, abstract backfill, evidence finding, bounded summarization, and a full three-tool citation-graph suite. The main gap is lifecycle management of library records — delete exists but no update/annotate/tag operation, and no non-BibTeX citation styles.