MCP Zotero

io.github.Xevos117由 GitHub 账号 Xevos117 发布v2.0.4更新于 Nov 2, 2026

Unofficial Zotero server: search your library, add papers by DOI, import PDFs, cite in Word

概览

AI 生成的概览

非官方 Zotero MCP 服务器,让助手搜索和整理 Zotero 文库、按 DOI 添加论文、导入 PDF、读取全文,并向 Word 文档注入引用。

可以做什么
  • 浏览与检索文库:列出分类、查看分类中的条目、按查询或字段排序检索、批量获取元数据、读取 PDF 全文
  • 添加内容:按 DOI 添加论文并解析元数据、添加任意 Zotero 类型的条目、创建分类、从网址导入 PDF、自动附加开放获取 PDF、添加链接网址附件
  • 删除内容:永久删除条目或删除分类,仅在显式开启时可用
  • 引用与文档:以 APA、IEEE、Vancouver、Harvard 或 Chicago 格式向 Word 文档注入实时 Zotero 引用,并读取已配置的用户 ID
适用场景
适合撰写或管理学术参考文献的场景:希望助手直接操作你的 Zotero 文库,查找文献、按 DOI 添加论文、附加 PDF、获取全文,或生成带实时引用的 Word 文档。
运行要求
通过 npx 以 stdio 在本地运行(需 Node.js 22 或更高版本),也可作为 Claude Desktop 扩展包安装。需要具备文库读写与文件访问权限的 Zotero Web API 密钥(ZOTERO_API_KEY)和数字用户 ID(ZOTERO_USER_ID);群组文库可选设 ZOTERO_LIBRARY_TYPE 与 ZOTERO_LIBRARY_ID,开放获取 PDF 查找需 UNPAYWALL_EMAIL,允许删除需设 UNSAFE_OPERATIONS。需要访问 Zotero API 的网络连接。
安装前请注意
该 API 密钥拥有文库读写与文件访问权限;单次调用可覆盖文库设置,使助手能访问密钥可及的任何文库,因此应尽量缩小密钥权限范围。删除默认被禁止;将 UNSAFE_OPERATIONS 设为 items 或 all 会允许永久删除条目,且不会进入 Zotero 回收站。引用注入会读写磁盘上的 .docx 文件,Unpaywall 邮箱会发送给第三方 API。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MCP Zotero,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Zotero

Note: This is an unofficial community project and is not affiliated with, endorsed by, or supported by the Zotero team or the Corporation for Digital Scholarship. "Zotero" is a registered trademark of the Corporation for Digital Scholarship.

A Model Context Protocol server for Zotero integration. It gives any LLM full access to your Zotero library: search, organize, add papers by DOI, import PDFs, read full-text content, and inject live citations into Word documents.

Originally based on mcp-zotero by Abhishek Kalia. This project has since been extensively rewritten with a new architecture, 15 tools (up from 5), citation injection, PDF management, and Claude skill support.

How it works

The server is designed to be usable by any LLM without external documentation. On connection, it sends workflow instructions via the MCP instructions field, and each tool description includes cross-references and usage guidance. An LLM that has never seen this server before can discover the full workflow — from adding papers to producing a cited Word document — directly from the tool listing.

For advanced use cases (PDF upload policy, citation style guidance, source transparency), a Claude skill is included for Claude.ai Projects. But the skill is optional: the MCP server is fully self-documenting.

Local vs Remote LLMs

ScenarioMCP serverSkill needed?
LLM with filesystem access (Claude Code, LM Studio, etc.)All 15 toolsNo
LLM without filesystem access (Claude.ai Projects, Claude Desktop)API tools (search, add, metadata)Yes, for citation injection

LLMs with filesystem access can use all tools directly, including inject_citations which reads and writes .docx files on disk.

LLMs without filesystem access — including Claude Desktop, which connects to MCP but cannot generate files locally — can use the included Claude skill (skills/zotero-skill-mcp-integrations/), which runs citation injection entirely inside a sandbox. MCP tools handle all Zotero API operations; the skill handles document assembly.

Claude Skill Setup (for Claude.ai Projects and Claude Desktop)

  1. Download the skill .zip from the latest GitHub Release
  2. Extract it and upload the folder to your Claude.ai Project as a skill
  3. The skill enables citation injection directly inside the sandbox, without requiring local filesystem access

Setup

Requires Node.js 22 or newer.

The server is listed in the official MCP Registry as io.github.Xevos117/mcp-zotero (starting with the first release after 2.0.2), so registry-aware clients can find and install it from there; the configuration below works with any MCP client.

  1. Get your Zotero credentials:

    bash
    # Create an API key at https://www.zotero.org/settings/keys# (enable library read/write + file access)# Then retrieve your user ID:curl -H "Zotero-API-Key: YOUR_API_KEY" https://api.zotero.org/keys/current
  2. Set environment variables:

    bash
    export ZOTERO_API_KEY="your-api-key"export ZOTERO_USER_ID="user-id-from-curl"export UNPAYWALL_EMAIL="[email protected]"   # Optional: enables OA PDF lookup via Unpaywallexport UNSAFE_OPERATIONS="none"           # Optional: "none" | "items" | "all" (see below)

Targeting a group library

By default the server targets your personal Zotero library (/users/<ZOTERO_USER_ID>/...). To target a group library instead, set two additional environment variables:

VariableValuesRequired?Default
ZOTERO_LIBRARY_TYPEuser | groupNouser
ZOTERO_LIBRARY_IDnumeric library IDYes when type=group; otherwise falls back to ZOTERO_USER_ID—

Example for a group library:

ZOTERO_API_KEY=...ZOTERO_USER_ID=12345               # optional for groups: used by get_user_id and per-call library_type="user"ZOTERO_LIBRARY_TYPE=groupZOTERO_LIBRARY_ID=6178978          # the group ID

The API key in ZOTERO_API_KEY must have access to the target group library — generate or scope keys at https://www.zotero.org/settings/keys.

The server refuses to start if ZOTERO_LIBRARY_TYPE=group is set without ZOTERO_LIBRARY_ID, or if a library ID is not numeric.

Per-call library override

Every tool accepts two optional args that override the env defaults for that single call:

  • library_type — "user" or "group"
  • library_id — numeric library ID

Resolution order: per-call arg > env var > implicit default (user, ZOTERO_USER_ID). library_id must be numeric. Overriding library_type to group on a server configured for a user library requires library_id; overriding to user on a group server without library_id uses ZOTERO_USER_ID.

Note that per-call overrides let the LLM reach any library the API key can access. Scope the key to the libraries you want exposed; deletions remain gated by UNSAFE_OPERATIONS.

This lets a single MCP instance target multiple libraries (e.g., a staging group and a final-output group) without restarting:

jsonc
// First call targets the staging group{  "tool": "add_items",  "args": {    "items": [...],    "library_type": "group",    "library_id": "5597114"  }}
// Second call targets DART-output (different group){  "tool": "add_items",  "args": {    "items": [...],    "library_type": "group",    "library_id": "6178978"  }}

Environment Variables

VariableRequiredDescription
ZOTERO_API_KEYYesAPI key for Zotero Web API v3. Create one at zotero.org/settings/keys with library read/write and file access permissions.
ZOTERO_USER_IDYesYour Zotero numeric user ID. Retrieve it with curl -H "Zotero-API-Key: KEY" https://api.zotero.org/keys/current.
UNPAYWALL_EMAILNoEmail for Unpaywall API requests (rate-limit policy). Enables OA PDF lookup in add_items_by_doi and find_and_attach_pdfs. If not set, OA PDF features are silently skipped.
UNSAFE_OPERATIONSNoControls destructive operations (deletion). See Unsafe Operations below. Default: none (all deletions blocked).

Unsafe Operations

By default, the MCP server does not allow any deletion. This is a safety measure to prevent an LLM from accidentally deleting items or collections from your library.

To enable deletion, set the UNSAFE_OPERATIONS environment variable to one of the following values:

Valuedelete_itemsdelete_collectionUse case
none (default)BlockedBlockedSafe mode — no deletions possible
itemsAllowedBlockedAllow deleting items but protect collection structure
allAllowedAllowedFull access — items and collections can be deleted

Important notes:

  • If UNSAFE_OPERATIONS is not set, empty, or set to an unrecognized value, it defaults to none.
  • The value is case-insensitive (e.g. ALL, Items, NONE all work).
  • delete_items deletes items permanently: the Zotero Web API multi-item DELETE does not move them to the Zotero trash, so they cannot be restored from the desktop client.
  • delete_collection removes the collection (folder) only — items inside it are not deleted and remain in your library.
  • The all value includes both item and collection deletion because managing collections inherently requires item-level access.

Configuration example:

json
{  "mcpServers": {    "zotero": {      "command": "npx",      "args": ["-y", "@xevos117/mcp-zotero"],      "env": {        "ZOTERO_API_KEY": "YOUR_API_KEY",        "ZOTERO_USER_ID": "YOUR_USER_ID",        "UNSAFE_OPERATIONS": "items"      }    }  }}

Integration with Claude Desktop

Install as a Claude Desktop extension (one click)

  1. Download mcp-zotero.mcpb from the latest release (available from the first release after 2.0.2).
  2. Open the file with Claude Desktop (macOS or Windows; e.g. double-click it) and confirm in the installation dialog. The bundle itself is not platform-specific (manifest.json lists macOS, Windows and Linux, and CI runs it on Linux), so other MCPB-compatible clients can install it too.
  3. Fill in your Zotero API key and Zotero user ID (see Setup). Optional settings: library type and group ID (for a group library), the email for Unpaywall (open-access PDF lookup) and which deletions are allowed (default: none, see Unsafe Operations).

The extension bundles the server and all its dependencies, so no npm install is needed. It needs Node.js 22 or newer (compatibility.runtimes.node in the manifest): according to the MCPB documentation, Claude Desktop runs Node.js extensions with the runtime that ships with the app. The API key is declared as a sensitive setting (masked input, stored securely by the client). Deletions stay disabled unless you change Deletions allowed in the extension settings.

The extension contains only the MCP server: the Claude skills in skills/ (citation injection inside the sandbox, scientific writing) are installed separately from their .zip files in the same release, as described in Claude Skill Setup.

Manual configuration (any MCP client)

Add to your Claude Desktop configuration (or the equivalent file of another MCP client):

json
{  "mcpServers": {    "zotero": {      "command": "npx",      "args": ["-y", "@xevos117/mcp-zotero"],      "env": {        "ZOTERO_API_KEY": "YOUR_API_KEY",        "ZOTERO_USER_ID": "YOUR_USER_ID",        "UNPAYWALL_EMAIL": "YOUR_EMAIL"      }    }  }}

Integration with Claude Code

bash
claude mcp add zotero -e ZOTERO_API_KEY=YOUR_API_KEY -e ZOTERO_USER_ID=YOUR_USER_ID -- npx -y @xevos117/mcp-zotero

Add -e UNPAYWALL_EMAIL=... or -e UNSAFE_OPERATIONS=items as needed, and --scope user to make the server available in every project (the default local scope covers only the current project). From a clone of this repository, npx tsx src/server.ts runs the server from source instead (see Development).

Available Tools

Library browsing

ToolDescription
get_collectionsList all collections (folders) with keys, names, and parent relationships
get_collection_itemsGet items in a specific collection with keys, titles, authors, dates
search_librarySearch by query, or list items sorted by field (date, title, etc.)
get_items_detailsBatch metadata retrieval for multiple items — returns all type-specific fields (bookTitle, proceedingsTitle, university, etc.), the authors string and the structured creators; keys not in the library are listed in not_found
get_item_fulltextGet full-text content of a PDF attachment via Zotero's fulltext index

Adding content

ToolDescription
add_items_by_doiAdd papers by DOI with automatic metadata resolution. Auto-attaches OA PDFs via Unpaywall
add_itemsAdd items with direct metadata — supports all 37 Zotero item types (books, theses, reports, etc.), batch-capable
create_collectionCreate a new collection, optionally nested under a parent
import_pdf_to_zoteroDownload a PDF from URL, upload to Zotero storage, auto-index full text
find_and_attach_pdfsBatch OA PDF lookup and auto-attach via Unpaywall (by item keys or collection)
add_linked_url_attachmentAttach a URL to an existing item or create a standalone link

Deleting content

ToolDescription
delete_itemsPermanently delete up to 50 items per call (not moved to the Zotero trash). Requires UNSAFE_OPERATIONS=items or all
delete_collectionDelete a collection (folder). Items inside are kept. Requires UNSAFE_OPERATIONS=all

Citation & documents

ToolDescription
inject_citationsInject live Zotero citations into a Word document. Supports APA, IEEE, Vancouver, Harvard, Chicago. Output is saved in the same folder as the input file with a _cited suffix (e.g. paper.docx → paper_cited.docx)
get_user_idReturns the configured Zotero user ID

Development

bash
npm installnpm run build          # Compile TypeScriptnpm test               # Unit and per-tool tests (vitest, fetch faked, ~1000 tests)npm run test:e2e       # Built server over stdio against a local fake Zotero APInpm run smoke          # Quick stdio smoke test of the built server (user + group library)npm run bundle         # Claude Desktop extension: dist/mcp-zotero.mcpb (production dependencies only)npm run smoke -- --bundle dist/mcp-zotero.mcpb   # smoke test of the unpacked bundle, started from its manifestnpx tsx src/server.ts  # Run directly without building

Testing

LayerCommandRuns onWhat it covers
Unit / per toolnpm testevery PR (Node 22, 24, 26)every tool through a real MCP client, Zotero faked at the fetch level; produced .docx files are validated against the official CSL schemas and rendered with citeproc-js (test/helpers/docx-validate.ts)
E2E + smokenpm run test:e2e, npm run smokeevery PRthe compiled server over stdio, user and group libraries
Livenpm run test:live (workflow, shared with the agent smoke test)PRs from this repository, main, weekly (Friday), manual runsthe real Zotero Web API on a dedicated test account (test/live); skipped unless ZOTERO_TEST_API_KEY is set
Agent smokeworkflow, after the live suite passedPRs from this repository, manual runs (e.g. on main after a merge)a Claude Code agent uses the server like a user, following the versioned skill .claude/skills/test-mcp-zotero: inject_citations ⇄ inject.js parity in every style, fixed edge cases and up to 5 exploratory scenarios on what the PR changes. The workflow sets up the MCP server, the tool set and guard hooks (Bash allowlist, delete policy, audit log); local runs use the same pieces (test/live/agent/README.md). The verdict comes from test/live/verify-claims.mjs, not from the agent; each run writes a Job Summary (verdict, scenarios, exploratory findings, friction, turns/cost/duration) and keeps one comment on the PR up to date, both scrubbed of anything that identifies the test account
Wordmanualevery releasetest/WORD_CHECKLIST.md: open an injected document in Word with the Zotero plugin

Every test case is listed in test/TEST_CASES.md.

Live tests locally use only ZOTERO_TEST_* variables, never your ZOTERO_API_KEY:

bash
ZOTERO_TEST_API_KEY=... ZOTERO_TEST_USER_ID=... [email protected] npm run test:live

Against a personal library add ZOTERO_LIVE_SAFE_MODE=1: the suite only creates items and collections named mzt-<runId>… and tagged mzt-run:<runId>, deletes only those, and skips collection deletion and group writes. A dedicated test account is marked by a collection named __mzt_disposable__.

Dependencies are updated monthly by a Claude Code agent (workflow, skill .claude/skills/deps-update); patch-only PRs are auto-merged after all required checks pass, anything else waits for review. GitHub Actions versions are updated by Dependabot.

CI setup (repository owner)

EnvironmentSecretsVariables
zotero-live (live tests, agent smoke)ZOTERO_TEST_API_KEY, ZOTERO_TEST_USER_ID, ZOTERO_TEST_USERNAME, ZOTERO_TEST_GROUP_ID (optional), UNPAYWALL_EMAILANTHROPIC_FEDERATION_RULE_ID, ANTHROPIC_ORGANIZATION_ID, ANTHROPIC_SERVICE_ACCOUNT_ID, ANTHROPIC_WORKSPACE_ID
claude-deps (dependency agent)—the same four ANTHROPIC_* variables (the federation rule may differ)

The agents authenticate to the Claude API with Anthropic Workload Identity Federation (GitHub OIDC, no API key). Recommended: one federation rule per environment, as narrow as possible:

Rule forsubject (exact, no *)claims (exact string pairs)condition (CEL)
zotero-liverepo:Xevos117/mcp-zotero:environment:zotero-liverepository_id: 1152178663, repository_owner_id: 86290818claims.job_workflow_ref.startsWith("Xevos117/mcp-zotero/.github/workflows/claude-agent-smoke.yml@") (PR runs use the PR ref)
claude-depsrepo:Xevos117/mcp-zotero:environment:claude-depsrepository_id: 1152178663, repository_owner_id: 86290818, job_workflow_ref: Xevos117/mcp-zotero/.github/workflows/deps-update.yml@refs/heads/main—

Claims are exact-match string pairs (only subject_prefix supports a trailing *), so a prefix such as "this workflow on any ref" must be written as a CEL condition, as above; an exact job_workflow_ref (claude-deps, main only) can be a plain claim.

Audience https://api.anthropic.com. The subject is an exact match unless it ends with *; jobs that use an environment get the OIDC subject repo:Xevos117/mcp-zotero:environment:<environment>, so a rule written for a branch or PR subject never matches. Numeric ids (not names) keep a renamed or re-created repository/account from matching.

Trade-off for zotero-live: the "any ref" condition is needed for the agent smoke test to run on pull requests, but it also accepts a modified copy of that workflow file pushed to any branch of this repository (only people with write access can push). Pinning it to the exact claim job_workflow_ref: Xevos117/mcp-zotero/.github/workflows/claude-agent-smoke.yml@refs/heads/main closes that gap but disables the agent smoke test on PRs (it would then run only on manual runs from main).

Other owner settings:

  • The Zotero test account needs a collection named __mzt_disposable__.
  • Repository settings: "Allow auto-merge", and "Allow GitHub Actions to create and approve pull requests" (the dependency workflow opens its PR with GITHUB_TOKEN). Keep the ruleset at 0 required approvals: auto-merge of the dependency PR relies on it, and it is also what makes the second setting acceptable. That setting is a conscious trade-off: it lets workflows open PRs (needed) and approve them (not used by any workflow here); if approvals are ever required, it would let a workflow approve its own PR, so revisit it together with any approval requirement.
  • No GitHub App is used by any workflow (the agents authenticate to Anthropic with Workload Identity Federation and use only GITHUB_TOKEN on GitHub, read-only for the agents). If the Claude GitHub App is installed on this repository, uninstall it.
  • Set a monthly spend limit on the Anthropic workspace used by the federation rules: it is the real cap on agent costs.
  • Residual risk: the agent smoke job that holds the OIDC token also runs the MCP server built from the PR's code (that is what it tests). It runs only for same-repository PRs by the owner or a bot, the token is bound to the zotero-live environment and the workspace spend limit caps any misuse.
  • Required checks after the stack merges: test (node 22), test (node 24), test (node 26), live-tests, agent-smoke.

Releasing

  1. Update CHANGELOG.md (move Unreleased to the new version) and the version in package.json, in server.json (version and packages[0].version) and in manifest.json (npm test fails if they differ).
  2. Make sure CI, live tests and the agent smoke test are green on main.
  3. Run the manual Word checklist on a document injected by the release candidate and record the results in its log.
  4. Before the first release that ships the Claude Desktop extension (and whenever manifest.json or the Node.js requirement changes): build it with npm run bundle, install dist/mcp-zotero.mcpb once in a real Claude Desktop (macOS or Windows), fill in a test key and user ID, and check that the 15 tools appear and get_collections answers.
  5. Publish the GitHub release: the release workflow runs the tests, publishes to npm, publishes server.json to the MCP Registry and attaches the skill zips and the Claude Desktop extension (mcp-zotero.mcpb). The release tag must be the version (e.g. 2.0.3): the registry and bundle jobs check out the tag and fail if package.json differs.
  6. If only the mcp-registry job fails, use Re-run failed jobs on the run: Re-run all jobs stops at the npm publish (the version already exists) and so never reaches the registry.

Debug with MCP Inspector

bash
npx @modelcontextprotocol/inspector npx tsx src/server.ts

License

MIT - see LICENSE for details.

来源:README.md,提交 bc154a9

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

2
  1. v2.0.4最新Oct 26, 2026
  2. v2.0.3Oct 21, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。