Zotero Native MCP

v1.0.2
io.github.dvdsosa/zotero-native-mcp Checked 1 day ago Published 1 month ago

Read and write your local Zotero 10 library.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

zotero_status Zotero connection status

Check that the local Zotero instance is running and reachable, and report its version, schema version, instance ID, and whether write access has been granted yet. Call this first when any other tool reports a connection or authorization problem.

zotero_authorize Request Zotero write access

Request a local API key so write tools (creating collections, items, and attachments) can run. This raises a modal dialog inside Zotero on the user's screen with three choices: "Allow" issues a single-use key, "Always Allow" issues a persistent one, and "Deny" refuses. Tell the user to expect the dialog, and to pick "Always Allow" for a session that will perform several writes. The key is stored locally and reused; write tools also re-authorize on their own when a single-use key is spent, so calling this manually is only needed to grant access up front. Calling it when a key is already stored…

ParameterTypeDescription
forcebooleanRequest a new key even though one is already stored. Rarely needed: a stored key is reused, and replacing a persistent key with a single-use one makes things worse.

zotero_list_libraries List libraries

List the personal library and every group library available locally. Use this to get the groupId that other tools take when the target is a group library rather than "My Library".

zotero_get_item_type_fields Describe an item type

List the valid field names and creator types for a Zotero item type, or list every item type when itemType is omitted. Call this before zotero_create_items with an unfamiliar item type: Zotero rejects a write outright if it carries a field the type does not define.

ParameterTypeDescription
itemTypestringItem type to describe, e.g. "journalArticle", "book", "thesis", "preprint". Omit to list all types.

zotero_list_collections List collections

List collections in a library. scope="all" returns every collection flat (each carrying its parentCollection key, so the full tree can be reconstructed in one call), "top" returns only root-level collections, and "children" returns the direct subcollections of parentKey. Collection keys returned here are what zotero_create_items, zotero_add_items_to_collection and zotero_search_items take.

ParameterTypeDescription
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
limitintegerMaximum number of objects to return (1-500).
parentKeystringParent collection key; required when scope is "children".
scopestringWhich collections to return. "children" requires parentKey.
startintegerZero-based offset for paging; pass the nextStart value from a previous call.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…

zotero_get_collection Get a collection

Fetch one collection by key, including its name, parent collection, item count and current version. The version is what zotero_update_collection and zotero_delete_collection use for conflict detection.

ParameterTypeDescription
collectionKey *stringCollection key, e.g. "WXYZ5678".
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…

zotero_create_collection Create collections

Create one or more collections, optionally nested under an existing collection. Up to 50 per call. Creating a nested tree takes one call per level, since a child needs its parent's key. Requires write access; zotero_authorize runs automatically if none has been granted.

ParameterTypeDescription
collections *arrayCollections to create, at most 50 per call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_update_collection Rename or move a collection

Rename a collection and/or move it under a different parent. Pass parentCollectionKey=null to move a collection to the root of the library. The current version is fetched automatically unless expectedVersion is given, in which case the write fails with a conflict if the collection changed in the meantime.

ParameterTypeDescription
collectionKey *stringKey of the collection to modify.
expectedVersionintegerVersion the collection is expected to be at, for conflict detection. Omit to use the current version.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
namestringNew name. Omit to leave the name unchanged.
parentCollectionKeyNew parent collection key, or null to move to the library root. Omit to leave the parent unchanged.

zotero_delete_collection Delete collections

Move collections to Zotero's trash, which is reversible and the default. The items inside are never deleted either way: they stay in the library and in any other collection they belong to. Subcollections follow their parent. Pass permanent: true only on an explicit request from the user, to erase the collections outright with no way back. Note that a trashed collection cannot be listed through the local API, so record the key returned here if it may need restoring.

ParameterTypeDescription
collectionKeys *arrayKeys of the collections to remove, at most 50 per call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
permanentbooleanfalse (default) moves the collections to the trash, which is reversible. true erases them irreversibly. Only pass true on an explicit request from the user.

zotero_restore_collection Restore collections from the trash

Bring collections back out of Zotero's trash, undoing a non-permanent zotero_delete_collection. You must know the key: Zotero's local API cannot list trashed collections, so there is no way to discover them from here, the user can see them in the Zotero window's trash. A collection erased permanently cannot be restored at all.

ParameterTypeDescription
collectionKeys *arrayKeys of the collections to restore, at most 50 per call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_search_items Search items

Search the local Zotero library. `q` runs Zotero's quicksearch: qmode "titleCreatorYear" (default) matches titles, creators and years, while "everything" also matches attachment full text and notes. Filters combine: pass collectionKey to search inside one collection, itemType to restrict by type ("-attachment" excludes a type), tag to filter by tag. Omit `q` to browse. Returns flattened item metadata; use zotero_get_item for one item in full.

ParameterTypeDescription
collectionKeystringRestrict the search to one collection.
directionstringSort direction.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
includeTrashedbooleanInclude items currently in the trash.
itemTypestringItem type filter. Supports Zotero syntax: "book", "book || journalArticle", "-attachment".
limitintegerMaximum number of objects to return (1-500).
qstringSearch text. Omit to list items without filtering by text.
qmodestring"titleCreatorYear" searches metadata only; "everything" also searches full text and notes (slower).
sinceintegerReturn only objects modified after this library version, for incremental syncing.
sortstringSort field.
startintegerZero-based offset for paging; pass the nextStart value from a previous call.
tagstringTag filter. Supports "tag1 || tag2" for OR and a leading "-" to exclude.
topLevelOnlybooleanReturn only top-level items, hiding child notes and attachments. Set false to include children.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…

zotero_get_item Get an item

Fetch one item by key with all of its metadata. Set includeChildren to also return its notes and attachments, which is the quickest way to find the attachment key needed to read a PDF or its full text.

ParameterTypeDescription
itemKey *stringItem key, e.g. "ABCD1234".
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
includeChildrenbooleanAlso return child notes and attachments.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…

zotero_get_item_children Get item children

List the child notes, attachments and annotations of an item. Attachment children carry the linkMode and filename needed by zotero_get_attachment_path and zotero_get_item_fulltext.

ParameterTypeDescription
itemKey *stringParent item key.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
limitintegerMaximum number of objects to return (1-500).
startintegerZero-based offset for paging; pass the nextStart value from a previous call.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…

zotero_create_items Create items

Create up to 50 items in one call. Set `collections` on an item to file it into collections as it is created, which is cheaper than creating it and moving it afterwards. Notes and attachments are created by setting parentItem. To attach a file from disk use zotero_attach_file instead, which handles the whole attachment protocol. Check the returned `failures` array: Zotero validates each item independently, so some can succeed while others fail.

ParameterTypeDescription
items *arrayItems to create, at most 50 per call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_update_item Update an item

Patch fields on an existing item. Only the fields passed in `fields` change; everything else is left alone. Array fields are replaced wholesale, so to change collection membership prefer zotero_add_items_to_collection / zotero_remove_items_from_collection, which merge instead of overwriting. The current version is read automatically unless expectedVersion is supplied.

ParameterTypeDescription
fields *objectFields to set, as Zotero item JSON, e.g. {"title": "New title", "date": "2024", "tags": [{"tag": "to-read"}]}. Field names must be valid for the item's type.
itemKey *stringKey of the item to update.
expectedVersionintegerVersion the item is expected to be at, for conflict detection. Omit to use the current version.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_delete_items Delete items

Move up to 50 items to Zotero's trash, where the user can restore them from the Zotero window or with zotero_restore_items. This is the default and it is reversible. Trashed items keep their attachments and files; Zotero empties the trash automatically after 30 days by default. Pass permanent: true only when the user has explicitly asked for an irreversible delete: that erases the items outright, takes their child notes and attachments with them, removes attachment files from disk, and cannot be undone by anything.

ParameterTypeDescription
itemKeys *arrayKeys of the items to remove, at most 50 per call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
permanentbooleanfalse (default) moves the items to the trash, which is reversible. true erases them immediately and irreversibly, deleting attachment files from disk. Only pass true on an explicit request from the us…

zotero_restore_items Restore items from the trash

Bring items back out of Zotero's trash, undoing a non-permanent zotero_delete_items. The items return to the collections they were in. Only works while they are still in the trash: nothing can recover an item that was erased permanently or that Zotero has already purged after its 30-day retention.

ParameterTypeDescription
itemKeys *arrayKeys of the items to restore, at most 50 per call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_list_trash List the trash

List the items currently in Zotero's trash, which are the ones zotero_restore_items can bring back. Note that trashed *collections* do not appear here: Zotero's local API offers no way to enumerate them, so a trashed collection can only be restored by key or from the Zotero window.

ParameterTypeDescription
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
limitintegerMaximum number of objects to return (1-500).
startintegerZero-based offset for paging; pass the nextStart value from a previous call.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…

zotero_empty_trash Empty the trash

Permanently erase every item in the trash. This is irreversible and removes attachment files from disk. As an interlock against emptying a trash the caller has not looked at, expectedCount must equal the number of items actually in it: call zotero_list_trash first and pass its totalResults. If the two disagree the call is refused and nothing is deleted. Only use this when the user has explicitly asked to empty the trash.

ParameterTypeDescription
expectedCount *integerHow many items you expect to erase, from zotero_list_trash. A mismatch aborts the call.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_add_items_to_collection Add items to a collection

File existing items into a collection, keeping every collection they already belong to. An item in Zotero can sit in any number of collections, so this adds rather than moves. Items already in the collection are reported as unchanged and cost no write.

ParameterTypeDescription
collectionKey *stringTarget collection key.
itemKeys *arrayKeys of the items to file.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_remove_items_from_collection Remove items from a collection

Remove items from one collection. The items stay in the library and in any other collection they belong to; nothing is deleted. Items that were not in the collection are reported as unchanged.

ParameterTypeDescription
collectionKey *stringCollection to remove them from.
itemKeys *arrayKeys of the items to remove.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_get_item_fulltext Get attachment full text

Return the indexed full text of an attachment. Passing a regular item key works too: its attachments are searched and the first one with indexed text is used. Text comes from Zotero's own index, so it is available only for attachments Zotero has indexed. Long documents can be truncated with maxCharacters.

ParameterTypeDescription
itemKey *stringAttachment key, or a parent item key to search its attachments.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
maxCharactersintegerTruncate the returned text at this many characters.

zotero_export_items Export citations

Export items in a citation format. Use format "bibtex", "biblatex", "ris", "csljson", "csv" or "tei" for a machine-readable export, or "bib" to render a formatted bibliography in a citation style (set `style`, e.g. "apa", "chicago-note-bibliography", "ieee"). Returns the export as text.

ParameterTypeDescription
itemKeys *arrayKeys of the items to export.
formatstringExport format. "bib" renders a formatted bibliography using `style`.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
localestringLocale for format "bib", e.g. "en-US", "es-ES".
stylestringCitation style for format "bib", e.g. "apa", "ieee", "chicago-note-bibliography". Ignored otherwise.

zotero_attach_file Attach a local file

Attach a file from disk to a Zotero item, or add it as a standalone attachment. mode="linked" (default) records the path only: instant for any file size, but the file must stay put and the attachment does not sync to zotero.org. mode="imported" copies the file into Zotero's storage, so it syncs and survives the original being moved. Group libraries accept only "imported", since a local path means nothing to other members. filePath must be absolute. Pass parentItemKey to hang the file off an existing reference; omit it for a standalone attachment, optionally filed into collections.

ParameterTypeDescription
filePath *stringAbsolute path to the file on this machine, e.g. "/Users/me/papers/smith-2024.pdf".
collectionsarrayCollections to file the attachment into. Only valid for standalone attachments (no parentItemKey).
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
modestring"linked" stores the path only (instant, no copy, no sync); "imported" copies the file into Zotero (syncs).
parentItemKeystringItem this file belongs to. Omit to create a standalone attachment item.
tagsarrayTags to attach.
titlestringAttachment title shown in Zotero. Defaults to the file name.

zotero_get_attachment_path Get an attachment file path

Resolve an attachment to its absolute path on this machine, so the file can be opened and read directly. Works for both linked and imported attachments. Passing a regular item key returns the paths of all of its file attachments. Use this to read a PDF whose text Zotero has not indexed.

ParameterTypeDescription
itemKey *stringAttachment key, or a parent item key to resolve all of its attachments.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.

zotero_list_tags List tags

List tags in the library, optionally only those used within one collection or matching a search. Useful for discovering how a library is organized before filtering zotero_search_items by tag.

ParameterTypeDescription
collectionKeystringOnly tags used by items in this collection.
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
limitintegerMaximum number of objects to return (1-500).
qstringFilter tags by text.
qmodestringHow `q` matches. Ignored when `q` is omitted.
startintegerZero-based offset for paging; pass the nextStart value from a previous call.

zotero_list_saved_searches List saved searches

List the saved searches defined in the library, with their conditions. Run one with zotero_run_saved_search. Note that the local API can actually execute saved searches, which the zotero.org web API cannot.

ParameterTypeDescription
groupIdintegerGroup library ID. Omit for the personal library ("My Library"), which is what almost every request wants. Group IDs come from zotero_list_libraries.
limitintegerMaximum number of objects to return (1-500).
startintegerZero-based offset for paging; pass the nextStart value from a previous call.
verbosebooleanReturn Zotero's raw API envelope (library block, self/alternate links, full meta) instead of the flattened object. Costs many extra tokens per object; only useful when a URL or the raw meta block is g…