Skip to main content
Glama

zotero-mcp-local-write

License: MIT Python 3.11+

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

uvx --from git+https://github.com/ozbayenes123-ops/zotero-mcp-local-write.git zotero-mcp

Option 2 — Install permanently

pipx install git+https://github.com/ozbayenes123-ops/zotero-mcp-local-write.git

Option 3 — From source (development)

git clone https://github.com/ozbayenes123-ops/zotero-mcp-local-write.git
cd zotero-mcp-local-write
uv run zotero-mcp

Configuration

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

ZOTERO_LIBRARY_ID

yes (web mode)

Your user or group library ID

ZOTERO_LIBRARY_TYPE

no (default user)

user or group

ZOTERO_API_KEY

yes (web mode)

API key from zotero.org settings

ZOTERO_LOCAL

no

Set true to force local API mode

Tools

Reading (upstream)

Tool

Description

zotero_search_items

Search the library by text query

zotero_item_metadata

Full metadata of one item, grouped and formatted

zotero_item_fulltext

Indexed full text of an item's attachment (e.g. PDF)

Writing (this fork)

Collections

Tool

Description

zotero_list_collections

List all collections as a tree

zotero_list_collection_items

List top-level items in a collection

zotero_create_collection

Create a collection (optionally nested)

zotero_delete_collection

Delete a collection (items stay in the library)

zotero_add_items_to_collection

Add items to a collection

zotero_remove_items_from_collection

Remove items from a collection

Items

Tool

Description

zotero_create_item

Create a new item (journalArticle, book, …)

zotero_change_item_type

Change item type (e.g. journalArticle → bookSection)

zotero_update_item_fields

Update fields of one item

zotero_bulk_update_fields

Field patch across many items in one call

zotero_delete_items

Move items to trash (recoverable)

Notes & annotations

Tool

Description

zotero_create_note

Create a standalone or child note (HTML)

zotero_update_note

Replace a note's content

zotero_create_annotation

Highlight / note / image / ink annotation on a PDF

Saved searches

Tool

Description

zotero_create_saved_search

Create a dynamic saved search

zotero_update_saved_search

Update name and/or conditions

zotero_delete_saved_search

Delete a saved search

zotero_run_saved_search

Execute a saved search

Files

Tool

Description

zotero_upload_file

Attach a local file (stored-file attachment)

zotero_download_file

Download a stored attachment to disk

zotero_write_fulltext

Write indexed full text so zotero_item_fulltext can find it

Tags, trash, settings, groups, sync

Tool

Description

zotero_list_tags

List all tags with item counts

zotero_delete_tag

Delete a tag from every item

zotero_list_trash

List trashed items

zotero_restore_items

Restore items from trash

zotero_empty_trash

Permanently delete everything in trash

zotero_list_settings

List library settings

zotero_set_setting

Set one library setting

zotero_list_groups

List group libraries the user belongs to

zotero_list_changes

Incremental sync — what changed since a library version

Example workflow

"Organize my machine-learning papers":

  1. zotero_search_items — find the papers

  2. zotero_create_collection — create "Machine Learning"

  3. zotero_add_items_to_collection — move them in

  4. zotero_create_note — attach a summary note to each

  5. zotero_create_annotation — highlight the key claim in the PDF

  6. zotero_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; sse is 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 tools
zotero_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_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_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_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_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

    A3.9/5.0

    Scored across 33 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness3/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      8
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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.
      -