Skip to main content

Model Context Protocol server for Zotero

GitHub branch status PyPI - Version

This project is a python server that implements the Model Context Protocol (MCP) for Zotero, giving you access to your Zotero library within AI assistants. It is intended to implement a small but maximally useful set of interactions with Zotero for use with MCP clients.

Zotero Server MCP server

Features

This MCP server provides the following tools:

  • zotero_search_items: Search for items in your Zotero library using a text query
  • zotero_item_metadata: Get detailed metadata information about a specific Zotero item
  • zotero_item_fulltext: Get the full text of a specific Zotero item (i.e. PDF contents)

These can be discovered and accessed through any MCP client or through the MCP Inspector.

Each tool returns formatted text containing relevant information from your Zotero items, and AI assistants such as Claude can use them sequentially, searching for items then retrieving their metadata or text content.

Installation

This server can either run against either a local API offered by the Zotero desktop application) or through the Zotero Web API. The local API can be a bit more responsive, but requires that the Zotero app be running on the same computer with the API enabled. To enable the local API, do the following steps:

  1. Open Zotero and open "Zotero Settings"
  2. Under the "Advanced" tab, check the box that says "Allow other applications on this computer to communicate with Zotero".

To use the Zotero Web API, you'll need to create an API key and find your Library ID (usually your User ID) in your Zotero account settings here: https://www.zotero.org/settings/keys

These are the available configuration options:

  • ZOTERO_LOCAL=true: Use the local Zotero API (default: false, see note below)
  • ZOTERO_API_KEY: Your Zotero API key (not required for the local API)
  • ZOTERO_LIBRARY_ID: Your Zotero library ID (your user ID for user libraries, not required for the local API)
  • ZOTERO_LIBRARY_TYPE: The type of library (user or group, default: user)

uvx with Local Zotero API

To use this with Claude Desktop and a direct python install with uvx, add the following to the mcpServers configuration:

{
  "mcpServers": {
    "zotero": {
      "command": "uvx",
      "args": ["--upgrade", "zotero-mcp"],
      "env": {
        "ZOTERO_LOCAL": "true",
        "ZOTERO_API_KEY": "",
        "ZOTERO_LIBRARY_ID": ""
      }
    }
  }
}

The --upgrade flag is optional and will pull the latest version when new ones are available. If you don't have uvx installed you can use pipx run instead, or clone this repository locally and use the instructions in Development below.

Docker with Zotero Web API

If you want to run this MCP server in a Docker container, you can use the following configuration, inserting your API key and library ID:

{
  "mcpServers": {
    "zotero": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "ZOTERO_API_KEY=PLACEHOLDER",
        "-e", "ZOTERO_LIBRARY_ID=PLACEHOLDER",
        "ghcr.io/kujenga/zotero-mcp:main"
      ],
    }
  }
}

To update to a newer version, run docker pull ghcr.io/kujenga/zotero-mcp:main. It is also possible to use the docker-based installation to talk to the local Zotero API, but you'll need to modify the above command to ensure that there is network connectivity to the Zotero application's local API interface.

Development

Information on making changes and contributing to the project.

  1. Clone this repository
  2. Install dependencies with uv by running: uv sync
  3. Create a .env file in the project root with the environment variables above

Start the MCP Inspector for local development:

npx @modelcontextprotocol/inspector uv run zotero-mcp

To test the local repository against Claude Desktop, run echo $PWD/.venv/bin/zotero-mcp in your shell within this directory, then set the following within your Claude Desktop configuration

{
  "mcpServers": {
    "zotero": {
      "command": "/path/to/zotero-mcp/.venv/bin/zotero-mcp"
      "env": {
        // Whatever configuration is desired.
      }
    }
  }
}

Running Tests

To run the test suite:

uv run pytest

Docker Development

Build the container image with this command:

docker build . -t zotero-mcp:local

To test the container with the MCP inspector, run the following command:

npx @modelcontextprotocol/inspector \
    -e ZOTERO_API_KEY=$ZOTERO_API_KEY \
    -e ZOTERO_LIBRARY_ID=$ZOTERO_LIBRARY_ID \
    docker run --rm -i \
        --env ZOTERO_API_KEY \
        --env ZOTERO_LIBRARY_ID \
        zotero-mcp:local

Relevant Documentation

Metadata

Release files for iflow-mcp_zotero-mcp 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_zotero-mcp 0.1.6
File Size Uploaded
iflow_mcp_zotero_mcp-0.1.6.tar.gz 28.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_zotero-mcp 0.1.6
File Interpreter ABI Platform
iflow_mcp_zotero_mcp-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / iflow_mcp_zotero_mcp-0.1.6.tar.gz

Download URL iflow_mcp_zotero_mcp-0.1.6.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
71d7bd0600581bcb4612fe11493047e89ceeeb244df2ddbd2124f148800895a2
BLAKE2b-256 checksum
How to use checksums
1e24e72899a0100bb066c141d74e3c5bd136cbc5995e73f399397f6437587ff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / iflow_mcp_zotero_mcp-0.1.6-py3-none-any.whl

Download URL iflow_mcp_zotero_mcp-0.1.6-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4702ff4e430b1708b0b2649e57c44c293b81a5803fd2d19694f95c0e7a2827a3
BLAKE2b-256 checksum
How to use checksums
70f82f7f1bb229c8e50574f38b4a1c219c7c7d8901a18afcda707f24df4f0615
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page