Skip to main content
Glama
zotero-local-api-mcp

zotero-local-api-mcp

by Matcraft94

zotero-local-api-mcp

An MCP server for your local Zotero desktop library: read and write, entirely offline, with zero configuration.

Servidor MCP para la biblioteca Zotero local del escritorio: lectura y escritura, 100% offline, sin cuentas ni claves de zotero.org.

Why another Zotero MCP?

Zotero 10 added write support to its built-in local HTTP API (127.0.0.1:23119), including a proper local-authorization handshake. This server uses it directly:

  • No zotero.org account, no web API key, no cloud round trip

  • No Zotero plugin to install

  • Reads are instant (~10 ms, loopback)

  • Writes go through Zotero's own consent dialog — you approve each application once, inside Zotero

  • Pure Python, stdlib HTTP client (only runtime dependency: the mcp SDK)

  • BibTeX export of any search, straight from the local API

Related MCP server: Local Zotero MCP

Requirements

  • Zotero 10 or newer, running, with Settings → Advanced → "Allow other applications on this computer to communicate with Zotero" enabled

  • Python 3.10+ (or just uvx)

Install & run

From the repo (no clone needed):

// e.g. Claude Desktop / any MCP client config
{
  "mcpServers": {
    "zotero": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Matcraft94/zotero-local-api-mcp",
               "zotero-local-api-mcp"]
    }
  }
}

Hermes Agent:

mcp_servers:
  zotero:
    command: "uvx"
    args: ["--from", "git+https://github.com/Matcraft94/zotero-local-api-mcp",
           "zotero-local-api-mcp"]

Enabling writes

By default the server is read-only. To allow creating/deleting items, start it with ZOTERO_MCP_WRITES=1. The first write then triggers a dialog inside Zotero asking to authorize the app:

  • Allow → one-time key, valid for that single request

  • Always Allow → persistent key, cached in ~/.cache/zotero-local-api-mcp/key.txt (0600); no more prompts

{
  "mcpServers": {
    "zotero": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Matcraft94/zotero-local-api-mcp",
               "zotero-local-api-mcp"],
      "env": { "ZOTERO_MCP_WRITES": "1" }
    }
  }
}

Tools

Tool

Kind

Description

ping

read

Local API reachability + Zotero version

search_items

read

Search by text, tag, item type, collection

get_item

read

Full metadata of one item

get_item_children

read

Notes and attachments of an item

list_collections

read

All collections

list_collection_items

read

Items in a collection

list_tags

read

Tags used in the library

export_bibtex

read

BibTeX export, optionally filtered by query

create_items

write

Create items from JSON (accepts full Zotero item schema)

create_collection

write

Create a (nested) collection

delete_item

write

Move an item to trash

delete_collection

write

Delete a collection

The Zotero 10 write handshake (for implementers)

Documented here because most guides predate it:

  1. Every response carries a Zotero-Server-ID header (stable per database). All write requests must echo it back — missing → 428, mismatched → 412.

  2. POST /api/local/authorize with {"appName": "..."} and the Server-ID header opens a consent dialog in Zotero and returns {"key": "...", "remember": bool}.

  3. Writes send Zotero-Server-ID + Zotero-API-Key (+ X-Zotero-Write-Token on POST/PUT). DELETE/PUT additionally require If-Unmodified-Since-Version: <current item version>.

  4. Authorization prompts are rate-limited to 5/minute (HTTP 429).

Development

uv venv && uv pip install -e ".[test]"
pytest            # live tests against your running Zotero (self-cleaning)
python -m zotero_local_api_mcp.server   # run the server over stdio

License

MIT — see LICENSE.

Available Tools

12 tools
create_collectionC

Create a collection (optionally nested under parent_key).

Inputs: name (required), parent_key. Returns: result

create_itemsB

Create one or more Zotero items. items_json is a JSON array of objects, each with at least itemType and title, e.g. [{"itemType": "journalArticle", "title": "...", "creators": [{"creatorType": "author", "firstName": "A", "lastName": "B"}], "DOI": "10....", "date": "2024", "tags": [{"tag": "x"}]}]. Returns the keys of the created items.

Inputs: items_json (required). Returns: result

delete_collectionA

Delete a collection (items inside are kept, moved to library root).

Inputs: key (required). Returns: result

delete_itemB

Move an item to the Zotero trash.

Inputs: key (required). Returns: result

export_bibtexB

Export items as a BibTeX bibliography (optionally filtered by a search query).

Inputs: q, limit. Returns: result

get_itemA

Get the full metadata of one item by its Zotero key.

Inputs: key (required). Returns: result

get_item_childrenC

List the notes and attachments (child items) of an item.

Inputs: key (required). Returns: result

list_collection_itemsC

List the top-level items directly inside a collection.

Inputs: collection_key (required), limit. Returns: result

list_collectionsA

List all collections in the local library.

Inputs: no named parameters. Returns: result

list_tagsC

List tags used in the library.

Inputs: limit. Returns: result

pingA

Check that Zotero's local API is reachable and enabled.

Inputs: no named parameters. Returns: result

search_itemsA

Search the local Zotero library by text (q), tag, item type and/or collection. Empty q lists recent items.

Inputs: q, tag, limit, item_type, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 12 tools

    Disambiguation4/5

    Each tool targets a clear resource+action pair, so an agent can easily pick between get_item, get_item_children, list_collections, and list_collection_items. The only mild overlap is between search_items (which accepts a collection filter) and list_collection_items, since both can enumerate items in a collection.

    Naming Consistency5/5

    All tools use a consistent snake_case verb_noun pattern (search_items, get_item, list_collections, create_items, delete_item, delete_collection). The sole exception is the conventional health-check name 'ping', which is idiomatic rather than inconsistent.

    Tool Count5/5

    Twelve tools is well within the ideal range and each one maps to a distinct library operation (search, read, list, export, create, delete). There is no obvious filler or redundant tool in the set.

    Completeness3/5

    The surface covers discovery, reading, creation, and deletion, but there is no update/edit tool for items or collections, and no way to create notes or manage tags/attachments directly. These gaps force agents to delete-and-recreate instead of editing metadata in place.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers