zotero-mcp-local-write
Provides tools for managing a Zotero library, including searching items, retrieving metadata and fulltext, creating and organizing collections, adding and updating items, notes and annotations, saved searches, file attachments, tags, trash, settings, groups, and incremental sync.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@zotero-mcp-local-write Create a collection called 'AI Papers' and add the item I just imported."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
zotero-mcp-local-write
Model Context Protocol (MCP) server for Zotero — based on kujenga/zotero-mcp, extended with a full set of write tools so an AI assistant can actually organize your library, not just read it.
The upstream project covers searching and formatting. This fork keeps all of that and adds
writes.py (~1,200 lines): collections, items, notes, annotations, saved searches, file
uploads, tags, trash, settings, groups, and bulk/version-aware operations — all over the
local Zotero API, so nothing leaves your machine.
33 tools total: 3 read (from upstream) + 30 write (new in this fork)
Works with the local API — no API key, no cloud sync required
Idempotent writes (each request carries a
Zotero-Write-Token)Version-aware write-key authorization flow for the local API
Requirements
Zotero 7+ with the local HTTP server enabled (Settings → Advanced → check "Allow other applications on this computer to communicate with Zotero")
Python 3.11+ (only if installing from source)
An MCP client: Claude Desktop, Claude Code, Cursor, or any MCP-compatible assistant
Related MCP server: zotero-local-mcp
Installation
Option 1 — Run without installing (recommended)
uvx --from git+https://github.com/ozbayenes123-ops/zotero-mcp-local-write.git zotero-mcpOption 2 — Install permanently
pipx install git+https://github.com/ozbayenes123-ops/zotero-mcp-local-write.gitOption 3 — From source (development)
git clone https://github.com/ozbayenes123-ops/zotero-mcp-local-write.git
cd zotero-mcp-local-write
uv run zotero-mcpConfiguration
Local API (recommended, no API key needed)
Set ZOTERO_LOCAL=true to use Zotero's local HTTP server. The server authenticates
itself against Zotero's local API and requests a write key on first write.
Generic mcp.json / Claude Code:
{
"mcpServers": {
"zotero": {
"command": "uvx",
"args": ["--from", "git+https://github.com/ozbayenes123-ops/zotero-mcp-local-write.git", "zotero-mcp"],
"env": { "ZOTERO_LOCAL": "true" }
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"zotero": {
"command": "zotero-mcp",
"args": [],
"env": { "ZOTERO_LOCAL": "true" }
}
}
}Web API (optional)
If you prefer the Zotero Web API (writes go to zotero.org), set:
Variable | Required | Description |
| yes (web mode) | Your user or group library ID |
| no (default |
|
| yes (web mode) | API key from zotero.org settings |
| no | Set |
Tools
Reading (upstream)
Tool | Description |
| Search the library by text query |
| Full metadata of one item, grouped and formatted |
| Indexed full text of an item's attachment (e.g. PDF) |
Writing (this fork)
Collections
Tool | Description |
| List all collections as a tree |
| List top-level items in a collection |
| Create a collection (optionally nested) |
| Delete a collection (items stay in the library) |
| Add items to a collection |
| Remove items from a collection |
Items
Tool | Description |
| Create a new item (journalArticle, book, …) |
| Change item type (e.g. journalArticle → bookSection) |
| Update fields of one item |
| Field patch across many items in one call |
| Move items to trash (recoverable) |
Notes & annotations
Tool | Description |
| Create a standalone or child note (HTML) |
| Replace a note's content |
| Highlight / note / image / ink annotation on a PDF |
Saved searches
Tool | Description |
| Create a dynamic saved search |
| Update name and/or conditions |
| Delete a saved search |
| Execute a saved search |
Files
Tool | Description |
| Attach a local file (stored-file attachment) |
| Download a stored attachment to disk |
| Write indexed full text so |
Tags, trash, settings, groups, sync
Tool | Description |
| List all tags with item counts |
| Delete a tag from every item |
| List trashed items |
| Restore items from trash |
| Permanently delete everything in trash |
| List library settings |
| Set one library setting |
| List group libraries the user belongs to |
| Incremental sync — what changed since a library version |
Example workflow
"Organize my machine-learning papers":
zotero_search_items— find the paperszotero_create_collection— create "Machine Learning"zotero_add_items_to_collection— move them inzotero_create_note— attach a summary note to eachzotero_create_annotation— highlight the key claim in the PDFzotero_list_changes— confirm what was modified since your last sync
How local writes work
The Zotero 7 local API requires a write key separate from normal read access.
On the first write, the server performs Zotero's local authorization flow, caches the
key locally, and re-uses it; every write request additionally carries a
Zotero-Write-Token (a UUID) so retried requests cannot duplicate changes.
Deletes are soft by default: zotero_delete_items moves to trash, and
zotero_restore_items recovers. Only zotero_empty_trash is permanent.
Troubleshooting
"Connection refused" / empty results — make sure Zotero is running and the local API is enabled in Zotero's settings.
Permission errors on write — Zotero shows an authorization prompt the first time; accept it, or check the library is not set to read-only.
Transport — use
--transport stdio(default) for most clients;sseis available for web-based clients:zotero-mcp --transport sse.
Credits & license
Built on kujenga/zotero-mcp by Aaron Taylor
(read layer: client.py, cli.py and the formatting/search core in __init__.py),
licensed under the MIT License, which is preserved here.
The write layer (writes.py) and all local-API integration were added in this fork.
Available Tools
33 toolszotero_add_items_to_collectionA
Add one or more items to a collection. An item can live in multiple collections; this never removes it from others. Use zotero_list_collections to get keys.
Inputs: item_keys (required), collection_key (required). Returns: result
zotero_bulk_update_fieldsA
Apply a field patch to MANY items in one call (e.g. fixing a hundred titles). Each entry: {'key': 'ABCD1234', 'fields': {...}}. Same semantics as zotero_update_item_fields per item; each request carries its own Zotero-Write-Token for idempotency.
Inputs: updates (required). Returns: result
zotero_change_item_typeA
Change an item's type (e.g. journalArticle -> bookSection). Zotero silently drops fields that do not exist on the new type, so pass field_map to move values across, e.g. {'publicationTitle': 'bookTitle'}. The old values stay in the new fields when the names map.
Inputs: item_key (required), new_item_type (required), field_map. Returns: result
zotero_create_annotationA
Create an annotation on a PDF attachment: a highlight, a note annotation, an image, or ink. annotation_position is the page placement as a JSON object, e.g. {'pageIndex': 0, 'rects': [[x1, y1, x2, y2]]} in PDF coordinates. Attach to the ATTACHMENT key (the PDF), not the parent item. Returns the new annotation's key.
Inputs: attachment_key (required), annotation_type (required), annotation_position (required), page_label, +4 more. Returns: result
zotero_create_collectionA
Create a new collection (folder) in the Zotero library, optionally nested under a parent collection. Returns the new collection's key.
Inputs: name (required), parent_key. Returns: result
zotero_create_itemA
Create a new empty item in the library, e.g. a journalArticle, book, report, or webpage. Pass only the fields you want set (title, date, creators, ...). Use zotero_item_metadata on an existing item to see valid field names for its type. Returns the new item's key.
Inputs: item_type (required), tags, fields, collection_keys. Returns: result
zotero_create_noteA
Create a note. With parent_item_key it becomes a child note of that item; without it, a standalone note. Content is HTML, e.g. 'text'. Returns the new note's key.
Inputs: note_html (required), tags, parent_item_key. Returns: result
zotero_create_saved_searchA
Create a saved (dynamic) search that Zotero keeps in the left sidebar and that re-evaluates automatically. Conditions format: [{'condition': 'title', 'operator': 'contains', 'value': 'x'}]. Common conditions: title, creator, date, tag, publicationTitle, abstractNote, itemType; common operators: contains, doesNotContain, is, isNot, beginsWith, isBefore, isAfter. Returns the new search's key.
Inputs: name (required), conditions (required), join_mode. Returns: result
zotero_delete_collectionA
Delete a collection. The collection's items are NOT deleted from the library unless delete_items=true — by default they just lose this folder.
Inputs: collection_key (required), delete_items. Returns: result
zotero_delete_itemsA
Move items to Zotero's trash (recoverable via zotero_restore_items). Note: the local API's true DELETE is permanent, so this tool marks the items deleted instead; to purge permanently, list the trash and empty it with zotero_empty_trash. Use for duplicates. Requires confirm=true.
Inputs: item_keys (required), confirm. Returns: result
zotero_delete_saved_searchA
Delete a saved search. Its items are untouched (a saved search is just a query).
Inputs: search_key (required). Returns: result
zotero_delete_tagA
Delete a tag from every item that carries it. Implemented by rewriting each affected item's tags (the local API has no direct tag-delete endpoint); a few hundred items is fine, tens of thousands is not.
Inputs: tag (required). Returns: result
zotero_download_fileA
Download an item's stored attachment file from Zotero to a path on disk. Works for imported_file attachments (pass the attachment key, or a parent item to auto-pick its best attachment). Link-mode attachments have no stored file.
Inputs: item_key (required), save_path (required). Returns: result
zotero_empty_trashA
Permanently delete EVERY item in the trash. This cannot be undone. Requires confirm=true.
Inputs: confirm. Returns: result
zotero_item_fulltextA
Get the full text content of a Zotero item, given the item key of a parent item or specific attachment.
Inputs: item_key (required). Returns: result
zotero_item_metadataA
Get the complete metadata for a specific Zotero item, given the item key. Includes the citation key, publication details, identifiers, and timestamps.
Inputs: item_key (required). Returns: result
zotero_list_changesA
Track what changed since a version: returns key -> version for every item, collection, or search modified since the given library version. Use since=0 (or omit) for everything, and feed the returned highest version back next time.
Inputs: since, object_type. Returns: result
zotero_list_collection_itemsA
List the top-level items (works) in a collection, with key, type, title, and date. Use to review a collection's contents before moving items in or out. Child attachments/notes are not listed.
Inputs: collection_key (required), limit. Returns: result
zotero_list_collectionsA
List all collections (folders) in the Zotero library as a tree, with each collection's key, name, parent, and item count. Use these keys with the other write tools to organize your library.
Inputs: no named parameters. Returns: result
zotero_list_groupsA
List the Zotero group libraries the logged-in user belongs to (read-only metadata; group CONTENTS are maintained by the server, not locally).
Inputs: no named parameters. Returns: result
zotero_list_settingsA
List all library settings stored in Zotero, as JSON.
Inputs: no named parameters. Returns: result
zotero_list_tagsA
List tags used across the library, with how many items carry each. Use 'prefix' to list only tags starting with a string.
Inputs: limit, prefix. Returns: result
zotero_list_trashA
List items currently in Zotero's trash (deleted but recoverable).
Inputs: limit. Returns: result
zotero_remove_items_from_collectionA
Remove one or more items from a collection. This only takes them out of that folder; the items stay in the library and in any other collections they belong to.
Inputs: item_keys (required), collection_key (required). Returns: result
zotero_restore_itemsA
Restore items from the trash back into the library.
Inputs: item_keys (required). Returns: result
zotero_run_saved_searchA
Execute a saved search and return the matching top-level items. This is a LOCAL-API-ONLY capability: the Zotero Web API exposes saved searches as metadata but cannot run them.
Inputs: search_key (required), limit. Returns: result
zotero_search_itemsA
Search for items in your Zotero library. Returns a summary of each match; look up individual results with zotero_item_metadata or zotero_item_fulltext.
Choosing a query mode:
'titleCreatorYear' (the default) searches titles, creator names, and years. Use it for known-item lookup, where you know roughly what the item is called or who wrote it.
'everything' additionally searches abstracts, the Extra field, note text, and the full text of attachments. Use it for topic and full-text search, where the term would not appear in a title.
Words match by prefix, and space-separated words must all be present though not necessarily adjacent, so 'cybor insect' matches 'Cyborg Insect'. A hyphen separates words and switches the match to OR: 'oxygen-deprived' matches anything containing 'oxygen' or 'deprived', which is far broader than intended. Write hyphenated terms with a space to require both halves.
Inputs: query (required), tag, limit, qmode. Returns: result
zotero_set_settingA
Set one library setting (a key under /settings), e.g. syncing metadata used by plugins. Overwrites the previous value.
Inputs: value (required), setting (required). Returns: result
zotero_update_item_fieldsA
Update fields of an item, e.g. to fix a missing title, date, publication, or abstract, or to set tags (tags: [{'tag': 'x'}]). Pass only the fields to change; everything else is untouched. Use zotero_item_metadata first to see the current values. Collections are NOT edited here — use the dedicated collection tools.
Inputs: fields (required), item_key (required). Returns: result
zotero_update_noteA
Replace a note's content with new HTML. The old content is overwritten; fetch it first with zotero_item_metadata if you need to edit rather than replace.
Inputs: note_key (required), note_html (required). Returns: result
zotero_update_saved_searchA
Update a saved search's name and/or its conditions. Only the parts you pass are changed; conditions are replaced wholesale when provided.
Inputs: search_key (required), name, conditions. Returns: result
zotero_upload_fileA
Attach a local file to an item: creates a stored-file (imported file) child attachment and uploads the file into it. If you pass an attachment key instead, the file is uploaded to that existing attachment (fails if one is already stored). Supported for imported-file attachments, not linked URLs.
Inputs: filepath (required), item_key (required), title, filename. Returns: result
zotero_write_fulltextA
Write (or replace) an attachment's indexed full-text content so zotero_item_fulltext and full-text search can read it. Use for attachments whose text Zotero could not extract (scans, exotic formats) — pass the text you extracted yourself.
Inputs: content (required), item_key (required), indexed_pages. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Tools are organized around clear resource types (collections, items, notes, saved searches, tags, trash), and descriptions clarify edge cases like delete vs trash. A few near-homophones—item_fulltext vs write_fulltext, delete_collection vs delete_items—require careful reading but do not genuinely overlap.
The zotero_ prefix and verb_noun pattern dominate, with consistent create/update/delete/list pairs across resources. However, zotero_item_metadata and zotero_item_fulltext drop the verb, and write_fulltext reads more like a noun compound, so the pattern is not uniform.
33 tools is on the high side for an MCP server, though the number is justified by the breadth of Zotero's domain—items, collections, notes, annotations, saved searches, files, tags, trash, settings, groups, and change tracking. Still, it feels more like a full SDK than a curated tool surface.
Core CRUD/lifecycle coverage is strong, but there are notable gaps: saved searches cannot be listed, collections cannot be updated or renamed, and annotations are create-only with no update/delete path. These create minor dead ends for agents despite workarounds via item deletion and field updates.
Maintenance
Related MCP Connectors
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Academic literature search, retrieval, and private library management on top of OpenAlex.
Federated search of books and papers, BibTeX/RIS citations, open-access retrieval and reading.
Research paper search with real citations and reference formatting for AI assistants
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to search, read, and manage Zotero references locally with customizable research workflows.942 PyPI4MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to search, browse, and cite a local Zotero 7 library with zero configuration and no API key, keeping all data on the user's machine.8MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to search a Zotero library, retrieve complete metadata for specific items, and access the full text of PDFs through either the local Zotero API or the Zotero Web API.-
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to search a Zotero library, retrieve complete item metadata, and read the full text of attached PDFs through the Zotero desktop app's local API or the Zotero Web API.-