zotero-mcp-code

A search skill for Zotero, a reference manager used to organise papers and other research sources. It runs several searches in code, removes duplicate results, ranks matches, and returns only the most relevant items.

In plain words
What is it for?
It helps find papers and other Zotero references by combining semantic and keyword searches, then displaying a ranked shortlist with optional abstracts.
Why use it?
It keeps large search results out of the agent's conversation, reducing crash risk and making comprehensive searches easier to handle.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kerim/zotero-code-execution/skill
Any agent
npx skills add kerim/zotero-code-execution --skill skill
Clone the repo
git clone --depth 1 https://github.com/kerim/zotero-code-execution

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,389 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.03389
Opus 5 $0.00022 $0.01695
Sonnet 5 $0.00009 $0.00678
Haiku 4.5 $0.00004 $0.00339

Measured 2d ago against content hash 0b00568118e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

zotero-mcp-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/SKILL.md · 503 lines

How it starts

The opening of the file, as written. The whole thing — 503 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Zotero MCP Code Execution Skill

Search your Zotero library using code execution for safe, efficient, comprehensive searches.

🎯 Core Concept

Instead of calling MCP tools directly (which loads all results into context and risks crashes), write Python code that:

  1. Fetches large datasets (50-100+ items per strategy)
  2. Filters and ranks in code execution environment
  3. Returns only top N results to context

Benefits:

  • ✅ No crash risk (large data stays in code)
  • ✅ Automatic multi-strategy search
  • ✅ Automatic deduplication
  • ✅ Automatic ranking
  • ✅ One function call instead of 5-10

🚀 Basic Usage

For 90% of Zotero searches, use this simple pattern:

import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths

from zotero_lib import SearchOrchestrator, format_results

# Single comprehensive search
orchestrator = SearchOrchestrator()
results = orchestrator.comprehensive_search(
    "user's query here",
    max_results=20  # Return top 20 most relevant
)

# Format and display
print(format_results(results, include_abstracts=True))

This automatically:

  • Performs semantic search (multiple variations)
  • Performs keyword search (multiple variations)
  • Performs tag-based search
  • Fetches 100+ items total
  • Deduplicates results
  • Ranks by relevance
  • Returns only top 20 to context

📋 Common Patterns

Pattern 1: Simple Search (Most Common)

User asks: "Find papers about embodied cognition"

import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()
results = orchestrator.comprehensive_search("embodied cognition", max_results=20)
print(format_results(results))

Pattern 2: Filtered Search

User asks: "Find recent journal articles about machine learning"

import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)

# Fetch broadly (safe - filtering happens in code)
items = library.search_items("machine learning", limit=100)

# Filter in code
filtered = orchestrator.filter_by_criteria(
    items,
    item_types=["journalArticle"],
    date_range=(2020, 2025)
)

print(format_results(filtered[:15]))

Read the full file on GitHub · 503 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 503 lines · 43 tokens per session scan A 0b00568118e2

Subscribe to this mod's changes

zotero-mcp-code is a skill published in the GitHub repository kerim/zotero-code-execution (59 stars, last pushed 7mo ago), licensed MIT. It adds 43 tokens to every session and 3,389 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

dormice

Operate Dormice self-hosted agent sandboxes — acquire a sandbox, run commands, move files, tune lifecycle policy — through the official E2B SDKs, the native HTTP API and SDK, or the dor CLI. Use when connecting to a Dormice server, running untrusted or AI-generated code in a sandbox, giving an agent a persistent…

BitMiracle-AI/Dormice · 85 tokens

verify

Drive Dormice's built daemon over its public HTTP and E2B surfaces.

BitMiracle-AI/Dormice · 1 tokens

literature-reviewer-skill

根据用户提供的论文主题,进行系统性中英文文献回顾(Literature Survey)。 采用8阶段工作流,支持CNKI、Web of Science、ScienceDirect等主流数据库, 无需API配置,通过浏览器自动化获取文献信息。 输出包含GB/T 7714-2015引文、标题、摘要的Markdown文档。 当用户提到"文献回顾"、"文献综述"、"帮我找文献"、"中英文文献搜索"、"写综述"等关键词时触发。 NOTE: The 'examples/' folder contains sample outputs and is not included in skill installation.

stephenlzc/AI-Powered-Literature-Review-Skills · 147 tokens

bibverify

Verify, repair, explain, and generate BibTeX references with Bibverify's DOI-first CLI and MCP tools.

Hylouis233/bibverify · 26 tokens

cli-anything-zotero

Full-featured CLI for Zotero reference management. Search, import by DOI/PMID, export BibTeX, attach PDFs, semantic search, manage tags/collections, and more. Use this tool whenever you need to interact with a Zotero library programmatically.

PiaoyangGuohai1/cli-anything-zotero · 61 tokens

onecite

Validate, clean, and audit academic references with OneCite from a local repository checkout. Use when a workflow needs deterministic citation verification, BibTeX cleanup, benchmark gating, or template discovery.

HzaCode/OneCite · 42 tokens