Zotero Agent
Zotero Agent
English | 中文
Zotero Agent is a Zotero plugin that embeds an MCP (Model Context Protocol) server, turning your local Zotero library into a workspace an AI agent can fully operate — not just read.
It exposes 47 tools spanning library search & retrieval, Web of Science Starter search, metadata enrichment, identifier-based import (DOI / arXiv / ISBN / PMID), bulk bibliography import (BibTeX / RIS / CSL-JSON), preprint→published-version upgrade, DOI repair, grey-source PDF download (Sci-Hub / Anna's Archive), duplicate detection & merge, batch tagging, citation-graph expansion, annotation synthesis, and companion-plugin bridges (jasminum, Linter) — plus an escape-hatch run_javascript for arbitrary in-process automation beyond the built-in tools.
In practice, an AI assistant (Claude, Codex, …) talking to this server can search your library in natural language, clean up metadata and tags in bulk, import and de-duplicate papers, fetch missing PDFs, expand a topic through its citation graph, and synthesize your annotations — with dry-run-by-default safety on every write.
How to Use
Step 1: Install the Zotero Plugin
Download the latest
zotero-agent.xpifrom the Releases Page.Install it in Zotero through
Tools -> [gear icon] -> Install Plugin From File....Open
Editor -> Settings -> Zotero Agentand enable these permissions:Allow Remote Access
Enable Write Operations
Run JavaScript (eval)
Note:
Run JavaScript (eval)is used to run JavaScript inside Zotero so it can handle tasks that go beyond the built-in MCP tools. Enable it only when you need it.
Step 2: Configure Your AI Client
Get your token from Zotero -> Editor -> Settings -> Zotero Agent -> PSK.
Codex App
Go to Setting -> MCP Servers -> Add server, then use this configuration:
Field | Value |
MCP server name |
|
Transport |
|
URL |
|
Header Key: |
|
Header Key: |
|
Codex CLI
Edit %USERPROFILE%/.codex/config.toml or ~/.codex/config.toml:
[mcp_servers.zotero-mcp]
enabled = true
url = "http://127.0.0.1:23120/mcp"
http_headers = { Authorization = "Bearer <YOUR_PSK>", "Content-Type" = "application/json" }Claude Code
$env:ZOTERO_MCP_BEARER_TOKEN = "YOUR TOKEN"
claude mcp add --transport http zotero-mcp http://127.0.0.1:23120/mcp `
--scope user `
--header "Authorization: Bearer $env:ZOTERO_MCP_BEARER_TOKEN" `
--header "Content-Type: application/json"Note: If you install it inside this project and run it from this project directory, do not use
--scope user.
Step 3 (Optional): Recommended Companion Plugins
These plugins run alongside Zotero Agent — they're not bundled in, but once installed, the AI agent can drive them through the run_javascript tool (Zotero's privileged context can reach any installed plugin's API). Install the ones that match your workflow:
Plugin | What it does | How it pairs with this plugin / the agent |
Scrapes Chinese-database metadata (CNKI / Wanfang / VIP) for Chinese literature with incomplete fields. | This plugin's built-in enrichment targets Western sources (CrossRef / OpenAlex); jasminum fills the Chinese gap. After importing Chinese PDFs, the agent can trigger its scrape / filename-match via | |
Writes impact factor, JCR / CAS quartiles, and other journal metrics into items. | After | |
50+ metadata linters: title case, dates, pages, LTWA journal abbreviations, Chinese name / pinyin cleanup. | Complements | |
Multi-source metadata fill + multi-provider PDF discovery (Unpaywall / arXiv / CORE / …). | A heavier alternative to |
Let the agent install them for you. With run_javascript (eval) enabled, paste a prompt like this — trim the list to what you need:
Please install these Zotero companion plugins via
run_javascript. For each repo:fetchhttps://api.github.com/repos/<repo>/releases/latest, pick the asset whose name ends in.xpi, install it withAddonManager.getInstallForURL(url)theninstall.install(), and report each plugin's id / version / active state. Drop any I don't need:
jasminum (Chinese metadata: CNKI / Wanfang / VIP) —
l0o0/jasminumGreen Frog / updateifsE (impact factor & quartiles) —
redleafnew/zotero-updateifsELinter / format-metadata (format cleanup & journal abbreviations) —
northword/zotero-format-metadataZotadata (multi-source fill + PDF discovery) —
ydeng11/zotero-zotadata
Some plugins may need a Zotero restart to fully activate. Note: most of these are also searchable in the community Zotero Add-on Market plugin (e.g. format-metadata appears there as "Linter for Zotero"); a few (like zotadata) are GitHub-release-only.
See the Built on Open Source — Integration Status & Roadmap section below for how each is called today and which interactions we plan to promote into dedicated MCP tools.
Grey-source PDF Download (Sci-Hub / Anna's Archive)
On top of Zotero's built-in open-access resolvers, the plugin can use Sci-Hub / Anna's Archive as fallback PDF download sources.
Enable in the preferences panel. In Editor -> Settings -> Zotero Agent, turn on the Sci-Hub / Anna's Archive toggle. A source list appears pre-filled with sensible defaults (several Sci-Hub mirrors + Anna's Archive); you can add or remove sources, or restore the defaults. Sources register as manual-only resolvers — used only when you explicitly trigger a download, never in the background. Everything stays off by default.
Download. Once enabled, Zotero's native right-click Find Available PDF automatically includes these sources: Zotero tries free sources first (arXiv / open access) and falls back to the grey sources only when needed. You can also drive it through the MCP tools manage_pdf_resolvers (enable/disable and manage the source list) and find_missing_pdfs (audit which items lack a PDF, then fetch).
Compliance. Sci-Hub / Anna's Archive are grey-area sources. Legal compliance in your jurisdiction is your responsibility.
Web of Science Starter API
The optional search_web_of_science tool runs Web of Science advanced queries through Clarivate's Starter API and returns normalized bibliographic records. It uses your own API Key, stays off by default, and applies plan-aware serial throttling, a conservative local daily counter, and per-call safety caps. Results containing a DOI, PMID, or ISBN can be handed to the existing import_by_identifier tool.
People outside universities can apply for the Free Trial plan; institutional plans have separate subscription and approval requirements. See the Web of Science Starter API guide for eligibility, API Key setup, plan limits, security, and known quota-tracking limitations.
Development Setup
Clone the repository:
git clone https://github.com/psiQAQ/zotero-agent.git
cd zotero-agentSet up the plugin development environment:
npm install
npm run buildLoad the plugin in Zotero:
# For development with auto-reload
npm run start
# Or install the built .xpi file manually
# The xpi file will be generated at "./.scaffold/build/zotero-agent.xpi"
npm run buildMCP Tools
The table below is based on the actual tool definitions in src/modules/streamableMCPServer.ts.
Tool Name | Purpose |
| List the Zotero libraries available in the current client. |
| Search the Zotero library with filters such as title, year, full text, item type, and relevance scoring. |
| Search libraries by name. |
| Search highlights, notes, and comments by query, color, tag, or item scope. |
| Get detailed metadata for a specific Zotero item. |
| Get annotations and notes for a specific item or annotation ID. |
| Read full-text content from PDFs, attachments, notes, and abstracts. |
| List collections in the library, including recursive tree output when needed. |
| Search collections by name. |
| Get detailed information for a specific collection. |
| List items inside a specific collection. |
| Get child collections under a specific collection. |
| Create a new collection, optionally under a parent collection. |
| Rename or move an existing collection. |
| Delete a collection, with optional item deletion. |
| Add one or more items to a collection. |
| Remove one or more items from a collection without deleting them from the library. |
| Search across cached full-text document content and return matching passages. |
| Get the abstract or summary of a specific item. |
| Run embedding-based semantic search to find conceptually related content. |
| Find items that are semantically similar to a given item. |
| Show the status and index statistics of the semantic search service. |
| Access the cached full-text database with list, search, get, and stats actions. |
| Create, update, or append Zotero notes. |
| Add, remove, or replace tags on Zotero items. |
| Update item metadata such as title, abstract, DOI, date, or creators. |
| Create items, re-parent attachments, or import local files as attachments. |
| Execute JavaScript inside the Zotero process for advanced automation. |
| Reload an installed Zotero plugin for development workflows. |
| Install or upgrade a plugin XPI from a reachable URL or file path. |
| Search Clarivate Web of Science Starter API with an advanced query; applies plan-aware rate, daily, and per-call safeguards and returns normalized records for identifier-based import. |
| Import an item by DOI, arXiv ID, ISBN, or PMID. |
| Bulk-import BibTeX / RIS / CSL-JSON (auto-detected); idempotent dedup by DOI / title similarity; dry-run plan by default. |
| Report items without PDFs or fetch open-access PDFs for them. |
| Register Sci-Hub / Anna's Archive into Zotero's native PDF resolver pref (grey sources default automatic=false, manual-only); actual download is via find_missing_pdfs. |
| Mine DOI or arXiv ID from a PDF's fulltext cache using frequency voting. Read-only. |
| Reverse-lookup a DOI via CrossRef title-similarity (≥0.86 threshold), or |
| Fill missing fields (abstract/venue/volume/issue/pages/ISSN/publisher/date) from a DOI via doi.org CSL-JSON + OpenAlex; dry-run default, confirm write requires write.enabled. |
| Find the published version of arXiv-style preprints via OpenAlex title search and upgrade DOI/venue/date/itemType; old values backed up into Extra; dry-run default. |
| Check items against scite.ai editorial notices such as retractions or corrections. |
| Traverse the citation graph through OpenAlex to find citing or referenced papers. |
| Aggregate highlights and notes into a literature-review-oriented markdown bundle. |
| Detect duplicate items using Zotero's native duplicates engine. |
| Merge duplicate items into a chosen master item. |
| Run bulk tag operations such as add, remove, or rename. |
| Scrape CNKI/Wanfang/VIP metadata for top-level Chinese attachments & CNKI snapshots via the jasminum companion plugin (eligibility classification, hang-proof watchdog). |
| Run zotero-format-metadata (Linter) rules over items — title case, dates, journal abbreviations, Chinese name splitting; unknown rule ids rejected with the valid list. |
Built on Open Source — Integration Status & Roadmap
This plugin stands on the shoulders of several open-source projects: it forks a writable in-process MCP base and folds in the best ideas from ~17 reference projects (archived read-only as submodules under refs/). Full technical comparisons live in:
AI / MCP integration approaches — 5 projects
Metadata enrichment plugins — 8 projects
PDF download approaches — 4 projects
1. What this fork adds on top of the base
Forked from cookjohn/zotero-mcp — a clean, in-process, locally-writable MCP server (27 tools, direct saveTx/eraseTx). Our additions:
Area | cookjohn base | This fork adds |
Auth | loopback only | PSK Bearer auth + |
Eval | none |
|
Tools | 27 | 47 — +20 tools (Web of Science search, identifier & bulk-bibliography import, missing-PDF audit, citation graph, dedup, batch tags, metadata enrich, DOI reverse-lookup & repair, preprint upgrade, grey-source download, companion-plugin bridges, …) |
Search | keyword | + RRF hybrid semantic search, 0-result fallback ladder |
Testing | none | 31-scenario in-process selfTest + node unit tests (91 cases) |
Deploy | manual | one-shot |
i18n | zh / en | + de / es / fr / ja |
CJK | — | byte-level HTTP read fix (dense CJK bodies no longer mojibake) |
2. Capabilities absorbed from reference projects (integrated)
Ideas were re-implemented (not vendored) into native tools:
AI / MCP — see comparison
Source | Absorbed into | Status | TODO |
| ✅ | batch OA indexing | |
RRF hybrid | ✅ | WebGPU acceleration; Matryoshka dim truncation | |
| ✅ | screenshot / DOM-inspection tools for UI debugging |
Metadata — see comparison
Source | Absorbed into | Status | TODO |
| ✅ | — | |
| ✅ | — |
PDF — see comparison
Source | Absorbed into | Status | TODO |
| ✅ | multi-mirror rotation; stronger DOI extraction (scipdf's 5-regex + attachment scrape) |
3. Not integrated, but callable via run_javascript (interaction boundary + roadmap)
These plugins aren't folded into this one, but if the user installs them, an AI agent can drive them through run_javascript — which runs in Zotero's privileged context and can reach any installed plugin's exposed API. Current boundary and future dedicated-tool directions:
Plugin | Capability | Current agent boundary | TODO (dedicated tool) |
Chinese metadata scraping (CNKI / Wanfang / VIP) | ✅ dedicated tool | — | |
Impact factor / JCR & CAS quartiles | Call its easyScholar update path per item via |
| |
50+ format linters, LTWA journal abbreviation | ✅ dedicated tool | — | |
Multi-source fill + multi-provider PDF discovery | Call its retrieval pipeline via |
|
run_javascriptis the universal escape hatch: any installed plugin exposing functions on theZoteroobject (or a global) can be driven by the agent today. The TODO column is about promoting the most-used interactions into typed, dry-run-safe MCP tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/psiQAQ/zotero-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server