شعار Zotero MCP

Zotero MCP

المجتمع
lricher7329

Zotero MCP plugin with Claude Code compatibility - fork by lricher7329

الناشرlricher7329
المستودعzotero-mcp-claude-code
اللغةTypeScript
التفريعات
4
النجوم
44
الأدوات المتاحة
0
نوع نقل البياناتstreamable-http
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح Zotero MCP إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 44، والنسخ المتفرعة: 4 في المستودع المرتبط.

Zotero MCP for Claude Code

A Zotero plugin that exposes your library to AI assistants via the Model Context Protocol (MCP). This fork adds Claude Code compatibility and write operations.

GitHub Zotero Version License

Note: This fork has been developed and tested with Claude Code, Claude Desktop, and Codex on Zotero 7–10 for macOS (latest macOS). The plugin manifest declares compatibility with Zotero 7, 8, 9, and 10. It uses standard MCP over Streamable HTTP, so it should work with any MCP-compatible client and platform, but other clients and operating systems have not been tested by this fork's author.


What it does

The plugin runs an MCP server inside Zotero that AI clients connect to over HTTP. No separate server process needed.

AI Client  <--Streamable HTTP-->  Zotero Plugin (integrated MCP server)

Your AI assistant can then search your library, read PDFs, extract annotations, create items, manage collections, and more.

Quick start

1. Install the plugin

Download the latest .xpi from the Releases page and install it in Zotero via Tools > Plugins → gear menu → Install Plugin From File….

Upgrading to Zotero 10? Zotero 10 disables plugin versions older than v1.8.7 (their manifest caps compatibility at Zotero 9), which leaves nothing listening on port 23120 and MCP clients failing with ECONNREFUSED. Install v1.8.7 or later from the Releases page. Existing installs on Zotero 7–9 pick it up through auto-update.

2. Connect Claude Code

bash
claude mcp add zotero-mcp http://127.0.0.1:23120/mcp -t http

Or add to your MCP config (~/.claude.json or .mcp.json):

json
{
  "mcpServers": {
    "zotero-mcp": {
      "type": "http",
      "url": "http://127.0.0.1:23120/mcp"
    }
  }
}

If you've enabled Require auth token on local connections (or Allow remote access — which forces auth regardless), copy the token from the prefs UI and add it as a header:

json
{
  "mcpServers": {
    "zotero-mcp": {
      "type": "http",
      "url": "http://127.0.0.1:23120/mcp",
      "headers": {
        "Authorization": "Bearer zmcp_<your-token>"
      }
    }
  }
}

See Authentication below.

3. Verify

bash
claude mcp list

You should see zotero-mcp with the available tools listed.

Supported clients

ClientConnectionTested
Claude CodeNative HTTP MCP (recommended)Yes
CodexNative Streamable HTTP MCP via ~/.codex/config.tomlYes
Claude DesktopStreamable HTTP via mcp-remote (see Claude Desktop setup)Yes
Cursor IDEStreamable HTTP via mcp-remoteNo
Cherry StudioNative Streamable HTTPNo
Gemini CLINative HTTP MCPNo
Cline (VS Code)Streamable HTTP via mcp-remoteNo
Continue.devStreamable HTTP via mcp-remoteNo
Qwen CodeNative HTTP MCPNo
ChatboxStreamable HTTP via mcp-remoteNo
Trae AIStreamable HTTP via mcp-remoteNo

The plugin preferences include a Client Configuration Generator that produces ready-to-use config for each client.

Claude Desktop setup

Claude Desktop runs local MCP servers as stdio commands, so it reaches the plugin's HTTP endpoint through the mcp-remote bridge (requires Node.js). Custom Connectors (Settings → Connectors) can't be used for this: Anthropic's cloud makes those connections, so 127.0.0.1 is unreachable.

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Settings → Developer → Edit config), then quit and reopen Claude Desktop:

json
{
  "mcpServers": {
    "zotero-mcp": {
      "command": "/opt/homebrew/bin/npx",
      "args": ["-y", "mcp-remote", "http://127.0.0.1:23120/mcp"],
      "env": { "PATH": "/opt/homebrew/bin:/usr/bin:/bin" }
    }
  }
}

Use full paths: Claude Desktop launched from the Dock doesn't load your shell profile, so npx from nvm or other shell-managed installs isn't on its PATH. Point command at your npx (which npx) and include the directory containing node in env.PATH. With auth enabled, add "--header", "Authorization: Bearer zmcp_<your-token>" to args. Settings → Developer shows the server as Running; logs are in ~/Library/Logs/Claude/mcp-server-zotero-mcp.log.

MCP tools (50 max total)

Read tools (26 — always available)

ToolDescription
search_librarySearch with advanced filtering (title, creator, year, tags, item type, boolean operators, relevance scoring, pagination). On Zotero 10, structured conditions with nested and/or groups, resultLevel (items, attachments, notes, annotations), and isEmpty/isNotEmpty
search_annotationsSearch annotations/highlights by query, color, or tags
get_item_detailsGet full metadata for an item
get_item_abstractGet an item's abstract
get_annotationsGet annotations for specific items
get_contentExtract content from PDFs, notes, and attachments
get_collectionsList all collections
search_collectionsSearch collections by name
get_collection_detailsGet collection metadata
get_collection_itemsList items in a collection
get_subcollectionsList child collections
search_fulltextFull-text search across attachments with context snippets
get_tagsList all tags with optional filtering
get_related_itemsGet items linked via Zotero's Related feature
generate_bibliographyGenerate formatted citations using Zotero's citation engine
search_by_identifierFind library items by DOI, ISBN, or PMID
get_library_statsLibrary summary: item counts by type, tag/collection/trash counts
get_item_typesList all valid Zotero item types with localized names
get_creator_typesList valid creator types, optionally filtered by item type
get_item_type_fieldsList valid fields for a given item type
get_trash_itemsList items in the trash with pagination
get_recently_modifiedGet items modified within N days
semantic_searchAI-powered semantic search using embedding vectors
find_similarFind items similar to a given item
semantic_statusCheck semantic index status
fulltext_databaseQuery the full-text content cache (list, search, get, stats)

Write tools (24 — when enabled in preferences)

ToolDescription
create_itemCreate a new library item with fields, creators, tags, collections
update_itemUpdate fields and creators on an existing item
add_noteCreate a standalone or child note
update_noteUpdate an existing note's content and tags
trash_itemMove an item to the trash
add_tagsAdd tags to an item
remove_tagsRemove tags from an item
rename_tagRename a tag across all items in the library
delete_tagDelete a tag from the entire library
create_collectionCreate a new collection or subcollection
rename_collectionRename a collection
delete_collectionDelete a collection (items optionally deleted)
move_collectionMove a collection to a new parent or root
add_to_collectionAdd an item to a collection
remove_from_collectionRemove an item from a collection
move_item_to_collectionAtomically move an item between collections
add_related_itemCreate a bidirectional Related link between items
remove_related_itemRemove a Related link between items
import_attachment_urlImport a file from a URL as an attachment
batch_tagTag multiple items at once (max 100)
batch_add_to_collectionAdd multiple items to a collection (max 100)
batch_remove_from_collectionRemove multiple items from a collection (max 100)
batch_trashTrash multiple items at once (max 100)
restore_from_trashRestore a trashed item back to the library

Write tools are gated by per-scope opt-in checkboxes in preferences (see Write scopes below). Tools whose scopes are disabled are hidden from the tools/list response — they don't just fail-on-call, they don't exist as far as the client can see.

Undo (Zotero 10): changes made through write tools land on Zotero's undo stack, so Edit → Undo (Cmd/Ctrl+Z in the items list) reverts them like Zotero's own edits — labelled "Undo Add Tag", "Undo Edit Metadata", and so on. A batch tool is one undo step. Trashing and restoring are undoable; creating items and permanently deleting are not (a Zotero limitation). The undo history lives in memory and clears when Zotero restarts. On Zotero 7–9 there is no undo.

Authentication

The plugin auto-generates a per-install bearer token on first start, stored in the extensions.zotero.zotero-mcp-plugin.mcp.server.authToken preference and surfaced in Settings → Zotero MCP for Claude Code → MCP Server → Authentication with Copy and Regenerate buttons.

PrefDefaultBehavior
mcp.server.allowRemotefalseWhen true, listener binds 0.0.0.0 and auth is mandatory regardless of requireAuth
mcp.server.requireAuthfalseWhen true, loopback callers must also present the token

When auth is required, send the token via either:

http
Authorization: Bearer zmcp_<48-hex-chars>

or

http
X-Zotero-MCP-Token: zmcp_<48-hex-chars>

X-Zotero-MCP-Token exists for browser-extension callers that can't set Authorization. Both headers force a CORS preflight, defeating drive-by simple-form CSRF.

Loopback default (no auth) keeps existing client configs working out of the box. Public-facing or shared-machine setups should enable requireAuth. The /ping, /capabilities, /help, /mcp/status, and GET /mcp endpoints stay open even when auth is on, so health checks and config generators don't need credentials.

Regenerating the token invalidates every existing client config — clients will get 401 until you update them.

Defense-in-depth checks (always on)

These run regardless of auth state:

  • Origin: null (sandboxed iframes, file://, cross-origin redirects) is rejected
  • POST /mcp requires Content-Type: application/json (defeats text/plain CSRF via simple form POST)
  • Host header must be loopback when allowRemote=false
  • Duplicate Host headers rejected
  • Mcp-Session-Id validated against ^mcp-[a-f0-9-]{8,80}$ and capped at 256 active sessions with LRU eviction
  • Global + per-client token-bucket rate limits, with a stricter bucket on write tools. Remote clients are limited per IP; loopback clients are limited per active Mcp-Session-Id (falling back to the address), so Claude Code, its subagents and Claude Desktop don't share one bucket. initialize, notifications/*, tools/list and ping get a small reserve so a client can still reconnect after a burst of tool calls
  • 10s wall-clock deadline on full request body read
  • Content-Length > 1MB rejected before reading
  • Zotero 9/10-compatible socket reads use Gecko readiness callbacks rather than available() polling, avoiding accepted-but-unresponsive MCP connections

Write scopes

mcp.write.enabled (single boolean) was replaced in v1.8.0 by seven granular scopes. A tool is only exposed in tools/list when every scope it requires is enabled.

Scope prefTools
mcp.write.notesadd_note, update_note
mcp.write.tagsadd_tags, remove_tags
mcp.write.collectionsadd_to_collection, remove_from_collection, create_collection, rename_collection, move_collection, move_item_to_collection
mcp.write.metadatacreate_item, update_item, add_related_item, remove_related_item
mcp.write.delete ⚠trash_item, restore_from_trash, delete_collection
mcp.write.bulk ⚠(combined with another scope on bulk operations — see below)
mcp.write.import ⚠import_attachment_url (SSRF risk)

Scopes marked ⚠ are destructive and default to off. Multi-scope tools require all listed scopes:

ToolScopes required
batch_tagbulk + tags
batch_add_to_collectionbulk + collections
batch_remove_from_collectionbulk + collections
batch_trashbulk + delete
delete_tagdelete + bulk (library-wide)
rename_tagtags + bulk (library-wide rewrite)
delete_collection with deleteItems: truedelete + bulk

Migration from mcp.write.enabled

On first run after upgrading from v1.7.0 or earlier:

  • If the legacy mcp.write.enabled was true, the safe scopes (notes, tags, collections, metadata) migrate on; the destructive scopes (delete, bulk, import) stay off. Re-enable them deliberately if you need them.
  • If mcp.write.enabled was unset or false, all scopes default to off.

Reading scope state programmatically

js
Zotero.Prefs.get("extensions.zotero.zotero-mcp-plugin.mcp.write.metadata", true)
// → true | false | undefined

The same pref keys appear in ~/Library/Application Support/Zotero/Profiles/<profile>/prefs.js.

Plugin preferences

Configure in Zotero > Settings > Zotero MCP for Claude Code:

  • MCP Server -- Enable/disable, port (default 23120), remote access
  • Authentication -- Bearer token (Copy / Regenerate), require-auth-on-loopback toggle
  • Write Scopes -- Per-scope opt-in (notes, tags, collections, metadata, delete, bulk, import)
  • Client Configuration Generator -- Generate config JSON for any supported AI client
  • MCP Content Settings -- Content processing mode (minimal/preview/standard/complete/custom), max tokens
  • Semantic Search -- Embedding provider (OpenAI, Ollama, etc.), model, dimensions, API key
  • Semantic Index -- Build/rebuild/clear index, auto-update, progress monitoring

Semantic search

The plugin supports AI-powered semantic search using embedding vectors:

  1. Configure an embedding provider in preferences (OpenAI, Ollama, or any OpenAI-compatible API)
  2. Build the index (indexes item titles, abstracts, and full text)
  3. Use semantic_search for natural language queries or find_similar to find related items

The vector index is stored locally in SQLite with Int8 quantization for efficient storage.

Development

Prerequisites

  • Zotero 7, 8, 9, or 10
  • Node.js 22.8+ (required by zotero-plugin-scaffold 0.9)

Setup

bash
cd zotero-mcp-plugin
npm install
npm run build    # Production build
npm run start    # Dev mode with auto-reload

Testing

bash
npm run check        # lint + build/type check + unit tests (the local gate)
npm run test:unit    # Mocha unit tests in Node (no Zotero needed)
npm run lint:check   # Prettier + ESLint

Endpoints

EndpointMethodPurposeAuth required when requireAuth=true
/mcpPOSTMCP JSON-RPC 2.0 requestsyes
/mcpGETEndpoint info (JSON)no
/mcpDELETESession termination (per MCP 2025-03-26 spec)yes
/pingGETHealth check (returns pong)no
/mcp/statusGETServer statusno
/capabilitiesGETServer capabilities (also at /help, /mcp/capabilities)no

Protocol versions supported: 2024-11-05 and 2025-03-26 (negotiated via initialize).

Fork changes

This fork (lricher7329/zotero-mcp-claude-code) adds the following on top of the upstream cookjohn/zotero-mcp:

  • Claude Code compatibility -- Proper request body reading, Accept header validation, DELETE method, notification handling, batch requests, dual protocol version support (2024-11-05 + 2025-03-26)
  • Write operations -- ~24 MCP write tools for creating/updating items, notes, tags, collections, relations, and attachments, plus batch operations and trash management — all gated by per-scope opt-ins
  • Library introspection -- Schema discovery tools (item types, creator types, field lists), library stats, trash listing, recently modified items
  • Security hardening (v1.8.0) -- Per-install bearer token auth; Origin/Content-Type CSRF protection; per-scope write opt-ins (destructive ops default off); global + per-IP + per-session rate limits; SSRF guard with IPv6-mapped-IPv4 and decimal/octal IPv4 detection; itemKey/collectionKey format validation; session ID hardening with LRU cap; body-read deadline; sanitized error messages
  • MCP/JSON-RPC compliance fixes (v1.8.0) -- Tool execution failures returned as result.isError (LLM can recover) rather than -32603; argument validation maps to -32602; parse-error id: null per spec; notifications/initialized correct; empty batch returns -32600; dropped false tools.listChanged advertisement
  • get_item_details mode=complete -- Now enumerates all item-type fields via Zotero.ItemFields.getItemTypeFields, including extra (PMID/PMCID/citation key per Zotero convention), collections membership, dateAdded/dateModified/accessDate. Critical for downstream identifier extraction.
  • Per-session rate limits on loopback (v1.8.10) -- Every local client shared one 127.0.0.1 bucket, so parallel Claude Code subagents could exhaust it and reconnects failed with "Rate limit exceeded". Loopback traffic is now limited per active session, reconnect handshakes draw on a small reserve, and the global cap burst rose from 120 to 240
  • Zotero 10 native features (v1.8.9) -- MCP edits (metadata, notes, tags, collections, related items, restore) can be undone in Zotero with Cmd/Ctrl+Z, one undo step per call or batch; full text reads Zotero's cached index again (Zotero 10 removed the old API, so PDF text timed out) and search_fulltext uses Zotero's search index; get_content on long papers drops from minutes to about a second; search_library accepts structured condition groups and resultLevel
  • Zotero 10 support (v1.8.7) -- Manifest and auto-update strict_max_version raised to 10.*; attachment file-size lookup moved from the legacy OS.File API to IOUtils
  • Codebase audit -- Typed errors, API validation, singleton fixes, batched queries, module refactoring, and a Node unit-test suite (npm run test:unit)

License

MIT

Acknowledgements

استخدم MCP الخاص بـ Zotero MCP مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Zotero MCP، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يتصل تكامل MCP هذا عبر عنوان URL لخادم MCP مستضاف عن بُعد في TypingMind.

أضف عنوان URL لخادم MCP

استخدم هذا الخيار عندما يكون Zotero MCP مستضافًا بالفعل عن بُعد أو عندما يريد فريقك موصلًا مشتركًا واحدًا يمكن لعدة مستخدمين الوصول إليه.

1

فتح موصلات MCP

في TypingMind، انتقل إلى «الإضافات»، وافتح «موصلات MCP»، ثم اختر «إضافة رابط».

  1. افتح TypingMind في متصفحك.
  2. انتقل إلى الإضافات.
  3. افتح موصلات MCP.
  4. انقر على «إضافة عنوان URL».
نموذج إضافة عنوان URL لخادم MCP مخصص في TypingMind
2

لصق عنوان URL للخادم

أدخل عنوان URL لخادم MCP الذي يقدّمه مزوّد الخدمة في حقل «رابط الخادم». أضف اسمًا للاتصال أو وصفًا أو أيقونة أو ترويسات HTTP مخصصة أو إعدادات عميل OAuth إذا كان الخادم يتطلب ذلك.

  1. ألصق عنوان URL لخادم MCP الذي يقدّمه مزوّد الخدمة في حقل «رابط الخادم».
  2. أدخل اسمًا لاتصال Zotero MCP.
  3. أضف وصفًا وأيقونة لتسهيل التعرّف على الاتصال إن أردت.
  4. أضف ترويسات HTTP مخصصة أو تفاصيل عميل OAuth إذا كان الخادم يتطلب المصادقة.
3

إنشاء الاتصال

انقر على «إنشاء اتصال»، ثم عُد إلى قائمة الإضافات وتأكد من أن اتصال MCP الجديد نشط.

  1. انقر على «إنشاء اتصال».
  2. عُد إلى قائمة موصلات MCP.
  3. تأكد من ظهور اتصال Zotero MCP بحالة «نشط».
  4. حدّث قائمة الإضافات إذا لم يظهر الاتصال فورًا.
4

تبديل النماذج دون إعادة الاتصال

ابدأ محادثة مع نموذجك المفضل، وفعّل أدوات Zotero MCP من «الإضافات»، وانتقل إلى نموذج آخر عند الحاجة. يظل اتصال MCP متاحًا في مساحة عمل TypingMind.

  1. ابدأ محادثة جديدة في TypingMind.
  2. اختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  3. فعّل أدوات Zotero MCP من قسم الإضافات.
  4. اطلب من النموذج استخدام الأداة عند الحاجة.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر وأعد استخدام اتصال MCP نفسه.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Zotero MCP لمساعدتي في هذه المهمة؟
Zotero MCP
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Zotero MCP.

الأسئلة الشائعة

ما استخدامات خادم MCP Zotero MCP؟

Zotero MCP هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Zotero MCP مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Zotero MCP مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP Zotero MCP مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Zotero MCP، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Zotero MCP بـ TypingMind؟

يمكن توصيل Zotero MCP بـ TypingMind بإضافة عنوان URL لخادم MCP المستضاف الخاص به. يفيد ذلك عندما تريد اتصال MCP بعيدًا متاحًا من مساحة عملك في TypingMind.

ما الأدوات التي يوفّرها خادم MCP Zotero MCP في TypingMind؟

يتيح Zotero MCP إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Zotero MCP؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان Zotero MCP يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇