feat: add group library support and inject_citations tool#83
Conversation
New tools: - list_libraries: lists all Zotero libraries (personal + group) with their IDs - inject_citations: replaces <zcite> placeholder tags in a Word .docx with native Zotero OOXML field codes (ADDIN ZOTERO_ITEM CSL_CITATION), compatible with the Zotero Word Plugin. Supports APA, Chicago, Harvard, IEEE, Vancouver. Appends a bibliography field. Uses IOUtils (Gecko API) and bundled fflate for zip read/write inside the Zotero/Firefox runtime. Extended tools: - search_library, get_collections, search_collections, get_collection_details, get_collection_items, get_subcollections: all now accept an optional libraryID parameter to target personal or group libraries Adds fflate as a dependency for zip manipulation inside the Zotero plugin runtime.
|
Thank you @mlenburg — there's a lot of value in here, and Requested changes:
Happy to review the split PRs quickly once they're up. Issue #63 (group libraries) is closed by #50, so this PR's remaining scope is purely the citation feature. |
Summary
This PR adds two new capabilities to zotero-mcp:
New tools
list_libraries— lists all Zotero libraries (personal + group) with their numeric IDsinject_citations— replaces<zcite key="ITEMKEY"/>placeholder tags in a Word.docxfile with native Zotero OOXML field codes (ADDIN ZOTERO_ITEM CSL_CITATION), identical to what the Zotero Word Plugin produces. Supports APA, Chicago, Harvard, IEEE, and Vancouver styles. Appends a bibliography field. The output.docxcan be opened in Word with Zotero running and refreshed/reformatted normally.Extended tools
All search and collection tools now accept an optional
libraryIDparameter:search_library,get_collections,search_collections,get_collection_details,get_collection_items,get_subcollectionsNew file
src/modules/citationInjector.ts— core citation injection logic. UsesIOUtils(Gecko API, compatible with Zotero 7 / Firefox 102+) and fflate for zip read/write inside the Zotero runtime.Usage