Skill Tracer
Skills › Scientific Agent Skills › pyzotero › mcp.md

mcp.md

124 lines · skills/pyzotero/references/mcp.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# MCP Server
2
3Pyzotero 1.15.2 ships an optional [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that exposes your **local Zotero library** and Semantic Scholar integration as tools for LLM clients (e.g., Claude Desktop).
4

MCP Server

Pyzotero 1.15.2 ships an optional Model Context Protocol (MCP) server that exposes your local Zotero library and Semantic Scholar integration as tools for LLM clients (e.g., Claude Desktop).

Raw lines 1 to 4
Uses an outside tool MCP :1
5## Requirements
6
7- **Zotero 7+** for local reads, **Zotero 10+** for local writes, with local API access enabled:
8 - Zotero → Settings → Advanced → **Allow other applications on this computer to communicate with Zotero**
9- Python 3.10+ (required by `pyzotero[mcp]`)
11Zotero-library tools read the local desktop API without a key. Semantic Scholar tools call an external network API. The server starts read-only; local write tools require explicit enablement and a separate local authorization key.

Requirements

  • Zotero 7+ for local reads, Zotero 10+ for local writes, with local API access enabled:
  • Zotero → Settings → Advanced → Allow other applications on this computer to communicate with Zotero
  • Python 3.10+ (required by pyzotero[mcp])

Zotero-library tools read the local desktop API without a key. Semantic Scholar tools call an external network API. The server starts read-only; local write tools require explicit enablement and a separate local authorization key.

Raw lines 5 to 12
13## Installation
15```bash
16# In a project
17uv add "pyzotero[mcp]==1.15.2"
19# As a standalone tool
20uv tool install "pyzotero[mcp]==1.15.2"
21```
23Run without installing:
25```bash
26uvx --from "pyzotero[mcp]==1.15.2" pyzotero-mcp
27```

Installation

# In a project
uv add "pyzotero[mcp]==1.15.2"

# As a standalone tool
uv tool install "pyzotero[mcp]==1.15.2"

Run without installing:

uvx --from "pyzotero[mcp]==1.15.2" pyzotero-mcp
Raw lines 13 to 28
29## Claude Desktop Configuration
31Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
33**If `pyzotero-mcp` is installed:**
35```json
37 "mcpServers": {
38 "zotero": {
39 "command": "pyzotero-mcp"
40 }
41 }
43```
45**Without installing (via uvx):**
47```json
49 "mcpServers": {
50 "zotero": {
51 "command": "uvx",
52 "args": ["--from", "pyzotero[mcp]==1.15.2", "pyzotero-mcp"]
53 }
54 }
56```

Claude Desktop Configuration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

**If pyzotero-mcp is installed:**

{
  "mcpServers": {
    "zotero": {
      "command": "pyzotero-mcp"
    }
  }
}

Without installing (via uvx):

{
  "mcpServers": {
    "zotero": {
      "command": "uvx",
      "args": ["--from", "pyzotero[mcp]==1.15.2", "pyzotero-mcp"]
    }
  }
}
Raw lines 29 to 57
58## Available Tools

Available Tools

Raw lines 58 to 59
60### Zotero Library Tools
62| Tool | Description |
63|------|-------------|
64| `search` | Search the local library by query, item type, collection, tag, or full-text content |
65| `get_item` | Get a single item by key |
66| `get_children` | Get child items (attachments, notes) of an item |
67| `list_collections` | List all collections |
68| `list_tags` | List all tags, optionally filtered by collection |
69| `get_fulltext` | Get full-text content of a PDF or other attachment |

Zotero Library Tools

ToolDescription
searchSearch the local library by query, item type, collection, tag, or full-text content
get_itemGet a single item by key
get_childrenGet child items (attachments, notes) of an item
list_collectionsList all collections
list_tagsList all tags, optionally filtered by collection
get_fulltextGet full-text content of a PDF or other attachment
Raw lines 60 to 70
71### Semantic Scholar Tools
73| Tool | Description |
74|------|-------------|
75| `find_related` | Request recommended papers for a seed paper |
76| `get_citations` | Find papers that cite a given paper |
77| `get_references` | Find papers referenced by a given paper |
78| `search_semantic_scholar` | Search Semantic Scholar's paper index |
80Semantic Scholar tools can optionally check whether results already exist in your local Zotero library (`check_library` parameter, enabled by default).

Semantic Scholar Tools

ToolDescription
find_relatedRequest recommended papers for a seed paper
get_citationsFind papers that cite a given paper
get_referencesFind papers referenced by a given paper
search_semantic_scholarSearch Semantic Scholar's paper index

Semantic Scholar tools can optionally check whether results already exist in your local Zotero library (check_library parameter, enabled by default).

Raw lines 71 to 81
82## MCP vs Web API vs CLI
84| Mode | Access | API key | Best for |
85|------|--------|---------|----------|
86| Web API (`Zotero(...)`) | Remote library | Private reads/writes | Automation, bulk CRUD, group libraries |
87| CLI (`pyzotero[cli]`) | Local Zotero | Local key for writes | Shell scripts, quick local search |
88| MCP (`pyzotero[mcp]`) | Local Zotero + external Semantic Scholar | Local key for enabled writes | LLM agents in sandboxed apps |
90For remote library management from Python, use the Web API client documented in the other reference files. Local library searches can work without external network access. Semantic Scholar lookups always need the network.

MCP vs Web API vs CLI

ModeAccessAPI keyBest for
Web API (Zotero(...))Remote libraryPrivate reads/writesAutomation, bulk CRUD, group libraries
CLI (pyzotero[cli])Local ZoteroLocal key for writesShell scripts, quick local search
MCP (pyzotero[mcp])Local Zotero + external Semantic ScholarLocal key for enabled writesLLM agents in sandboxed apps

For remote library management from Python, use the Web API client documented in the other reference files. Local library searches can work without external network access. Semantic Scholar lookups always need the network.

Raw lines 82 to 91
Uses an outside tool MCP :82
92## Tool Arguments and Results
94`search(query='', fulltext=False, itemtype='', collection='', tag='', limit=50, offset=0)` returns JSON text with `count` and `items`. For MCP, `tag='reviewed,unread'` means AND; `itemtype='journalArticle || book'` means OR. This differs from the CLI's repeated flags. Parse the tool's JSON text before using fields; failed calls can return an `error` object instead.
96Semantic Scholar tools return `papers` with counts and optional local-library annotations, not raw Zotero items. The installed implementation uses:
98| Tool | External API request | Response handling / limit |
99|------|----------------------|---------------------------|
100| `find_related` | GET `/graph/v1/paper/{id}`, then POST `/recommendations/v1/papers` with `positivePaperIds` | Normalizes `recommendedPapers`; up to 500 |
101| `get_citations` | GET `/graph/v1/paper/{id}/citations` | Extracts `data[].citingPaper`; one page, up to 1000 |
102| `get_references` | GET `/graph/v1/paper/{id}/references` | Extracts `data[].citedPaper`; one page, up to 1000 |
103| `search_semantic_scholar` | GET `/graph/v1/paper/search` | Extracts `data`; up to 100, relevance search |
105Host: `https://api.semanticscholar.org`. Pyzotero 1.15.2's integration does not send a Semantic Scholar API key or expose an API-key option, so do not imply a Zotero key authenticates these requests. Handle public-service rate limits. `check_library=False` avoids a local DOI-index scan. DOI absence and normalization can make local-library matching incomplete.
107The MCP tools do not expose an offset for citations/references/search and are not exhaustive literature search tools. Citation/reference `total` in the helper reflects the returned page, not a global count. `min_citations` filters fetched results locally. Leave the MCP `sort` argument empty: the wrapper sends it to relevance `/paper/search`, whose current official schema does not support sorting. Do not promise globally citation-ranked results.

Tool Arguments and Results

search(query='', fulltext=False, itemtype='', collection='', tag='', limit=50, offset=0) returns JSON text with count and items. For MCP, tag='reviewed,unread' means AND; itemtype='journalArticle || book' means OR. This differs from the CLI's repeated flags. Parse the tool's JSON text before using fields; failed calls can return an error object instead.

Semantic Scholar tools return papers with counts and optional local-library annotations, not raw Zotero items. The installed implementation uses:

ToolExternal API requestResponse handling / limit
find_relatedGET /graph/v1/paper/{id}, then POST /recommendations/v1/papers with positivePaperIdsNormalizes recommendedPapers; up to 500
get_citationsGET /graph/v1/paper/{id}/citationsExtracts data[].citingPaper; one page, up to 1000
get_referencesGET /graph/v1/paper/{id}/referencesExtracts data[].citedPaper; one page, up to 1000
search_semantic_scholarGET /graph/v1/paper/searchExtracts data; up to 100, relevance search

Host: https://api.semanticscholar.org. Pyzotero 1.15.2's integration does not send a Semantic Scholar API key or expose an API-key option, so do not imply a Zotero key authenticates these requests. Handle public-service rate limits. check_library=False avoids a local DOI-index scan. DOI absence and normalization can make local-library matching incomplete.

The MCP tools do not expose an offset for citations/references/search and are not exhaustive literature search tools. Citation/reference total in the helper reflects the returned page, not a global count. min_citations filters fetched results locally. Leave the MCP sort argument empty: the wrapper sends it to relevance /paper/search, whose current official schema does not support sorting. Do not promise globally citation-ranked results.

Raw lines 92 to 108
Uses an outside tool MCP :94
109## Enabling Writes
111For an explicitly intended local write workflow, install both extras and obtain a persistent key:
113```bash
114uv tool install "pyzotero[cli,mcp]==1.15.2"
115pyzotero authorize --app-name "Research assistant"
116# Choose Always Allow in Zotero if persistent access is intended.
117pyzotero-mcp --enable-writes
118```
120The server reads the stored key/server-ID pair created by the CLI. Alternatively, `PYZOTERO_LOCAL_API_KEY` and `PYZOTERO_LOCAL_SERVER_ID` override the file. Keep those values private. With `--enable-writes`, additional tools are registered: `list_item_fields`, `create_item`, `update_item`, `add_tags`, `create_collection`, `add_to_collection`, `remove_from_collection`, `move_to_collection`, and `add_attachment`. Attachment paths must be absolute; files are copied into Zotero storage.
122`delete_item` is registered only with `--enable-deletes`, which also enables writes. It permanently erases items and can propagate via sync; it does not move them to trash.
124Sources: [Pyzotero MCP documentation](https://pyzotero.readthedocs.io/en/latest/#mcp-server), [Graph schema](https://api.semanticscholar.org/graph/v1/swagger.json), [recommendations schema](https://api.semanticscholar.org/recommendations/v1/swagger.json).

Enabling Writes

For an explicitly intended local write workflow, install both extras and obtain a persistent key:

uv tool install "pyzotero[cli,mcp]==1.15.2"
pyzotero authorize --app-name "Research assistant"
# Choose Always Allow in Zotero if persistent access is intended.
pyzotero-mcp --enable-writes

The server reads the stored key/server-ID pair created by the CLI. Alternatively, PYZOTERO_LOCAL_API_KEY and PYZOTERO_LOCAL_SERVER_ID override the file. Keep those values private. With --enable-writes, additional tools are registered: list_item_fields, create_item, update_item, add_tags, create_collection, add_to_collection, remove_from_collection, move_to_collection, and add_attachment. Attachment paths must be absolute; files are copied into Zotero storage.

delete_item is registered only with --enable-deletes, which also enables writes. It permanently erases items and can propagate via sync; it does not move them to trash.

Sources: Pyzotero MCP documentation, Graph schema, recommendations schema.

Raw lines 109 to 124
Uses an outside tool MCP :124