Zotero MCP Server

Zotero MCP Server

Enables AI assistants to search, cite, and manage research references directly from a Zotero library.

Category
访问服务器

README

Zotero MCP Server

A Model Context Protocol server that provides programmatic access to Zotero reference libraries. This server enables AI assistants to search, cite, and manage research references directly from your Zotero library.

Features

Tools

  • search_items - Search and filter items in your library
  • get_item - Retrieve a single item by key or DOI
  • generate_citation - Generate formatted citations in multiple styles
  • extract_pdf_text - Extract full-text content from PDF attachments
  • create_item - Add new items to your library
  • update_item - Modify existing item metadata
  • delete_items - Remove items from your library
  • manage_collections - Create and organize collections
  • manage_tags - Add and remove tags from items

Resources

  • zotero://collections - Access collection hierarchy and metadata
  • zotero://tags - Browse all tags in your library
  • zotero://citation-styles - List available citation styles

Prerequisites

  • Node.js 20.16.0 or higher
  • A Zotero account with API access
  • Zotero API key from https://www.zotero.org/settings/keys

Installation

Option 1: NPM (Coming Soon)

npm install -g zotero-mcp-server

Option 2: From Source

git clone <repository-url>
cd zotero-mcp-server
npm install
npm run build

Configuration

Getting Your Credentials

  1. Visit https://www.zotero.org/settings/keys
  2. Create a new API key with appropriate permissions
  3. Note your User ID (displayed at the top of the page)
  4. Copy the generated API key

Environment Variables

Create a .env file in the project root:

ZOTERO_API_KEY=your_api_key_here
ZOTERO_USER_ID=your_user_id_here

For group libraries, use ZOTERO_GROUP_ID instead of ZOTERO_USER_ID.

Optional Configuration

ZOTERO_BASE_URL=https://api.zotero.org
ZOTERO_TIMEOUT=30000
ZOTERO_MAX_RETRIES=3
CACHE_ENABLED=true
CACHE_TTL_SECONDS=300

Usage with Claude Desktop

Add this configuration to your Claude Desktop config file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "zotero": {
      "command": "node",
      "args": ["/absolute/path/to/ZoteroMCP/dist/index.js"],
      "env": {
        "ZOTERO_API_KEY": "your_api_key_here",
        "ZOTERO_USER_ID": "your_user_id_here"
      }
    }
  }
}

Restart Claude Desktop after making this change.

Tool Usage Examples

Searching Items

Search your library with various filters:

// Search by text query
{
  "query": "machine learning",
  "limit": 10
}

// Filter by item type and tags
{
  "itemType": "journalArticle",
  "tag": ["ai", "research"],
  "sort": "dateAdded",
  "direction": "desc"
}

// Search within a collection
{
  "collection": "COLLECTION_KEY",
  "limit": 25
}

Generating Citations

Create formatted citations in various styles:

{
  "itemKeys": ["ITEM_KEY_1", "ITEM_KEY_2"],
  "style": "apa"
}

// Supported styles include:
// apa, chicago-note-bibliography, mla, ieee, nature,
// science, harvard-cite-them-right, vancouver, and 10,000+ more

Extracting PDF Text

Extract text content from PDF attachments:

{
  "itemKey": "PDF_ATTACHMENT_KEY",
  "pages": {
    "start": 1,
    "end": 5
  }
}

Note: PDFs must be indexed by Zotero Desktop for full-text extraction to work.

Creating Items

Add new items to your library:

{
  "itemType": "journalArticle",
  "title": "Understanding Neural Networks",
  "creators": [
    {
      "creatorType": "author",
      "firstName": "Jane",
      "lastName": "Smith"
    }
  ],
  "date": "2024",
  "DOI": "10.1234/example",
  "tags": ["neural-networks", "deep-learning"],
  "collections": ["COLLECTION_KEY"]
}

Managing Collections

Create and organize collections:

// List all collections
{
  "action": "list"
}

// Create a new collection
{
  "action": "create",
  "name": "Machine Learning Papers"
}

// Create a nested collection
{
  "action": "create",
  "name": "Deep Learning",
  "parentCollection": "PARENT_COLLECTION_KEY"
}

Managing Tags

Add or remove tags from items:

// Add tags to an item
{
  "action": "add_to_item",
  "itemKey": "ITEM_KEY",
  "tags": ["ai", "research"]
}

// Remove tags from an item
{
  "action": "remove_from_item",
  "itemKey": "ITEM_KEY",
  "tag": "outdated"
}

// List all tags
{
  "action": "list"
}

Resource Usage Examples

Collections Resource

zotero://collections

Returns all collections with hierarchy information, item counts, and metadata.

zotero://collections/COLLECTION_KEY

Returns details for a specific collection.

Tags Resource

zotero://tags

Returns all tags in your library with usage counts.

Citation Styles Resource

zotero://citation-styles

Returns a list of commonly used citation styles with their identifiers.

API Details

Rate Limiting

The server implements automatic rate limiting with exponential backoff:

  • Initial retry delay: 5 seconds
  • Maximum retries: 3 (configurable)
  • Respects Zotero API Backoff and Retry-After headers
  • Requests are queued during rate limit periods

Caching

Intelligent caching reduces API calls and improves performance:

  • Item templates: 1 hour
  • Collections and tags: 15 minutes
  • Search results: 5 minutes
  • PDF full-text: 30 days
  • Citations: 1 hour

Error Handling

All errors are transformed into descriptive messages:

  • 400 - Invalid request parameters
  • 401/403 - Authentication failure (check API key)
  • 404 - Item or resource not found
  • 409 - Version conflict (item modified elsewhere)
  • 412 - Precondition failed (library version changed)
  • 429 - Rate limited (automatic retry)
  • 5xx - Server error (automatic retry)

Development

Building from Source

npm install
npm run build

Running in Development Mode

npm run dev

Project Structure

src/
├── index.ts              # Server entry point
├── config/
│   └── default.ts        # Configuration management
├── services/
│   ├── zotero-client.ts  # Zotero API client
│   ├── cache-manager.ts  # Caching layer
│   └── pdf-extractor.ts  # PDF text extraction
├── tools/
│   └── index.ts          # MCP tool implementations
├── resources/
│   └── index.ts          # MCP resource implementations
├── utils/
│   ├── validators.ts     # Input validation
│   └── error-handler.ts  # Error transformation
└── types/
    └── zotero.ts         # Type definitions

Troubleshooting

Server won't start

Ensure you have created a .env file with valid credentials:

cp .env.example .env
# Edit .env and add your ZOTERO_API_KEY and ZOTERO_USER_ID

Authentication errors

  • Verify your API key at https://www.zotero.org/settings/keys
  • Ensure the API key has appropriate read/write permissions
  • Check that ZOTERO_USER_ID matches the ID shown on the API keys page

PDF extraction fails

  • PDFs must be indexed by Zotero Desktop application
  • Open Zotero Desktop and allow it to index PDF attachments
  • Verify the item has an actual PDF attachment (not just a link)

Claude Desktop doesn't show Zotero tools

  • Verify the absolute path in claude_desktop_config.json is correct
  • Check that environment variables in the config are set
  • Restart Claude Desktop completely (quit and reopen)
  • Check Claude Desktop logs: Help → View Logs

License

MIT

Contributing

Contributions are welcome. Please open an issue or submit a pull request.

Attribution

This MCP server uses the Zotero Web API to provide programmatic access to Zotero libraries. Zotero is a free, open-source reference management software developed by the Corporation for Digital Scholarship.

This project is not affiliated with, endorsed by, or sponsored by Zotero or the Corporation for Digital Scholarship.

Links

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选