Zotero-MCP
Provides access to a Zotero library, allowing AI agents to read library items and insert live Zotero citation fields into Word documents that remain linked to the Zotero items.
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 Insert a live Zotero citation for Vaswani et al. 2017 into my paper.docx"
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
An MCP server that gives Claude access to your Zotero library and lets it insert live Zotero citations into Word documents — real citation fields that Zotero owns, not text that merely looks like a citation.
That distinction is the whole point of this project, so it is worth being precise about it.
The problem this solves
Ask an assistant to "cite Vaswani et al. 2017" in a Word document and you
normally get a string of characters: (Vaswani et al., 2017). It looks right.
It is also dead. Zotero does not know it exists. Change your citation style
from APA to IEEE and it does not update. Add a source and the bibliography does
not renumber. Delete a reference and nothing tells you the citation is orphaned.
What you actually want is what Zotero's own Word plugin produces: a field that stays linked to the library item. This server writes those.
Related MCP server: zotero-mcp
Why it works this way: the Word integration problem
Zotero's Word plugin talks to Zotero over a private bridge — a COM/DLL channel
on Windows, AppleScript on macOS. It is not a public API, it is not documented
for third parties, and it is not designed to be driven by anything other than
Zotero itself. Calling the plugin's macro (ZoteroInsertCitation) opens the
interactive citation picker and waits for a human to click. There is no
supported, headless way to ask the plugin to insert a citation.
So driving the plugin was off the table. Three options remained:
Approach | Verdict |
Automate the Word plugin via COM / macros | Not viable. The insert path is interactive by design; anything built on it breaks between Word and Zotero versions. |
Generate formatted text with a CSL processor | Easy, but produces exactly the dead citations described above. Rejected. |
Write Zotero's field codes directly into the | ✅ What this project does. |
The third approach works because a Zotero citation in a .docx is not magic.
It is an ordinary Word field whose instruction text looks like this:
ADDIN ZOTERO_ITEM CSL_CITATION {"citationID":"a1b2c3","properties":{…},
"citationItems":[{"id":"…","uris":["http://zotero.org/users/123/items/ABCD1234"],
"itemData":{…CSL-JSON…}}],"schema":"…csl-citation.json"}Plus an ADDIN ZOTERO_BIBL … CSL_BIBLIOGRAPHY field for the bibliography, and
a set of hidden ADDIN ZOTERO_PREF_1…N fields recording which CSL style the
document uses.
Reproduce those payloads exactly — the item URIs, the CSL-JSON, the schema URL, the preference blob's chunking — and Zotero cannot tell the difference. It adopts the citations as its own. Refresh, Add/Edit Bibliography and switching styles all behave normally.
No Word automation. No COM. No open Word instance. Just the file.
What this costs you (read this part)
Being honest about the trade-offs, because they are real:
The document must be closed in Word. Word holds a lock and would overwrite our edits when it saves. The server detects the
~$file.docxlock and refuses rather than losing your work. A.docx.bakbackup is written beside the file on every change..docxonly. Legacy.docand OpenDocument.odtare not supported. LibreOffice uses a different field representation (ReferenceMarks); support could be added but is not there yet.The first Refresh in Word is what makes it exact. We pre-render the visible citation text so the document reads correctly straight away, but multi-source citations, numeric styles and bibliography ordering follow rules only a full CSL processor gets perfectly right. One click of Zotero → Refresh hands that job to Zotero and normalises everything.
Footnote styles are a known limitation. Citations are inserted into the body text. For note-based styles (Chicago notes-bibliography and similar), Zotero will not migrate an in-text field into a real Word footnote. In-text styles — APA, MLA, Harvard, IEEE, Vancouver, Nature, AMA — work properly. The server warns you when it detects a note style.
Google Docs is not supported. It stores citations as links, a different mechanism entirely.
Architecture
Claude ──MCP/stdio──▶ zotero-mcp
├── reads ──▶ Zotero 7 local API (localhost:23119) [fast, no quota]
│ └─ falls back to ──▶ api.zotero.org
├── writes ──▶ Zotero Web API v3 [needs API key]
└── Word ──▶ .docx OOXML, direct field injection [no Word needed]Reads prefer the local API: it is instant, unmetered, and reflects changes you have not synced yet. It is read-only, so every write goes to the Web API. If Zotero is not running, reads transparently fall back to the web.
Quick start
Requires Python 3.10+ and Zotero 7.
1. Install
Windows
git clone https://github.com/RogerAylagas/Zotero-MCP.git
cd Zotero-MCP
.\scripts\setup.ps1macOS / Linux
git clone https://github.com/RogerAylagas/Zotero-MCP.git
cd Zotero-MCP
./scripts/setup.shThe script finds a suitable Python, builds the virtualenv, installs the
package, creates .env, and runs a health check.
Flag | Effect |
| Write the server into |
| Target a different config file. |
| Rebuild the virtualenv from scratch. |
| Skip the health check. |
2. Add your Zotero credentials
Fill in .env — details in Configure below — then run the script
again, or python scripts/doctor.py, until every line is green.
3. Connect it to Claude
These are the values Claude needs, whichever route you take:
Field | Value |
Command |
|
Arguments |
|
Environment |
|
The setup script prints them with your real paths already filled in.
Route A — the app's settings (recent builds). Recent Claude Desktop builds manage MCP servers and extensions through their own settings UI and an extensions marketplace, not through a config file. Look for Extensions or Connectors in Settings and add a local MCP server there using the values above. This is the supported route: nothing external competes for the file.
Route B — claude_desktop_config.json (older builds). Older builds read
the server list from a config file. setup.ps1 -Register writes it for you; see
Register with Claude manually for the JSON.
Quit Claude before using route B. Claude keeps that file in memory and rewrites it periodically, so an edit made while it is running is silently discarded minutes later — it looks like it worked and then quietly undoes itself. The script detects a running Claude and refuses rather than pretending to succeed.
If the entry keeps disappearing even with Claude closed, your build does not read that file at all. Use route A.
Afterwards, restart Claude and ask it to run zotero_check_setup.
A note on "starting" the server
There is no server to start. An MCP stdio server is not a daemon: Claude spawns
it on demand and talks to it over stdin/stdout, then shuts it down. So the
setup script's job is installing it and handing Claude the launch command —
after that the server starts itself whenever Claude needs it. If you launch
python -m zotero_mcp by hand it will just sit there waiting for JSON-RPC on
stdin, which is correct but not useful.
To check the server's health at any time:
.venv\Scripts\python.exe scripts\doctor.py # Windows.venv/bin/python scripts/doctor.py # macOS / LinuxIt tests each layer separately — configuration, local API, Web API, server startup — so a failure points at one specific thing.
Configure
cp .env.example .envThen fill in .env:
API key — create one at https://www.zotero.org/settings/keys/new. Tick Allow library access and Allow write access. Copy it into
ZOTERO_API_KEY.Library ID — the numeric Your userID for use in API calls shown at https://www.zotero.org/settings/keys. Into
ZOTERO_LIBRARY_ID.Local API (recommended) — in Zotero: Settings → Advanced → tick "Allow other applications on this computer to communicate with Zotero".
Your API key is a credential. Keep it in
.env(which is gitignored) and never paste it into a chat.
Register with Claude manually
setup.ps1 -Register does this for you. To do it by hand, add to your MCP
client configuration:
{
"mcpServers": {
"zotero": {
"command": "C:\\path\\to\\Zotero-MCP\\.venv\\Scripts\\python.exe",
"args": ["-m", "zotero_mcp"],
"env": {
"ZOTERO_MCP_ENV_FILE": "C:\\path\\to\\Zotero-MCP\\.env"
}
}
}
}Pointing at the .env file rather than copying ZOTERO_API_KEY into the config
keeps the credential in exactly one place — a gitignored file — instead of
duplicating it into a config file that is easy to share by accident. Individual
ZOTERO_* variables still work here if you prefer them; anything already in the
environment wins over the .env file.
Claude's config lives at:
Client | Path |
Claude Desktop (Windows) |
|
Claude Desktop (macOS) |
|
Claude Desktop (Linux) |
|
Restart Claude completely afterwards, then ask it to run zotero_check_setup —
it reports exactly what is configured, what is reachable, and what is missing.
Installing without the script
python -m venv .venv
.venv/bin/pip install -e . # .venv\Scripts\pip.exe on Windows
cp .env.example .envTools
Library — reading
Tool | Purpose |
| Diagnose configuration and connectivity. Start here. |
| Search by text, type, tag or collection. Returns item keys. |
| One reference in full, with its notes and attachments. |
| Browse collections and sub-collections. |
| Tags in the library. |
| Saved searches defined in Zotero. |
| Indexed full text of a PDF attachment. |
| Personal library plus group libraries. |
| Valid types and their fields. |
Library — writing
Tool | Purpose |
| Add a source from a DOI, arXiv id or ISBN. The fast path. |
| Create a reference field by field. |
| Edit fields, with version checking against concurrent edits. |
| Move to Zotero's trash (recoverable). |
| Child or standalone note. |
| Add tags without clobbering existing ones. |
| Attach a URL to a reference. |
| Organise the library. |
Citations
Tool | Purpose |
| Render citation/bibliography as plain text — for email, markdown, slides. Not for Word. |
| Browse CSL styles. |
Word — live citation fields
Tool | Purpose |
| Paragraph-by-paragraph map with indices. Read before inserting. |
| Insert a live |
| Build the |
| Set the document's CSL style. |
| Inspect the Zotero citations already in a document. |
| Remove a citation field. |
Typical session
You: Add the Vaswani attention paper to Zotero and cite it in
thesis.docxafter the sentence about sequence tasks.
What Claude does:
zotero_import_identifier("10.48550/arXiv.1706.03762")→ the reference is in your library, with proper metadata.word_document_outline("thesis.docx")→ reads the real paragraph text.word_insert_citation(..., anchor_text="…changed how we approach sequence tasks.")→ a live field appears exactly there.word_insert_bibliography("thesis.docx", heading="References").
Then you open thesis.docx in Word and click Zotero → Refresh. The
citations are Zotero's now: switch the style to IEEE and everything renumbers,
including the bibliography.
Development
pip install -e ".[dev]"
pytestThe test suite builds .docx files from scratch, so it runs without Word or
Zotero installed. The tests that matter most are in
tests/test_docx_fields.py: they assert that the field codes we emit parse
back correctly, that the preference blob chunks and reassembles the way Zotero
expects, and that saving a document leaves every package part we did not touch
byte-identical.
Layout
src/zotero_mcp/
├── server.py MCP server and setup diagnostics
├── config.py Environment configuration
├── context.py Shared client, path safety
├── zotero/
│ ├── client.py Hybrid local/web facade
│ ├── web.py Zotero Web API v3
│ └── local.py Zotero 7 local API
├── docxfields/
│ ├── ooxml.py Word field plumbing (fldChar/instrText runs)
│ ├── zotero_fields.py ZOTERO_ITEM / ZOTERO_BIBL / ZOTERO_PREF payloads
│ └── document.py High-level document operations
└── tools/ MCP tool definitions
scripts/
├── setup.ps1 One-command setup + registration (Windows)
├── setup.sh One-command setup + registration (macOS/Linux)
└── doctor.py Layer-by-layer health checkRoadmap
File attachment upload (the three-step Zotero upload protocol)
LibreOffice Writer field support
Real Word footnotes, unlocking note-based styles
Bundled CSL processor so multi-source citations render exactly before Refresh
License
MIT
Available Tools
27 toolsword_document_outlineA
Map a .docx paragraph by paragraph, so you can choose where to cite.
Returns each non-empty paragraph with its index and a text preview. Read this before inserting, so anchor text matches the document exactly.
Inputs: document_path (required), max_chars. Returns: object
word_insert_bibliographyA
Insert or refresh the bibliography field, built from the document's citations.
Reads every Zotero citation already in the document, renders the corresponding bibliography entries, and writes them into a live ZOTERO_BIBL field. An existing bibliography is replaced.
Args: document_path: Path to the .docx file. paragraph_index: Place the bibliography after this paragraph. Omit to append it at the end of the document. heading: Optional heading to insert above it, e.g. "References". style: Only used if the document has no Zotero style set yet.
Inputs: document_path (required), style, heading, paragraph_index. Returns: object
word_insert_citationA
Insert a live Zotero citation field into a Word document.
The inserted citation is a real Zotero field, not text: in Word, Zotero's Refresh will update it and changing the document style will reformat it.
The document must be CLOSED in Word. A .docx.bak backup is written next to it on every change.
Args: document_path: Path to the .docx file. item_keys: One or more Zotero item keys (from zotero_search). Pass several to build a single multi-source citation. anchor_text: Insert immediately after this exact text. Get it from word_document_outline so it matches the document character for character. Use this OR paragraph_index. paragraph_index: Insert at the start or end of this paragraph. position: "end" (default) or "start", used with paragraph_index. locator: Page or range to cite, e.g. "45" or "45-47". prefix: Text before the citation, e.g. "see also". suffix: Text after the citation. suppress_author: Omit the author, for "as Smith (2020) argued". style: CSL style for the document. Only applied if the document has no Zotero style set yet.
Inputs: item_keys (required), document_path (required), style, prefix, +6 more. Returns: object
word_list_citationsA
List the Zotero citations already present in a .docx.
Inputs: document_path (required). Returns: object
word_remove_citationA
Remove a Zotero citation field from a document.
Args: document_path: Path to the .docx file. citation_id: From word_list_citations. keep_text: Leave the rendered citation behind as plain text.
Inputs: citation_id (required), document_path (required), keep_text. Returns: object
word_set_citation_styleA
Set which CSL style a Word document uses.
This writes Zotero's document-preferences fields. After running it, open the document in Word and click Zotero > Refresh: every citation and the bibliography reformat into the new style automatically.
Args: document_path: Path to the .docx file. style: CSL style id, e.g. "apa", "ieee", "vancouver". Use zotero_list_styles to browse. locale: e.g. "en-US", "ca-AD", "es-ES".
Inputs: style (required), document_path (required), locale. Returns: object
zotero_add_noteA
Attach a note to a reference, or create a standalone note.
Args: text: Note content. Plain text is converted to simple HTML; if you pass HTML it is stored as-is. parent_item_key: Attach the note to this reference. Omit for a standalone note. tags: Tags for the note.
Inputs: text (required), tags, parent_item_key. Returns: object
zotero_add_tagsA
Add tags to a reference, keeping the tags it already has.
Inputs: tags (required), item_key (required). Returns: object
zotero_attach_linkA
Attach a web link to a reference.
This creates a link attachment (a URL), not an uploaded file. Uploading actual files is not supported yet -- drag them into Zotero directly.
Inputs: url (required), parent_item_key (required), title. Returns: object
zotero_check_setupA
Diagnose the connection to Zotero. Run this first if anything fails.
Inputs: no named parameters. Returns: object
zotero_create_collectionB
Create a collection (folder), optionally nested under another.
Inputs: name (required), parent_collection_key. Returns: object
zotero_create_itemA
Create a new reference in the Zotero library.
Args: item_type: e.g. "journalArticle", "book", "bookSection", "report", "thesis", "webpage". Call zotero_list_item_types to see all. title: The item title. creators: List of {"creatorType": "author", "firstName": "...", "lastName": "..."} or {"creatorType": "author", "name": "..."} for institutional authors. date: Publication date, e.g. "2024" or "2024-03-15". fields: Any other Zotero fields for this type, e.g. {"publicationTitle": "Nature", "volume": "620", "DOI": "10.1038/..."}. Use zotero_item_type_template to see which fields are valid. tags: Tag names to attach. collection_keys: Collections to file the item into.
Inputs: title (required), item_type (required), date, tags, +3 more. Returns: object
zotero_delete_itemA
Move a reference to the Zotero trash.
This is Zotero's normal delete: the item goes to the trash, where you can restore it. It is not an immediate permanent deletion.
Inputs: item_key (required). Returns: object
zotero_format_citationA
Render references as formatted citation and bibliography text.
Use this for previewing, or for output that is not a Word document (email, markdown, a slide). For Word documents use word_insert_citation instead, which inserts live Zotero fields rather than dead text.
Args: item_keys: Zotero item keys, from zotero_search. style: CSL style id, e.g. "apa", "ieee", "vancouver". Defaults to ZOTERO_DEFAULT_STYLE. locale: e.g. "en-US", "ca-AD", "es-ES".
Inputs: item_keys (required), style, locale. Returns: object
zotero_get_fulltextA
Read the indexed full text of an attachment (usually a PDF).
Zotero must have indexed the attachment. Pass an attachment key, not the parent reference key -- use zotero_get_item to find it.
Inputs: item_key (required), max_chars. Returns: object
zotero_get_itemA
Fetch one reference in full, including its notes and attachments.
Args: item_key: The 8-character Zotero item key. include_children: Also return child notes and attachments.
Inputs: item_key (required), include_children. Returns: object
zotero_import_identifierA
Look up a DOI, arXiv id or ISBN and save it as a Zotero reference.
This is the fastest way to add a source you have a citation for. The metadata comes from CrossRef (DOI/arXiv) or Open Library (ISBN).
Args: identifier: e.g. "10.1038/nature12373", "arXiv:2103.00020", "isbn:9780262033848". Bare identifiers are auto-detected. collection_keys: Collections to file the new item into. tags: Tags to attach.
Inputs: identifier (required), tags, collection_keys. Returns: object
zotero_item_type_templateA
Get the empty field template for an item type.
Call this before zotero_create_item when you are unsure which fields a type accepts (they differ a lot between, say, "thesis" and "bill").
Inputs: item_type (required). Returns: object
zotero_list_collectionsA
List collections (folders) in the library.
Args: parent_collection_key: List sub-collections of this collection. Omit for top-level collections.
Inputs: limit, parent_collection_key. Returns: object
zotero_list_item_typesA
List every item type Zotero supports.
Inputs: no named parameters. Returns: object
zotero_list_librariesA
List the personal library and any group libraries you can access.
Inputs: no named parameters. Returns: object
zotero_list_saved_searchesA
List the saved searches defined in Zotero.
Inputs: no named parameters. Returns: object
zotero_list_stylesA
List available CSL citation styles.
Args: query: Filter by substring, e.g. "chicago", "medical", "nature".
Inputs: query. Returns: object
zotero_list_tagsA
List tags used in the library, optionally filtered by a substring.
Inputs: limit, query. Returns: object
zotero_searchA
Search the Zotero library and return matching references.
Use this before citing anything, to find the item keys that the Word tools need.
Args: query: Free-text search. Leave empty to browse. item_type: Restrict to a type, e.g. "journalArticle", "book". Prefix with "-" to exclude, e.g. "-attachment". tag: Restrict to a tag. Supports "tagA || tagB" for OR. collection_key: Restrict to one collection. search_mode: "titleCreatorYear" (default) or "everything" to also search full text of attachments and notes. limit: Max results, 1-100. sort: dateModified, dateAdded, title, creator, date, or itemType. direction: "asc" or "desc". top_level_only: Skip notes and attachments that hang off an item.
Inputs: tag, sort, limit, query, +6 more. Returns: object
zotero_set_item_collectionsC
File a reference into collections, or take it out of them.
Inputs: item_key (required), add, remove. Returns: object
zotero_update_itemA
Change fields on an existing reference.
Only the fields you pass are modified. The item's current version is read first, so a concurrent edit in Zotero surfaces as a clear conflict rather than silently overwriting.
Args: item_key: The 8-character item key. changes: Fields to set, e.g. {"title": "...", "date": "2024"}. For tags pass {"tags": [{"tag": "x"}]} (this replaces all tags).
Inputs: changes (required), item_key (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Every tool targets a distinct resource or action. zotero_add_tags and zotero_update_item are differentiated by their replacement semantics, and the word_* tools are clearly separated from the zotero_* tools. No two tools appear to serve the same purpose.
The vast majority follow a consistent zotero_/word_ + verb_noun pattern (list_styles, create_item, insert_citation). Two exceptions, zotero_item_type_template and word_document_outline, are noun phrases rather than verb-first, but they remain readable and the overall convention is strong.
At 27 tools, the set is slightly above the typical 'heavy' range, but it covers two substantial domains: Zotero library management (items, collections, tags, notes, attachments) and Word citation integration. Each tool earns its place, so the count is justified.
The core CRUD lifecycle for items is complete (create, read, update, delete), and the Word integration workflow is fully covered. Minor gaps exist—no delete collection, no explicit tag removal, no file attachment upload—but these can be worked around (update_item replaces tags, attach_link covers links) and do not block primary usage.
Maintenance
Related MCP Connectors
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Remote MCP server for full read/write access to a Zotero library
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseAqualityDmaintenanceA server that enables MCP clients like Anthropic Claude App to interact with local Zotero libraries, allowing users to search papers, manage notes, and access research materials through natural language.1029Apache 2.0
- AlicenseAqualityDmaintenanceRead-only MCP server that lets Claude or any MCP client search and retrieve metadata, notes, full text, citations, and BibTeX from your local Zotero library via its built-in API.11MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives any MCP-compatible assistant access to your Zotero reference library, enabling search, citation, bibliography generation, and .docx processing while keeping Zotero as the ground truth for references.91MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that enables Claude Code to control the Zotero browser connector, automatically capturing web page papers into the local Zotero library.AGPL 3.0