zotero-mcp-code
БесплатноЗапускает вложенные скриптыНе проверенSearch Zotero library using code execution for efficient multi-strategy searches without crash risks. Use this skill when the user needs comprehensive Zotero…
от kerim★ 62 звезды на 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:
- Fetches large datasets (50-100+ items per strategy)
- Filters and ranks in code execution environment
- 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
⚠️ Critical Notes
Multi-Term Searches
Zotero treats multi-word queries as AND conditions!
❌ Wrong: comprehensive_search("Atyal Atayal 泰雅族") → finds 0 results (needs ALL terms)
✅ Right: Search each term separately and merge results (see Pattern 6 below)
When to use multi-term OR search:
- Multiple spellings (Atayal, Atyal)
- Multiple languages (Atayal, 泰雅族)
- Synonyms (skill transfer, transfer of learning)
Semantic Search Status
Semantic search is now working correctly (fixed 2025-01-08). However, you may see 404 error messages in output from the semantic search engine itself - these can be ignored as our wrapper handles them correctly.
🚀 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
use_semantic=True # Semantic search now works correctly
)
# Format and display
print(format_results(results, include_abstracts=True))
This automatically:
- Performs semantic search (vector similarity)
- Performs keyword search (qmode="everything" + "titleCreatorYear")
- 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]))
Pattern 3: Author Search
User asks: "What papers do I have by Kahneman?"
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results
library = ZoteroLibrary()
results = library.search_items(
"Kahneman",
qmode="titleCreatorYear",
limit=50
)
# Sort by date
sorted_results = sorted(results, key=lambda x: x.date, reverse=True)
print(format_results(sorted_results))
Pattern 4: Tag-Based Search
User asks: "Show me papers tagged with 'learning' and 'cognition'"
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results
library = ZoteroLibrary()
results = library.search_by_tag(["learning", "cognition"], limit=50)
print(format_results(results[:20]))
Pattern 5: Recent Papers
User asks: "What did I recently add?"
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results
library = ZoteroLibrary()
results = library.get_recent(limit=20)
print(format_results(results))
Pattern 6: Multi-Term OR Search (Multiple Spellings/Languages)
User asks: "Find papers about Atyal or 泰雅族" (alternate spellings/languages)
IMPORTANT: Zotero treats multi-word queries as AND conditions. For OR searches, search each term separately and merge.
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results
orchestrator = SearchOrchestrator()
# Search each term separately
all_results = {}
for te
Установить zotero-mcp-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл zotero-mcp-code?
Search Zotero library using code execution for efficient multi-strategy searches without crash risks. Use this skill when the user needs comprehensive Zotero searches with automatic deduplication and ranking.
Как установить скилл zotero-mcp-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл zotero-mcp-code запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic