zotero-local-api-mcp
Provides tools for interacting with a local Zotero desktop library, including searching and retrieving items, browsing collections and tags, exporting BibTeX, and optionally creating or deleting items and collections through Zotero's local API.
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-local-api-mcp search my Zotero library for items tagged machine-learning and export them as BibTeX"
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-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
mcpSDK)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 |
| read | Local API reachability + Zotero version |
| read | Search by text, tag, item type, collection |
| read | Full metadata of one item |
| read | Notes and attachments of an item |
| read | All collections |
| read | Items in a collection |
| read | Tags used in the library |
| read | BibTeX export, optionally filtered by query |
| write | Create items from JSON (accepts full Zotero item schema) |
| write | Create a (nested) collection |
| write | Move an item to trash |
| write | Delete a collection |
The Zotero 10 write handshake (for implementers)
Documented here because most guides predate it:
Every response carries a
Zotero-Server-IDheader (stable per database). All write requests must echo it back — missing →428, mismatched →412.POST /api/local/authorizewith{"appName": "..."}and the Server-ID header opens a consent dialog in Zotero and returns{"key": "...", "remember": bool}.Writes send
Zotero-Server-ID+Zotero-API-Key(+X-Zotero-Write-Tokenon POST/PUT).DELETE/PUTadditionally requireIf-Unmodified-Since-Version: <current item version>.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 stdioLicense
MIT — see LICENSE.
Available Tools
12 toolscreate_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
Scored across 12 tools
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.
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.
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.
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
Related MCP Connectors
Remote MCP server for full read/write access to a Zotero library
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Search, read and cite documents. Add, replace and delete files with write access. OAuth required.
Federated search of books and papers, BibTeX/RIS citations, open-access retrieval and reading.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables read and write access to a Zotero library via its Web API, allowing search, create, update, and delete of items, notes, and collections.121MIT
- AlicenseAqualityCmaintenanceProvides read-only access to your local Zotero library via the Zotero Local API, enabling search, retrieval, and bibliography generation without API keys.10MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to read, search, and fully manage a Zotero library locally—organizing collections, editing items, uploading files, and managing notes, tags, and trash—through the local Zotero API without cloud sync.331MIT
- AlicenseNot gradedqualityCmaintenanceEnables interaction with a locally running Zotero Desktop library via MCP, including search, collections, tags, BibTeX export, citations, attachment full-text lookup, and explicitly confirmed write operations.MIT