54yyyu/zotero-mcp/zotero-cli
Claude Code and agent skill by 54yyyu/zotero-mcp
- community
Checking that the SKILL.md file is still in the repository.
Read and write a Zotero library from the shell with the `zotero-cli` command - search papers by keyword or meaning, read PDF full text and page ranges, get and set metadata, manage collections, tags, notes and annotations, add items by DOI/URL/ISBN, and export bibliographies. Use whenever the user asks about their Zotero library, references, citations, papers they have saved, or their reading notes.
Install
npx vskill@latest install 54yyyu/zotero-mcp/zotero-cliSKILL.md
The same SKILL.md was published earlier as 54yyyu/zotero-mcp/zotero-cli.
Zotero from the shell
When you have shell access, prefer zotero-cli for direct library access.
Before using the library, check settings and read access.
config displays settings. ok: true from get recent confirms read access even when the library is empty. On failure, report error.message. Check ZOTERO_DB_PATH for a custom SQLite location, the running app and enabled API for local API reads, or ZOTERO_API_KEY and ZOTERO_LIBRARY_ID for web reads. SQLite reads can work with Zotero closed. Local API writes require running Zotero, an enabled local API, and write authorization.
Always pass --json when you will read the output
Default output is markdown for humans. --json gives you one object per invocation with a stable shape, so you never parse prose:
Both go to stdout; [INFO]/[WARN] diagnostics go to stderr. Check ok before using data. Run zotero-cli --json-schema for the full contract.
The core loop
Almost every task is: find keys → act on keys. Item keys are 8 characters and are the currency of every command.
Pipe keys straight into the next call:
Choosing a search mode
| Mode | Use it for | Command | |
|---|---|---|---|
items (default) | a title, author or phrase you know | search "Vaswani attention" | |
semantic | a topic or idea, no exact wording | search --mode semantic "why transformers scale" | |
tag | items you filed under a tag | search --mode tag "to-read,important" | |
advanced | structured field conditions | search --mode advanced --conditions '[...]' | |
citekey | a BibTeX citation key | search --mode citekey smith2020 | |
notes | text inside your notes, not item fields | search --mode notes "research question" |
semantic needs the search index built (zotero-cli db status to check, zotero-cli db update to build). If it is empty, fall back to items and say why rather than reporting no results.
If zotero-cli db status shows an "Index migration" section, the index was built by an earlier version, with its passages in the article-level ChromaDB collection. Search still works; go ahead. Tell the user once, with the steps it lists, and that only the update in the last step embeds anything (billed with a paid embedding API). Ask before running any of it; never migrate on your own.
Every search covers one library — the active one. When you don't know which library holds something, or a search comes up empty and the item might live in a group library, add --all-libraries:
Each result is then labelled **Library:** <name>. It needs the SQLite backend, the default in local mode, and errors clearly if it is not in use, so try it once and fall back to per-library searches if it is refused. Tag filters work with it; --collection does not, because a collection lives inside one library.
Reading efficiently
get fulltext on a book-length PDF returns a great deal of text. When you need one section, use the outline to find it and read only those pages. To locate a passage by its words, --find returns the matching pages with short snippets instead of the pages themselves:
For "what does my library say about X", prefer search --mode semantic followed by targeted get metadata over reading whole papers.
Paging
Listings cap at --limit. When more exists, the response says so and names the next offset:
Keep going until data.count is less than --limit.
Writing
Write commands report what they did as text under data.text.
Note text is Markdown, converted to Zotero's note format: headings, lists, tables, code, links (zotero:// ones stay clickable), $math$ and $$display$$, plus <u>, <s>, <sub>, <sup>, <mark> and <span style="color: red"> or background-color (red, orange, yellow, green, purple, magenta, blue, gray, or #hex). Pipe long text with --text -. HTML starting with <p>/<div> is kept to the note editor's tags, so a note read with notes list --raw-html, edited and written back with notes update keeps its citations and images; notes update --append adds to the end.
add is idempotent by default: re-running files the existing item into the named collection rather than creating a duplicate. Use --if-exists skip to never touch an existing item.
To file a PDF you have: add doi DOI --attach-file PATH -c COLL --tags T adds, files and attaches it in one call. add folder DIR -c COLL does that per PDF, reading the DOI from the metadata and page 1; a missing or ambiguous DOI is listed, never guessed.
Before a destructive change (delete, duplicates merge, a batch over many items), confirm with the user and show what will be affected. delete item refuses notes unless --allow-note is passed.
Reading and annotating a paper
When the user is reading along in Zotero and asks where something is, point the reader at it with open rather than only quoting a page number. annotations create --open does both in one step.
Extracted text is reliable for prose and unreliable for math, figures and tables: symbols drop out and table cells run together. read flags each page where that happens ("Garbled in this text: Equation (1), Table 2"). For those pages, look at the page itself if you can view images:
To annotate, plan everything, check it, then write it in one run:
zotero-cli --json layout ATTACHMENT_KEYlists figure, table and
equation boxes with their captions and a paste-ready rect_arg; --panels adds a box per panel letter (A, B, C ...) when the text has them; check low ones by eye (an L-shaped panel or ink cut at a neighbour).
- Write one JSON object per line: `{"page": 4, "text": "exact words",
"comment": "...", "color": "yellow"} for a highlight (add "underline": true to underline instead), or {"page": 3, "rect": "x,y,w,h", "comment": "..."} for a box, or {"page": 1, "note": "x,y", "comment": "..."} for a sticky note centered on a point (its text is the comment). Copy highlight text exactly from read; it is searched for on that page and two pages either side. A miss lists the nearest candidates. "rect": "auto" with "near": "x,y,w,h" tightens the hint to the panel or figure under it, moving no edge more than 0.03 and never into another entry's box; a snap that would go further keeps your hint (printed as kept hint, snap too large`).
zotero-cli annotations batch --attachment-key ATTACHMENT_KEY --file plan.jsonl --dry-run
shows the words each highlight would cover. Fix every miss. --render DIR also draws the plan as it would be stored; look at the PNGs.
- Run it again without
--dry-run. Anything that did not land is listed
under data.results with ok: false, and the exit code is 1.
A re-run duplicates unless --on-existing skip|replace (matches page plus the first 40 characters of comment). Check what is stored with annotations preview --attachment-key K --out DIR (PNGs of the real boxes) and annotations list --positions (stored rects). Fix an area box in place, same key: annotations update KEY --rect x,y,w,h (or --page N). Zotero draws an area box's sidebar thumbnail only when something asks for it (the reader, or annotations list). If thumbnails stay missing and the CLI warns that Zotero failed to render one, restart Zotero; the boxes themselves are stored correctly.
Colors take Zotero's names: yellow, red, green, blue, purple, magenta, orange, gray.
Writes in local mode need a one-time zotero-mcp authorize-local (Zotero 10 or newer) or web API credentials. A write refused for that reason says so.
When something looks wrong
- Empty search results: confirm read access as above. For semantic mode,
check the index with zotero-cli db status.
ok: false: readerror.message. It names the cause.- A partial-results note on a search means the scan was cut short, not that
nothing else matched. Narrow the query and re-run.
- An item marked
"deleted": trueis in the trash. Do not treat it as part
of the live library.
Full command reference
reference.md in this skill directory lists every command and flag. Read it when you need something not covered above. zotero-cli <command> --help also works for any single command.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/zotero_mcp/skills/zotero-cli/SKILL.md
Popularity
- Repository stars
- 4,954
- Repository forks
- 391
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Oct 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/54yyyu/zotero-mcp/zotero-cli)