Zotero文献管理服务器

Zotero MCP服务器是一个用于管理和操作Zotero文献库的工具,支持文献的获取、搜索、创建、更新、删除以及集合管理等功能。

  • by ManuelAlejandroMartinezFlores
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 manuelalejandromartinezflores/zotero-mcp-server

使用说明

zotero mcp服务器

MCP服务器先生
可用工具

  • zotero_get_zotero_items: Get all items from Zotero
    Args:
        max_items: max number of items to return (default = 5)

  • zotero_search_zotero: Get all items from Zotero
  Args:
      query: terms to search
      max_items: (optional, default = 5) max number of items to return
      item_type: (optional, default = '') 'book', 'journalArticle', etc

  • zotero_create_item_zotero: Create a new item in your library
  Args:
    item_data (dict): Item metadata using template {'itemType': 'journalArticle', 'title': '', 'creators': [{'creatorType': 'author', 'firstName': '', 'lastName': ''}], 'abstractNote': '', 'publicationTitle': '', 'volume': '', 'issue': '', 'pages': '', 'date': '', 'series': '', 'seriesTitle': '', 'seriesText': '', 'journalAbbreviation': '', 'language': '', 'DOI': '', 'ISSN': '', 'shortTitle': '', 'url': '', 'accessDate': '', 'archive': '', 'archiveLocation': '', 'libraryCatalog': '', 'callNumber': '', 'rights': '', 'extra': '', 'tags': [], 'collections': [], 'relations': {}}

  • zotero_update_item_zotero: Create a new item in your library
  Args:
      item_key: key for zotero item
      item_data (dict): Item metadata using template {'itemType': 'journalArticle', 'title': '', 'creators': [{'creatorType': 'author', 'firstName': '', 'lastName': ''}], 'abstractNote': '', 'publicationTitle': '', 'volume': '', 'issue': '', 'pages': '', 'date': '', 'series': '', 'seriesTitle': '', 'seriesText': '', 'journalAbbreviation': '', 'language': '', 'DOI': '', 'ISSN': '', 'shortTitle': '', 'url': '', 'accessDate': '', 'archive': '', 'archiveLocation': '', 'libraryCatalog': '', 'callNumber': '', 'rights': '', 'extra': '', 'tags': [], 'collections': [], 'relations': {}}

  • zotero_delete_item_zotero: Delete an item in your library
  Args:
      item_key: the key for the zotero item

  • zotero_get_zotero_collections: Get all items from Zotero
  Args:
      max_items: max number of items to return (default = 5)

  • zotero_create_zotero_collection: Create a new collection
  Args:
      name: name of the collection
      parent_collection: (optional, default = '') name of parent collection if necessary

  • zotero_add_item_zotero_collection: Add item to collection
  Args:
      item_key: key of item
      collection_key: key of collection

  • zotero_export_zotero_library: Export the bibliography of every item
  Args:
      format: (optional, default ='bibtex')

  • zotero_export_zotero_collection: Export the bilbiography of a collection
  Args:
      collection_key: key of the collection to export
      format: (optional, default ='bibtex')

使用示例

💬 You: show me my zotero collections
🤔 Assistant:
🔧 Executing zotero_get_zotero_collections...
Here’s a quick snapshot of all the Zotero collections in your library (up to 20, which is the current total):

| Collection Key | Name      | Items | Sub‑Collections |
|-----------------|-----------|-------|-----------------|
| **UNRV6CM8**    | PAPERS    | 0     | 0 |
| **AZPEBBV9**    | ANALYSIS  | 0     | 0 |
| **BQFKVV3F**    | TEST      | 0     | 0 |
| **HDL9WF3K**    | RETOS     | 6     | 0 |
| **L79PUSCD**    | IPC       | 6     | 0 |

If you’d like to see the items inside any of these collections, just let me know the collection key (e.g., `HDL9WF3K`) and I can pull up the list for you.

💬 You: create a new item for the paper titled 'Hp spaces in several variables' by Charles Fefferman and Elias Stein
🤔 Assistant:
🔧 Executing zotero_create_item_zotero...
✅ The paper **“Hp spaces in several variables”** by Charles Fefferman and Elias Stein has been added to your Zotero library as a journal article. 
If you’d like to add more details (publication year, journal name, volume/issue, pages, DOI, etc.) or place it into a specific collection, just let me know and I’ll update the entry for you.

💬 You: add this item to the collection ANALYSIS
🤔 Assistant: 
🔧 Executing zotero_get_zotero_items...
🔧 Executing zotero_add_item_zotero_collection...
✅ The paper **“Hp spaces in several variables”** has been added to the **ANALYSIS** collection.  
If you need any further edits or want to add more metadata (e.g., journal, volume, pages, DOI), just let me know!

要安装,请克隆仓库或下载zip文件。建议使用 uv 对于依赖关系管理,可以在 requirements.txt。它可以使用Anthropic的SDK和以下配置参数添加到任何LLM中

{
  "command": "uv",
  "args": [
    "run", "--repository", "PATH/TO/REPO", "PATH/TO/REPO/zotero_mcp_server.py"
  ]
}

为了访问您的zotero信息,您需要您的用户id和API密钥。它们可以在 .env 文件为

LIBRARY_ID = "12334"
ZOTERO_API_KEY = "asdfasfas"
LIBRARY_TYPE = "user"