mcp-server-zotero-dev

v1.1.5
io.github.introfini/mcp-server-zotero-dev Checked 1 hour ago Published 15 days ago

MCP server enabling AI assistants to build, test, and debug Zotero plugins

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

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. Prefer a dedicated tool when one fits the question (zotero_db_query for library data, zotero_read_logs/zotero_read_errors for output, zotero_inspect_object for API discovery); reach for raw JS only when none does. 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_ins…

ParameterTypeDescription
code *stringJavaScript code to execute. Can be async (automatically awaited). You can use 'return' at top level - code will be auto-wrapped in IIFE.
awaitPromisebooleanWhether to await the result if it's a Promise (default: true)

zotero_get_pref

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

ParameterTypeDescription
key *stringPreference key (e.g., 'extensions.zotero.debug.log')

zotero_set_pref

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

ParameterTypeDescription
key *stringPreference key
value *Value to set (string, number, or boolean)

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.

ParameterTypeDescription
branchstringPreference branch to list (e.g., 'extensions.zotero.', 'general.'). Defaults to 'extensions.zotero.' if not specified.
limitnumberMaximum number of results to return (default: 50)
patternstringSubstring filter for preference names (case-insensitive)

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.

ParameterTypeDescription
path *stringObject path to inspect (e.g., 'Zotero', 'Zotero.Items', 'ZoteroPane', 'Zotero.Prefs')
depthnumberPrototype chain depth to inspect (default: 2, max: 5)
filterstringWhat to include: 'all' (default), 'methods' only, 'properties' only, or 'own' (only own properties, not inherited)
patternstringFilter member names by substring (case-insensitive)

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').

ParameterTypeDescription
paneIdstringOptional pane ID to navigate to. Built-in: 'general', 'sync', 'export', 'cite', 'advanced'. For plugins: use the plugin ID (e.g., 'zotseek@zotero.org'). If omitted, opens to the last viewed pane.

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.

ParameterTypeDescription
formatstringImage format (default: png)
highlightSelectorstringCSS selector for element to highlight with red border before capture
scalenumberScale factor for the screenshot (default: 1)
selectorstringCSS selector for element to capture (required if target='element')
targetstringWhat to capture: main-window (default), specific window, or element
windowIdnumberWindow outerWindowID (use zotero_list_windows to find). Required if target='window'

zotero_inspect_element

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

ParameterTypeDescription
selector *stringCSS selector to find elements
limitnumberMaximum number of elements to return (default: 10)
windowIdnumberWindow outerWindowID (optional, defaults to main window)

zotero_get_dom_tree

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

ParameterTypeDescription
depthnumberMaximum depth to traverse (default: 3)
selectorstringCSS selector for root element (default: document.documentElement)
windowIdnumberWindow outerWindowID (optional, defaults to main window)

zotero_get_styles

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

ParameterTypeDescription
selector *stringCSS selector for the element
propertiesarraySpecific CSS properties to return (default: common layout properties)
windowIdnumberWindow outerWindowID (optional)

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_click_element

Click an element in a Zotero window by CSS selector (toolbar/menu button, preference control, list row, etc.). Resolves light DOM first, then pierces open shadow roots (Zotero's XUL custom elements keep internals in shadow DOM). If the selector matches several elements, use index to pick one. By default calls element.click() (which fires the XUL command for buttons/menuitems); set mouseEvents=true to dispatch a synthesized mousedown/mouseup/click sequence for content that needs real mouse events. Cannot dismiss a BLOCKING native modal dialog (Services.prompt.confirmEx) — see the module note.

ParameterTypeDescription
selector *stringCSS selector for the element to click
indexnumberWhich match to click when the selector matches several (0-based, default 0)
mouseEventsbooleanDispatch synthesized mousedown/mouseup/click instead of element.click() (default false). Use for HTML content that needs real mouse events. Note: these events are untrusted (isTrusted=false); some nat…
windowIdnumberWindow outerWindowID (optional, defaults to main window)

zotero_send_keys

Type text into an element in a Zotero window (an input/textarea or any contenteditable). If a selector is given the element is focused first (light DOM, then open shadow roots); otherwise the window's active element is used. Fires input/change events so listeners react. Optionally clear first and/or press Enter afterwards. Note: a few widgets (e.g. Zotero's quick-search) only fully react to their own command handler, not a raw input event — prefer a direct field where possible.

ParameterTypeDescription
text *stringText to type into the element
clearbooleanClear the field before typing (default false)
pressEnterbooleanDispatch an Enter keydown/keypress/keyup after typing (default false). Note: these events are untrusted (isTrusted=false) and some widgets ignore them — a direct input + change is more reliable wher…
selectorstringCSS selector for the target field (optional; defaults to the active element)
windowIdnumberWindow outerWindowID (optional, defaults to main window)

zotero_read_logs

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

ParameterTypeDescription
filterstringFilter logs containing this string (case-insensitive)
levelstringFilter by log level (default: all)
linesnumberNumber of recent lines to return (default: 100)

zotero_read_errors

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

ParameterTypeDescription
linesnumberNumber of recent errors to return (default: 20)

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.

ParameterTypeDescription
action *stringAction to perform

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.

ParameterTypeDescription
modestringBuild mode (default: development)
projectPathstringPath to plugin project (default: current working 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.

ParameterTypeDescription
action *stringAction to perform
projectPathstringPath to plugin project (default: current working directory)

zotero_scaffold_lint

Run ESLint on a Zotero plugin project.

ParameterTypeDescription
fixbooleanAutomatically fix problems (default: false)
projectPathstringPath to plugin project (default: current working directory)

zotero_scaffold_typecheck

Run TypeScript type checking on a Zotero plugin project.

ParameterTypeDescription
projectPathstringPath to plugin project (default: current working directory)

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.

ParameterTypeDescription
pluginIdstringPlugin ID to reload (e.g., 'my-plugin@example.com'). Use zotero_plugin_list to find IDs.

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.

ParameterTypeDescription
path *stringPath to the XPI file to install

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.

ParameterTypeDescription
query *stringSQL SELECT query to execute
limitnumberMaximum rows to return (default: 100, max: 1000)
paramsarrayQuery parameters for prepared statements

zotero_db_schema

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

ParameterTypeDescription
tablestringTable name to get schema for (optional)

zotero_db_stats

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