Zotero MCP server

Integrates with Zotero to enable listing collections, retrieving item details, searching libraries, and fetching recent papers for research and citation management.
Back to servers
Setup instructions
Provider
Abhishek Kalia
Release date
Dec 20, 2024
Language
TypeScript
Package
Stats
1.6K downloads
123 stars

A Model Context Protocol server that seamlessly integrates with your Zotero library. This MCP server enables Claude to access and interact with your Zotero collections, allowing you to search, retrieve, and manage your academic references directly within Claude's interface.

Installation

Prerequisites

Before installing the MCP Zotero server, you need to obtain your Zotero credentials:

  1. Create an API key at https://www.zotero.org/settings/keys
  2. Use the API key to get your user ID:
curl -H "Zotero-API-Key: YOUR_API_KEY" https://api.zotero.org/keys/current

The response will contain your user ID:

{
  "userID": 123456,
  "username": "your_username",
  "access": {
    "user": {
      "library": true,
      "files": true,
      "notes": true,
      "write": true
    }
  }
}

Setting Environment Variables

Set the required environment variables:

export ZOTERO_API_KEY="your-api-key"
export ZOTERO_USER_ID="user-id-from-curl"

Verify Credentials

Ensure your credentials work by testing them:

curl -H "Zotero-API-Key: $ZOTERO_API_KEY" \
     "https://api.zotero.org/users/$ZOTERO_USER_ID/collections"

You should receive a list of your collections in the response.

Install and Run

Install the server globally (recommended approach):

npm install -g mcp-zotero
mcp-zotero

Alternatively, run directly with npx:

npx mcp-zotero

Usage

Integration with Claude Desktop

To use the MCP Zotero server with Claude Desktop, add the following configuration:

{
  "mcpServers": {
    "zotero": {
      "command": "mcp-zotero",
      "env": {
        "ZOTERO_API_KEY": "YOUR_API_KEY",
        "ZOTERO_USER_ID": "YOUR_USER_ID"
      }
    }
  }
}

Available Tools

The MCP Zotero server provides several tools for interacting with your Zotero library:

  • get_collections: Lists all collections in your library
  • get_collection_items: Retrieves items from a specific collection
  • get_item_details: Provides detailed information about a specific paper
  • search_library: Searches your entire Zotero library
  • get_recent: Retrieves recently added papers

Troubleshooting

If you encounter issues with the MCP Zotero server:

Verify Environment Variables

Check that your environment variables are properly set:

echo $ZOTERO_API_KEY
echo $ZOTERO_USER_ID

Check Installation

Verify the server is installed correctly:

npm list -g mcp-zotero

Reinstall if Necessary

If problems persist, try reinstalling:

npm uninstall -g mcp-zotero
npm install -g mcp-zotero

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "zotero" '{"command":"mcp-zotero","env":{"ZOTERO_API_KEY":"YOUR_API_KEY","ZOTERO_USER_ID":"YOUR_USER_ID"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "zotero": {
            "command": "mcp-zotero",
            "env": {
                "ZOTERO_API_KEY": "YOUR_API_KEY",
                "ZOTERO_USER_ID": "YOUR_USER_ID"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "zotero": {
            "command": "mcp-zotero",
            "env": {
                "ZOTERO_API_KEY": "YOUR_API_KEY",
                "ZOTERO_USER_ID": "YOUR_USER_ID"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later