Skip to main content
Glama
litMcp

litMcp

by L1nze

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENALEX_API_KEYNoOpenAlex 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 — 文献检索、找论文、查文献资料、配参考文献、写综述、调研研究进展、引文分析。 工作流:

  1. 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。

  2. library_query → 通用 SQLite SQL 查询(SELECT name FROM sqlite_master 探索结构;PRAGMA table_info(table) 查看列)。

  3. 迭代 library_query → 根据结果调整 SQL/filters/LIMIT

  4. library_export → 将精选论文导出为 BibTeX 文件

  5. library_stats → 查看库统计概览

  6. library_delete → 从库中删除论文

  7. 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 偏好或任意路径推断项目目录需求。

  8. autocomplete → 快速获取作者/期刊/机构/出版商/资助方 ID

  9. graph_analyze / graph_neighbors / graph_visualize → 对选中的一批论文做引文网络分析(work_ids 必填,先用 library_query 按 cited_by_count 等选出论文)

  10. fetch_elsevier_abstracts → 用 Elsevier Abstract API 按 DOI/库内 ID 获取并回填摘要

  11. literature_review_prompt → 在用户已于会话提供 BibTeX,或外层模型已读取本地 .bib 文件时,取得文献综述写作提示词,并由外层模型完成综述

  12. find_literature → 为论点多路召回并提取摘要证据。verdict 是词汇启发式,supports 也需核验语境;partial/none 不得当成已证实。

  13. summarize_paper → 分块读取已存正文并梳理,按 next_offset 续读。complete 仅代表已存文本结尾,abstract_only 不能声称已读全文。 检索有预算和输出上限。已有足够证据就回答;超时或某路失败时报告限制,不要无限重试或自动翻页。

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": false,
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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 search_semantic; when the user already gives DOIs or OpenAlex IDs use search_ids instead.

Results are automatically added to the local library (UPSERT by work ID). Use library_query to explore results with SQL.

The query parameter supports Boolean operators (AND, OR, NOT — UPPERCASE), quoted phrases ("..."), and wildcards (machin*). Search targets title, abstract, and fulltext. Defaults to publication_year ">2021".

Leave query empty to fetch ALL works matching only the ID filters — no full-text keyword needed. Combine with publication_year or cited_by_count to narrow the result set.

Use autocomplete first to resolve author / source / institution / publisher / funder names to their OpenAlex IDs, then pass those IDs to the corresponding filter parameters below.

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 search_keyword; for known DOIs or IDs use search_ids.

Results are automatically added to the local library (UPSERT by work ID). Use library_query to explore results with SQL.

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 publication_year ">2021".

Use autocomplete first to resolve author / source / institution / publisher / funder names to their OpenAlex IDs, then pass those IDs to the corresponding filter parameters below.

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 search_keyword / search_semantic instead.

Results are automatically added to the local library (UPSERT by work ID). Use library_query to explore results with SQL.

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 search_keyword / search_semantic to resolve author, journal, institution, publisher, or funder names to their OpenAlex IDs. Then pass the ID to the corresponding filter parameter of the search tool.

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 search_cnki for CNKI (theses, Chinese journals) or search_keyword for English queries.

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; page above 1 pages through the loose results.

Results are automatically added to the local library (UPSERT by work ID). Use library_query to explore results with SQL.

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:

  • arxiv: arXiv preprints (use English keywords).

  • crossref: freshly registered journal articles and proceedings.

  • pubmed: PubMed through NCBI E-utilities (biomedicine).

  • preprints: bioRxiv/medRxiv/Research Square via Europe PMC. Its host is often slow, so it may time out; retry it alone with sources="preprints" when it matters.

  • semantic_scholar: Semantic Scholar; set SEMANTIC_SCHOLAR_API_KEY for reliable limits (anonymous access is often rate-limited).

A hit that shares a DOI with an OpenAlex work is stored as that OpenAlex work (id W...); the rest keep source-prefixed ids such as arxiv:2401.12345, pmid:12345678, doi:10.1016%2F.... Read native-record papers with summarize_paper + fetch_fulltext=true; query everything with library_query.

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 ~/.AI-CACHE/openalex/collections/{target}.

Use this as the FINAL step — after iteratively screening with library_query and confirming the papers you want.

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 不应 调用本工具——尤其是 work_ids="*" 会清空整个库(含论文与来源)。 没有用户明确的删库指令时,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:

  • Explore schema: SELECT name FROM sqlite_master WHERE type='table'; PRAGMA table_info(<table>)

  • Count / filter: SELECT count(*) FROM works WHERE ...

  • Plain queries: read-only SQLite SELECT / WITH / EXPLAIN queries — joins, aggregations, window functions, etc.

  • Keyword relevance: FTS5 bm25() ranking over title, abstract, and full text (see below).

Schema: works — id, doi, title, publication_year, publication_date, type, cited_by_count, is_oa, oa_status, has_content, abstract, language, source_id, source_name, authors_json, concepts_json, keywords_json, referenced_works, related_works, raw_json. sources — id, display_name, host_organization, issn_l, issn, type, alternate_titles, abbreviated_title, homepage, works_count, cited_by_count, is_oa, is_in_doaj, topic.

Work ids are OpenAlex ids (W...) or, for hits that OpenAlex does not index, source-prefixed ids from search_multi (arxiv:..., pmid:..., doi:...).

Full-text search: the works_fts FTS5 index covers title, abstract, and fulltext. Use MATCH with bm25() ranking (lower is better): 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 'sensor AND fusion' ORDER BY rank LIMIT 20

Chinese full-text search: CJK text is indexed as character bigrams, so wrap Chinese keywords with cjk_fts instead of quoting them (中文关键词必须用 cjk_fts 包裹): ... WHERE works_fts MATCH cjk_fts('锂电池 极耳') ORDER BY rank

WAL mode allows concurrent reads + writes — library_query does not block search_keyword / search_ids and vice versa. Database-level read-only enforcement rejects mutations even when they are hidden inside a CTE. WITH RECURSIVE is rejected (an unterminated recursion would starve the shared read connection), and any single statement is interrupted after 30 seconds. Use LIMIT and bounded substr() expressions when selecting large columns such as fulltext or raw_json.

Output is capped: BLOB columns render as <BLOB N bytes>, very long text values are cut with an in-band <truncated: ...> marker, and results over 200 rows or 200,000 chars are trimmed. A trimmed result is returned as an object with rows, truncated, and notes instead of a bare array. Project only the columns you need.

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: pdf_url links recorded on the work, arXiv, the Elsevier Article Retrieval API (needs ELSEVIER_API_KEY plus the campus subscription; works for paywalled Elsevier articles). Only when all of those fail: Unpaywall, the DOI landing page's citation_pdf_url tag, Semantic Scholar, and last the paid OpenAlex Content API (content.openalex.org, $0.01 per PDF; the reported cost counts paid downloads only). CNKI records are downloaded one page at a time in the local browser under the machine's institutional access: at most 5 per call, because CNKI restricts batch downloads. Some theses offer CAJ only. Batches with CNKI entries return a job_id on verification or after 20 seconds. Ordinary PDFs in that batch continue. Ask the user to verify in the original window and say “继续” within 4 minutes. Resume the batch with cnki_job(job_id) or cancel with action='cancel'.

STRICT RULE: PDFs must be saved to ~/.AI-CACHE/openalex/pdfs/ by default. Leave save_to_project=false unless the user explicitly asks to save PDFs in the project directory. Never infer this from context, an Agent preference, or a requested arbitrary path. When explicitly requested, save_to_project=true saves only to the fixed <project>/pdfs/ directory; arbitrary output paths are impossible. Already-downloaded files are skipped to avoid unnecessary charges.

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 ELSEVIER_API_KEY. Uses Elsevier's Abstract Retrieval API and returns the full abstract text when available. If update_library is true, fetched abstracts are written back into works.abstract. Existing local abstracts are preserved unless overwrite is true.

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 A → B means A cites B. Only works in work_ids become nodes; only citations where BOTH papers are in the list are kept (induced subgraph).

work_ids 必填:不填/为空会报错。请先用 library_query 选出目标 论文,再把它们的 ID 列表传进来。例如:

SELECT id FROM works WHERE publication_year > 2023 ORDER BY cited_by_count DESC LIMIT 100

返回 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_analyze,先用 library_query 选出论文。方向语义:in = 谁引用了它;out = 它引用了谁; both = 两者都列(默认)。

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 ~/.AI-CACHE/openalex/graphs/ — open the returned path in a browser.

Visual encoding:

  • color = publication year (light = older, dark = newer)

  • label = first-author surname + year on prominent/hovered nodes

  • size = cited-by count (robust log-scaled)

  • edge brightness = local citation-structure strength

  • short force-directed settling animation, then physics auto-freezes

  • click for amber highlight; hover syncs the right detail panel

  • in-page filters: search box (title/author/ID), year range, and community dropdown dim non-matching nodes and hide their edges

work_ids 必填:同 graph_analyze。建议 30~120 篇。超过 120 篇时, 可视化会按被引量、PageRank、集合内被引用次数和奠基性年份自动截取重要论文; 完整集合分析仍可用 graph_analyze。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 21 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count4/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues