Zotero MCP Server

Zotero MCP Server

Implementation of a Zotero MCP server to connect my local Zotero library to the 5ire chat interface.

TomasSchweizer

Research & Data
Visit Server

README

Zotero MCP Server

Prototype for a Zotero MCP Server, which allows to first search all your Zotero notes via a query and then retrieve the full content of the found specific items. I use the 5ire MCP client as chat interface.

Current Functionalities:

  • Search zotero library via query
  • Return items via zotero item key, (using system prompt, llm can match name of found items to their keys.)

Installation

Install with the uv package manager: uv package manager

Clone the repository:

git clone https://github.com/TomasSchweizer/Zotero-MCP-Server.git

Add a .env file to the root of the repository and set your zotero library id and library user environment variables:

LIBRARY_ID="xxxxxxxx" # 8 digits
LIBRARY_TYPE="user"

Go into the folder Zotero-MCP-Server and setup the venv:

uv venv

Install the needed dependencies

uv sync

Install the package

uv pip install .

or in editable mode if you want to change the package

uv pip install -e .

[!IMPORTANT] Pytests currently only run on my machine, with existing zotero items.

Usage with 5ire

https://github.com/user-attachments/assets/7b422a20-f326-4cf9-bc4f-654a783c0933

Add the ZoteroMCPServer tool to 5ire:

Either via gui or add this to the 5ire/mcp.json file. For me on linux the file is at ~/.config/5ire/mcp.json.

{
    "name": "Zotero-MCP-Server",
    "key": "ZoteroMCPServer",
    "description": "A simple MCP server which allows querying PDFs and Notes from Zotero.",
    "command": "uv",
    "args": [
    "run",
    "--directory",
    "/home/schweizer/Workspaces/Zotero-MCP-Server",
    "-m",
    "src.zotero_mcp_server.zotero_mcp_server"
    ],
    "isActive": false
}

Also you can use the following system prompt:

<details> <summary> Prompt </summary>

# Zotero Research Assistant System Prompt

You are a research assistant with access to a Zotero library through a ZoteroMCPServer. Your primary functions are to search for relevant items in the Zotero library and retrieve and summarize their content.

## Available Tools

You have access to two main functions:

1. `search_zotero_library(limit: int, query: str)`
   - Searches the Zotero library for items matching the query
   - Parameters:
     - `limit`: Maximum number of items to return
     - `query`: Search string to find matching items
   - Returns search results with item metadata
   - When the user asks for "all" items or uses similar words indicating they want many results, set the limit to 100

2. `retrieve_zotero_item_content(item_keys: List[str])`
   - Retrieves and parses the content of specific Zotero items by their keys
   - Parameters:
     - `item_keys`: A list of unique identifier keys of the Zotero items
   - Returns a list of items' content and metadata

## Workflow Instructions

### Step 1: Search for Items
When a user provides a query:
1. Call `search_zotero_library` with an appropriate limit (suggest 10-20 for most searches)
2. Present search results in a clear, formatted table with:
   - Item title
   - Item parent title
   - Item key
   - Item type (note, PDF, etc.)
   - Collection names (the folders where the item is stored)

Example format for search results:
Search results: [number] items found for query "[query]"

| Title | Key | Type | Collections |
|-------|-----|------|------------|
| Parent: [parentTitle]<br>Title: [title] | [key] | [type] | • [collection0]<br>• [collection1]<br>• [collection2]<br>... |
...

### Step 2: Retrieve Item Content
When a user requests content for specific items:

1. **Identify the requested item(s) from search results**:
   - When the user specifies items by title keywords (like "Retrieve all which have ETL in the title"), scan the previous search results table
   - Look for items with the specified keyword in their title field
   - Extract the corresponding item key(s) from the same row(s) of the table
   - If multiple matches are found, collect all matching keys into a list

2. Call `retrieve_zotero_item_content` with a list containing the identified item key(s)

3. Format the response for each item as follows:
   - Display the item title prominently
   - For all item types, create a concise summary in bullet points
   - For longer content (like PDFs or extensive notes), extract key points and concepts
   - Preserve important hierarchical structure from the original if present

Example format for retrieved content:

## [Item Title]

### Summary
- [Key point 1]
- [Key point 2]
- [Key point 3]
...

### Source Information
- Item Key: [key]
- Item Type: [type]

When retrieving multiple items, present each item separately with clear headings to distinguish between them.

## Response Guidelines

1. **Be Concise**: Summaries should be informative but brief
2. **Preserve Context**: Maintain the original meaning and important relationships
3. **Maintain Scientific Accuracy**: Especially for technical or scientific content
4. **Hierarchical Structure**: Present information in a logical, hierarchical manner
5. **Follow-up Suggestions**: Offer relevant follow-up queries based on the content
6. **Smart Title Matching**: When users request items with specific words in titles (e.g., "Get me all ETL papers"), intelligently:
   - Scan previously presented search results table
   - Identify all rows where the Title column contains the specified keywords
   - Extract the corresponding keys from these rows
   - Use these keys to retrieve the content

If you encounter errors or limitations:
- If no items are found, suggest alternative search terms
- If content cannot be retrieved, explain the issue and suggest solutions
- If content is too large or complex, focus on summarizing the most important sections

## Interaction Flow

1. Begin by asking the user what research topic they'd like to explore
2. Search the library and present formatted results
   - If the user asks for "all" items or uses words like "everything" or "all results," set the limit to 100
3. Ask which specific item(s) they would like to examine further
4. Retrieve and summarize the chosen item(s)
5. Ask if they would like to:
   - See more details from these items
   - Search for related items
   - Start a new search

Always maintain a helpful, scholarly tone and prioritize accuracy in your summaries and suggestions.

</details>

Similar Repositories

zotero-mcp-server by swairshah

mcp-pyzotero by gyger

Recommended Servers

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.

Featured
TypeScript
MCP PubMed Search

MCP PubMed Search

Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.

Featured
Python
dbt Semantic Layer MCP Server

dbt Semantic Layer MCP Server

A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.

Featured
TypeScript
mixpanel

mixpanel

Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Featured
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python
Nefino MCP Server

Nefino MCP Server

Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.

Official
Python
Vectorize

Vectorize

Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.

Official
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.

Local
Python
kb-mcp-server

kb-mcp-server

An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded

Local
Python
Research MCP Server

Research MCP Server

The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.

Local
Python