Releases: maedayoshiaki/zotero-mcp
Release list
v1.5.3 — Fix highlight landing on the wrong match
修正
zotero_create_highlight が、同じページに同じ文字列が複数あると、意図しない箇所にハイライトを付けていた問題を修正しました。
原因
ページのテキストを小文字にそろえて indexOf で探し、最初の一致に警告なしで矩形を置いていました。そのため、見出し "Real-scene box" を指定しても、それより前にある本文の "real-scene box" にハイライトが付きました。ツール説明の「Use exact, unique text」は利用者への注意書きにとどまり、プラグインは一意性を確かめていませんでした。
対応
- 大文字小文字が一致する箇所を優先し、無いときだけ区別せずに探します
- 一致が複数あれば何も作らず、HTTP 409 で全候補(
occurrenceの番号・前後の文脈・rects)を返します - 新しい引数
occurrence(1 始まり、pdf.js の読み順)で候補を選べます - 成功時の応答に
occurrenceと一致件数matchesを含めます
その他の変更
- Python プロキシ(
zotero-mcp-py)のzotero_create_highlightも同じ規則にそろえました。以前は PyMuPDF のsearch_for()が返す全一致にハイライトを付けていました。行をまたぐ文字列にも一致します
検証
同梱の pdf.js を Node で動かし、Zhong et al. 2021(ACM TOG)の PDF で確認しました。見出しの指定は一意に決まり、同じページに 6 か所ある "real-scene box" は候補一覧を返して止まります。occurrence の指定、範囲外の番号、見つからない文字列も期待どおりに動きました。
インストール
mcp-zotero-api.xpi をダウンロードし、Zotero の ツール → アドオン → 歯車 → Install Add-on From File... から導入してください。導入後に Zotero の再起動が必要です。
v1.5.2 — Fix citekey lookup (in-process BBT KeyManager)
修正
zotero_lookup_citekey が正しい citekey でも常に Item not found を返していた問題を修正しました。
原因
二重に失敗しており、どちらも静かに握りつぶされていました。
- BBT の JSON-RPC を HTTP で叩いていたが、Zotero は自分自身の HTTP サーバに内部から接続できない。外部の curl では同じエンドポイント (
http://127.0.0.1:23119/better-bibtex/json-rpc) が正常に応答するため、原因が見えにくくなっていました。fetchをZotero.HTTP.requestに替えても「サーバーへの接続エラー」で同じく失敗します。 - フォールバックの Extra 欄走査は、BBT が citekey を Extra に書くのがピン留め時だけなので、通常のライブラリでは決してヒットしません。
対応
BBT は同一プロセスで動くため、Zotero.BetterBibTeX.KeyManager を直接参照する方式に変更し、HTTP 経路を削除しました。KeyManager.any() で citekey からの逆引きができるので、旧実装が使っていた item.search(曖昧全文検索の先頭ヒットを無検証で採用)も不要になっています。BBT 9 が item field として公開する citationKey へのフォールバックも追加しました。
その他の変更
- 404 レスポンスに
diagnosticsを追加。どの段階で解決に失敗したかが応答に出ます - citekey の大文字小文字ゆれを吸収(BBT の
veryshorttitleは元タイトルの大小を保つため、xu2020hyperspectralとfu2025Limitationsのように混在します) zotero_get_itemのレスポンスにcitekeyを追加
検証環境
Zotero 9.0.6 + BetterBibTeX 9.0.63 で動作確認済み。移行済み BBT データベース (better-bibtex.migrated) に載っていないアイテムも正しく解決します。
インストール
mcp-zotero-api.xpi をダウンロードし、Zotero の ツール → アドオン → 歯車 → Install Add-on From File... から導入してください。導入後に Zotero の再起動が必要です。
v1.5.0 — In-plugin PDF highlights (pdf.js bundled)
Text-based highlighting and PDF reading now run entirely inside the plugin via a bundled pdf.js — the zotero-mcp-py Python proxy is no longer required.
What's new
zotero_create_highlight— highlight by search text + page; the plugin finds the text and computes the rectangles itself (all pages, not just the first five).zotero_read_pdf— extract text from any pages.zotero_pdf_outline— table of contents.
20 MCP tools total. Install the xpi, then in Claude Code:
claude mcp add --transport http zotero-local http://127.0.0.1:23119/mcp
Notes
- pdf.js is bundled under
vendor/; parsing runs off the UI thread. - The REST API and all previous tools are unchanged; installed plugins auto-update via
updates.json.
v1.4.0 — Native MCP over HTTP
The Zotero plugin now is an MCP server (Streamable HTTP), so Claude Code can drive Zotero with no external runtime — no Python, no Node, no separate process.
Install
- Download
mcp-zotero-api.xpibelow. - Zotero → Tools → Add-ons → gear → Install Add-on From File… → select the xpi → restart Zotero.
(Already installed? Zotero auto-updates viaupdates.json.)
Use in Claude Code
claude mcp add --transport http zotero-local http://127.0.0.1:23119/mcp
claude mcp list # zotero-local ... ✔ Connected
Zotero must be running (server on 127.0.0.1:23119).
Tools (17)
zotero_ping, zotero_search, zotero_lookup_citekey, zotero_get_item, zotero_get_children, zotero_list_items, zotero_create_annotation, zotero_update_annotation, zotero_delete_annotations, zotero_create_note, zotero_update_item, zotero_set_tags, zotero_set_collections, zotero_create_collection, zotero_delete_collection, zotero_add_attachment, zotero_delete_items.
Notes
zotero_create_annotationplaces highlights from an explicitposition: {pageIndex, rects}. Computing rects from search text (PDF geometry) inside the plugin is planned for a later release; until then use thezotero-mcp-pyproxy (PyMuPDF) for text-based highlighting.- The existing REST API at
127.0.0.1:23119/mcp/...is unchanged.