MCP Server Zotero Dev logo

MCP Server Zotero Dev

Community
introfini

Give your AI assistant superpowers for Zotero plugin development. 28 tools for screenshots, DOM inspection, JavaScript execution, build integration, and debugging via Model Context Protocol.

Publisherintrofini
Repositorymcp-server-zotero-dev
LanguageTypeScript
Forks
8
Stars
40
Available tools
26
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Server Zotero Dev exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 26 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    40 stars and 8 forks from the linked repository.

MCP Server Zotero Dev

Give your AI assistant superpowers for Zotero plugin development

License: MIT Zotero 7+

Architecture · Getting Started · Available Tools


A Model Context Protocol (MCP) server that enables AI assistants like Claude, Cursor, and Windsurf to build, test, and debug Zotero 7, 8, 9, and 10 plugins. Screenshots, DOM state, debug logs, and JavaScript execution give the AI rich context to understand what's happening—and tools to help you fix it.

✨ Features

CategoryCapabilities
🎯 UI InspectionScreenshots, DOM tree, element finding, computed styles
🖱️ UI InteractionClick elements and type text (shadow-DOM aware)
💻 JS ExecutionRun code in Zotero context, inspect APIs, test snippets
🔧 Build ToolsScaffold integration for build, serve, hot reload
📋 Logs & ErrorsStream debug output, error console, watch for issues
🗃️ DatabaseRead-only access to zotero.sqlite for debugging
🔌 Plugin ManagementInstall, reload, list plugins

🚀 Quick Start

Prerequisites

  • Node.js 20+ and npm
  • Zotero 7+ — Works on all Zotero 7, 8, 9, and 10 builds (release, beta, dev)
  • For plugin development: zotero-plugin-scaffold

1. Install MCP Server

Use install-mcp to add the server to your AI assistant:

bash
npx -y install-mcp @introfini/mcp-server-zotero-dev --client claude-code

Supported clients: claude-code, cursor, windsurf, vscode, cline, roo-cline, claude, zed, goose, warp, codex

bash
npx -y install-mcp @introfini/mcp-server-zotero-dev --client claude-code
bash
npx -y install-mcp @introfini/mcp-server-zotero-dev --client cursor
bash
npx -y install-mcp @introfini/mcp-server-zotero-dev --client vscode
bash
npx -y install-mcp @introfini/mcp-server-zotero-dev --client windsurf

Add to your MCP client config:

json
{
  "mcpServers": {
    "zotero-dev": {
      "command": "npx",
      "args": ["-y", "@introfini/mcp-server-zotero-dev@1.1.1"],
      "env": {
        "ZOTERO_RDP_PORT": "6100"
      }
    }
  }
}

Version & updates: pin an exact version as shown above. A bare npx <pkg> (no version) keeps running whatever npx cached and won't pick up new releases, so always include a version and -y (without -y, npx hangs waiting for an install prompt). Bump the pinned version to upgrade, or use @latest to always fetch the newest at launch (auto-updates, but a bad release would run automatically and it adds a registry check on every start). Note that install-mcp may write a config without -y or a version, so the manual configuration above is the most robust path.

Restart your AI assistant after adding the configuration.

2. Install MCP Bridge Plugin in Zotero

Download zotero-mcp-bridge.xpi and install:

  1. In Zotero: Tools → Plugins
  2. Click ⚙️ → Install Plugin From File
  3. Select the downloaded .xpi file
  4. Restart Zotero

This lightweight plugin enables the Remote Debugging Protocol when Zotero starts. It only needs to be installed once and works on all Zotero 7+ builds (release, beta, and dev).

3. Start Developing!

Just open Zotero normally and ask your AI assistant:

"Take a screenshot of Zotero and list installed plugins"

That's it! No special launch flags, no configuration. 🎉


🧰 Available Tools (28 total)

ToolDescription
zotero_screenshotCapture window, element, or region screenshots
zotero_inspect_elementFind elements by CSS selector
zotero_get_dom_treeGet DOM structure of a window/panel
zotero_get_stylesGet computed CSS styles for element
zotero_list_windowsList all open Zotero windows

Screenshot Targets: Main window, preferences, PDF reader, dialogs, or any element by selector. Use highlightSelector to add a red border before capture.

ToolDescription
zotero_click_elementClick an element by CSS selector (toolbar/menu button, preference control, list row). Pierces shadow DOM; index picks among multiple matches; mouseEvents synthesizes a full mouse sequence.
zotero_send_keysType text into an input/textarea/contenteditable (focuses it first, fires input/change). Optional clear and pressEnter.

Resolution tries light DOM first, then pierces open shadow roots (Zotero's XUL custom elements keep internals in shadow DOM). Limitation: cannot dismiss a blocking native modal dialog (Services.prompt.confirmEx) — its nested modal loop blocks the eval thread these tools run on.

ToolDescription
zotero_execute_jsExecute JavaScript in Zotero's privileged context. Auto-wraps code with top-level return statements in IIFE.
zotero_inspect_objectExplore Zotero APIs - list methods and properties of any object (e.g., Zotero.Items)
zotero_open_preferencesOpen Zotero's settings window, optionally to a specific pane (built-in or plugin)
zotero_search_prefsSearch/discover preferences by pattern (e.g., find all prefs containing "debug")
zotero_get_prefGet a preference value
zotero_set_prefSet a preference value

Examples: Zotero.Items.getAll(1), Zotero.Prefs.get('export.quickCopy.setting'), ZoteroPane.getSelectedItems()

Tip: Use zotero_inspect_object to explore APIs before writing code. Use zotero_search_prefs to discover preference keys.

ToolDescription
zotero_scaffold_buildBuild plugin (dev or production mode)
zotero_scaffold_serveStart dev server with hot reload
zotero_scaffold_lintRun ESLint on plugin source
zotero_scaffold_typecheckRun TypeScript type checking
ToolDescription
zotero_read_logsRead debug output (Zotero.debug)
zotero_read_errorsRead error console entries
zotero_watch_logsStream logs in real-time
zotero_clear_logsClear log buffer
ToolDescription
zotero_plugin_reloadHot reload your dev plugin
zotero_plugin_installInstall plugin from XPI path
zotero_plugin_listList installed plugins with version/status
ToolDescription
zotero_db_queryExecute SELECT query on zotero.sqlite
zotero_db_schemaGet table schema information
zotero_db_statsGet database statistics (items, attachments, collections, size)

Note: Database access is read-only and requires Zotero to be closed, or uses a copy of the database.


🏗️ Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        AI Assistant                             │
│                  (Claude, Cursor, Windsurf)                     │
└─────────────────────────┬───────────────────────────────────────┘
                          │ MCP Protocol (stdio)
                          ▼
┌─────────────────────────────────────────────────────────────────┐
│                  MCP Server (Node.js/TypeScript)                │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐   │
│  │   Scaffold   │  │     RDP      │  │      Database        │   │
│  │  Integration │  │    Client    │  │      Reader          │   │
│  └──────────────┘  └──────┬───────┘  └──────────────────────┘   │
└─────────────────────────────┼───────────────────────────────────┘
                              │ Firefox RDP (port 6100)
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                      Zotero Application                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │            MCP Bridge for Zotero                         │   │
│  │         Starts DevToolsServer on launch                  │   │
│  └──────────────────────────────────────────────────────────┘   │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │              Firefox DevTools Server (built-in)          │   │
│  │           JS Execution • DOM • Console • Screenshots     │   │
│  └──────────────────────────────────────────────────────────┘   │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                   Your Plugin (dev)                      │   │
│  └──────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘

Why this approach?

  • ✅ Lightweight plugin — Just enables RDP, Firefox DevTools does the rest
  • ✅ Zero-config after install — Just open Zotero normally, no special flags
  • ✅ Rich AI context — Screenshots, DOM, and logs help the AI understand your plugin's state
  • ✅ Hot reload — Integrates with zotero-plugin-scaffold for instant feedback
  • ✅ Full Zotero access — Execute any Zotero API in the privileged context
  • ✅ Cross-platform — Works on Linux, Windows, macOS

🔧 Environment Variables

VariableDescriptionDefault
ZOTERO_RDP_PORTRemote debugging port6100
ZOTERO_RDP_HOSTDebugging host127.0.0.1
ZOTERO_DATA_DIRPath to Zotero data directoryAuto-detect
ZOTERO_PROFILE_PATHPath to Zotero profileAuto-detect

🔌 Changing the RDP Port

The bridge listens on port 6100 by default. You only need to change it if you run two Zotero instances at the same time (a normal profile and a development one, say), or if another process already holds 6100.

The port lives on both sides of the bridge, and both have to agree on it.

1. Zotero side — set the plugin preference:

  1. Settings → Advanced → Config Editor, and accept the warning
  2. Search for extensions.mcp-rdp.port
  3. If it doesn't exist, create it: select Number, name it extensions.mcp-rdp.port, and enter your port
  4. Restart Zotero — the listener only opens at startup

Watch the type. The Config Editor pre-selects Boolean. Creating the preference without switching to Number stores true instead of a port, and Zotero then opens the bridge on a local pipe rather than a TCP port — the debug log reports success while no MCP client can connect.

2. Client side — set ZOTERO_RDP_PORT to the same value in your MCP client config:

json
{
  "mcpServers": {
    "zotero-dev": {
      "command": "npx",
      "args": ["-y", "@introfini/mcp-server-zotero-dev@1.1.2"],
      "env": {
        "ZOTERO_RDP_PORT": "6101"
      }
    }
  }
}

Change both or neither. Moving only one side disconnects the bridge: Zotero listens on one port while the client keeps dialing the other.

Actually running two instances

Launching Zotero a second time hands you the window you already have — like Firefox, it forwards to the running instance instead of starting another. A second instance needs its own profile and -no-remote:

bash
# macOS; adjust the binary path on Windows/Linux
MOZ_NO_REMOTE=1 "/Applications/Zotero.app/Contents/MacOS/zotero" -P <profile-name> -no-remote

Give that profile its own extensions.mcp-rdp.port and the two bridges stay out of each other's way. Verified with 9.0.6 on 6100 and 10.0-beta.22 on 6101 at the same time.

Requires MCP Bridge plugin 1.0.5 or later. In 1.0.4 and earlier, extensions.mcp-rdp.port was read under the wrong preference branch and silently ignored, so the bridge stayed on 6100 no matter what you set. If you configured a custom port against an older build, it is stored as extensions.zotero.extensions.mcp-rdp.port — that name still works, but prefer the one above.

Disabling the bridge

Set extensions.mcp-rdp.enabled to false (Boolean) in the Config Editor and restart Zotero. The plugin stays installed but opens no listener, and no MCP client can reach Zotero until you set it back to true.

Checking what the bridge did

The plugin appends one line per lifecycle transition to mcp-rdp-events.log in your Zotero profile directory: startup, listener open, listener down, listener recovered, listener flapping, shutdown. It survives restarts and is readable without Zotero running, which makes it the first place to look when an MCP client reports Cannot connect to Zotero RDP:

2026-09-17T07:52:36.201Z startup v1.0.5 reason=1
2026-09-17T07:52:37.914Z listener DOWN on port 6177 - failed to open at startup: port 6177 does not answer (held by another process?)
2026-09-17T07:53:46.552Z listener RECOVERED on port 6177 after 6 failed checks, 69s down
2026-09-17T08:01:12.083Z shutdown v1.0.5 reason=2

What to read from it:

  • listener DOWN … failed to open at startup — something else holds the port: another Zotero instance, a previous one that has not released it, or a process that answers on the port without speaking RDP. The reason after the colon says which of the last two it is.
  • listener DOWN … stopped answering — the listener was up and then died. The health check reopens it; the next line tells you when that worked and how long the gap was.
  • listener RECOVERED … after N failed checks — the bridge came back on its own. A large N means the port was held for a long time; nothing is logged per attempt, so the file stays short no matter how long the outage.
  • listener FLAPPING, later closed by listener STEADY … after N flaps — the listener keeps dying and coming straight back on the first reopen. That is a different fault from an outage: the port is yours, something is tearing the listener down. The whole run costs these two lines however long it goes on, so N is the number to report if you open an issue.
  • A startup with no shutdown before it — Zotero was killed or crashed rather than exiting cleanly. Usually the answer to "the bridge stopped working" is simply that Zotero is not running.
  • No new lines at all — the plugin never started: disabled by preference, or not installed in the profile you are actually running.

log() output goes to dump() (lost unless Zotero was started from a console) and Zotero.debug() (a no-op unless debug output is enabled), so this file is the only durable record of a boot-time failure. A healthy session adds three lines (startup, open, shutdown); an outage adds two more, and a run of flaps two more, whatever their length. No failure mode writes per tick.


📸 Screenshot Examples

typescript
// Capture main Zotero window
await zotero_screenshot({ target: 'main-window' });

// Capture your plugin's panel with highlight
await zotero_screenshot({
  target: 'element',
  selector: '#my-plugin-panel',
  highlightSelector: '#my-plugin-button'
});

// Capture a specific window by ID (use zotero_list_windows to find IDs)
await zotero_screenshot({
  target: 'window',
  windowId: 12345
});

// Capture element after triggering UI action
await zotero_execute_js({ code: 'document.querySelector("#menu").click()' });
await zotero_screenshot({ target: 'element', selector: 'menupopup[state="open"]' });

🧑‍💻 Development

bash
# Clone and install
git clone https://github.com/introfini/mcp-server-zotero-dev.git
cd mcp-server-zotero-dev
npm install

# Build everything
npm run build

# Build individual packages
npm run build:server
npm run build:plugin

# Run tests
npm test

# Development mode (watch)
npm run dev
mcp-server-zotero-dev/
├── packages/
│   ├── mcp-server/               # MCP server (npm package)
│   │   ├── src/
│   │   │   ├── index.ts          # MCP server entry
│   │   │   ├── rdp/              # RDP client
│   │   │   ├── tools/            # Tool implementations
│   │   │   └── prompts/          # Slash commands
│   │   └── package.json
│   │
│   └── zotero-plugin-mcp-rdp/    # Tiny Zotero plugin (.xpi)
│       ├── src/
│       │   └── bootstrap.js      # Starts RDP server (shipped verbatim)
│       ├── addon/
│       │   └── manifest.json
│       └── package.json
│
├── docs/                         # Documentation
└── package.json                  # Monorepo root

📚 Resources


🤝 Contributing

Contributions are welcome. See CONTRIBUTING.md for setup, test conventions and the codebase-specific rules worth knowing before you start.

The short version:

  1. Follow existing code patterns
  2. Add tests for new features, and skip rather than fail when Zotero is not running
  3. Update documentation
  4. There is no CI, so run npm run build, npm run typecheck, npm run lint and npm test yourself, and say in the PR which Zotero version you verified against

📄 License

MIT © introfini


Acknowledgments

Installation

TypingMind
{
  "mcpServers": {
    "mcp-server-zotero-dev": {
      "command": "npx",
      "args": [
        "-y",
        "@introfini/mcp-server-zotero-dev"
      ],
      "env": {
        "ZOTERO_RDP_PORT": "<ZOTERO_RDP_PORT>"
      }
    }
  }
}

Available Tools

  • zotero_ping

    Test connection to Zotero and get version info. Use this to verify that Zotero is running and the MCP Bridge for Zotero plugin is active.

  • zotero_execute_js

    Execute JavaScript code in Zotero's privileged chrome context. Has full access to Zotero APIs (Zotero.*, ZoteroPane, etc.). Use for testing code snippets, inspecting state, or performing actions. Code with top-level 'return' statements is auto-wrapped in an IIFE. Tip: For complex objects, use JSON.stringify(obj) to get full data. IMPORTANT: Before calling unknown APIs, use zotero_inspect_object to discover available methods - don't guess API names.

  • zotero_get_pref

    Get a Zotero preference value. Common prefs: extensions.zotero., general., export.*

  • zotero_set_pref

    Set a Zotero preference value. Use with caution - some preferences require restart.

  • zotero_search_prefs

    Search and list Zotero/Firefox preferences. Use to discover available preference keys before using zotero_get_pref/zotero_set_pref. Can filter by branch prefix (e.g., 'extensions.zotero.') and/or substring pattern.

  • zotero_inspect_object

    Inspect a Zotero/JavaScript object to discover its methods and properties. Use to explore APIs like Zotero.Items, ZoteroPane, Zotero.Prefs without manual JS execution. Returns methods with signatures and properties with their types/values.

  • zotero_open_preferences

    Open Zotero's preferences/settings window. Optionally navigate directly to a specific pane. For built-in panes, use: 'general', 'sync', 'export', 'cite', 'advanced'. For plugin panes, use the plugin ID (e.g., 'zotseek@zotero.org' or just 'zotseek').

  • zotero_screenshot

    Capture a screenshot of Zotero. Can capture the main window, a specific window, or a specific element by CSS selector. Optionally highlight an element with a red border.

  • zotero_inspect_element

    Find DOM elements by CSS selector and return their details. Returns: tagName, id, className, attributes, text content, bounding rect, child count.

  • zotero_get_dom_tree

    Get a simplified DOM tree structure. Shows tag names, IDs, classes, and child counts for navigation.

  • zotero_get_styles

    Get computed CSS styles for an element. Useful for debugging layout and styling issues.

  • zotero_list_windows

    List all open Zotero windows with their IDs, types, and titles. Use the windowId in other tools to target specific windows.

  • zotero_read_logs

    Read Zotero's debug log output. Shows recent debug messages from Zotero.debug() calls.

  • zotero_read_errors

    Read errors from Zotero's error console. Returns JavaScript errors with stack traces and source locations.

  • zotero_clear_logs

    Clear the debug log buffer and error console.

  • zotero_watch_logs

    Start/stop watching for new log messages. Use action='start' to begin collecting, 'get' to retrieve collected logs, 'stop' to end.

  • zotero_scaffold_build

    Build a Zotero plugin project using zotero-plugin-scaffold. Runs 'npm run build' or 'npm run build:dev' in the project directory.

  • zotero_scaffold_serve

    Start/stop the zotero-plugin-scaffold dev server with hot reload. This watches for changes and automatically rebuilds/reloads the plugin.

  • zotero_scaffold_lint

    Run ESLint on a Zotero plugin project.

  • zotero_scaffold_typecheck

    Run TypeScript type checking on a Zotero plugin project.

  • zotero_plugin_reload

    Reload a Zotero plugin. If a plugin ID is provided, reloads that specific plugin. Otherwise attempts to reload based on the current project.

  • zotero_plugin_list

    List all installed Zotero plugins/add-ons with their IDs, names, versions, and status.

  • zotero_plugin_install

    Install a Zotero plugin from a local XPI file. The plugin will be installed and Zotero may need to be restarted.

  • zotero_db_query

    Execute a SELECT query on Zotero's database. Only SELECT queries are allowed for safety. Note: Database may be locked if Zotero is running - a copy may be used.

  • zotero_db_schema

    Get database schema information. If table is specified, returns columns for that table. Otherwise returns list of all tables.

  • zotero_db_stats

    Get database statistics: item counts, file size, etc.

Use MCP Server Zotero Dev MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Server Zotero Dev is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Server Zotero Dev as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Server Zotero Dev MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-server-zotero-dev": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-zotero-dev-monorepo"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Server Zotero Dev MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Server Zotero Dev MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Server Zotero Dev to help me with this task?
MCP Server Zotero Dev
Sure. I read it.
Here is what I found using MCP Server Zotero Dev.

Frequently asked questions

What is the MCP Server Zotero Dev MCP server used for?

MCP Server Zotero Dev is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Server Zotero Dev MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Server Zotero Dev with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Server Zotero Dev MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Server Zotero Dev connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Server Zotero Dev MCP to TypingMind?

MCP Server Zotero Dev runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Server Zotero Dev MCP provide in TypingMind?

MCP Server Zotero Dev exposes 26 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Server Zotero Dev MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Server Zotero Dev requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

setup-dev

Set up Zotero plugin development environment from scratch

debug-plugin

Connect to Zotero and start debugging your plugin

fix-errors

Find and fix errors from Zotero's error console

inspect-api

Interactive exploration of Zotero's JavaScript APIs

migrate-z7

Help migrate a plugin from Zotero 6 to Zotero 7

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇