Zotero Code Execution enables efficient multi-strategy search within Zotero using code execution patterns. Researchers and operations teams benefit from automated bibliographic searches, semantic tagging, and data extraction. It connects to Zotero MCP and integrates with Python workflows for enhanced research automation.
git clone https://github.com/kerim/zotero-code-execution.gitZotero Code Execution is a Python library that implements Anthropic's code execution pattern for comprehensive Zotero searches without crashes or token bloat. It performs semantic, keyword, and tag-based searches in a single orchestrated call, automatically deduplicates results, and ranks them by relevance. The library processes 100+ items in the execution environment while returning only the top results to your context, solving the crash risk and manual orchestration problems of direct MCP tool calls. Researchers, operations teams, and knowledge workers benefit from efficient bibliographic discovery integrated with Python workflows and Claude Code automation.
[{"step":"Set up Zotero MCP and Python environment.","action":"Install the Zotero MCP server (https://github.com/modelcontextprotocol/servers/tree/main/src/zotero) and ensure Python 3.10+ is installed. Use `pip install pyzotero pandas` to install required libraries.","tip":"Verify MCP server connectivity by running `mcp-zotero --list-collections` in your terminal."},{"step":"Define your research topic and strategies.","action":"Replace [RESEARCH_TOPIC] with your focus area (e.g., 'climate change mitigation technologies'). For [STRATEGY_1], [STRATEGY_2], and [STRATEGY_3], use combinations of keyword searches, citation chaining, semantic tagging, or author-based queries.","tip":"For citation chaining, start with a highly cited paper in your field and use its forward/backward citations as a strategy."},{"step":"Execute the code and generate output.","action":"Run the Python script (see example below) to execute the search, extract metadata, and generate the CSV. Adjust [OUTPUT_FILENAME] to your preferred name.","tip":"Use `pandas` to pre-filter results by publication year or relevance score before final output."},{"step":"Review and refine results.","action":"Open the generated CSV file and manually review items with missing semantic tags. Use Zotero's tagging interface to add missing tags for better organization.","tip":"Leverage Zotero's 'Related Items' feature to identify additional papers for inclusion."},{"step":"Integrate with further analysis.","action":"Import the CSV into a data analysis tool (e.g., Jupyter Notebook, Tableau) to visualize citation networks, co-authorship patterns, or keyword trends.","tip":"Use `networkx` in Python to generate a citation graph for deeper insights."}]
Multi-term semantic searches across large research libraries with automatic deduplication
Filter journal articles by date range, author, or tags in a single code execution
Find papers on related topics (e.g., multiple spellings or language variants) with merged ranking
Extract and rank recent publications with specific criteria (DOI, date, item type)
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/kerim/zotero-code-executionCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use Zotero MCP and Python to execute a multi-strategy search in Zotero for [RESEARCH_TOPIC]. Apply the following strategies: [STRATEGY_1], [STRATEGY_2], and [STRATEGY_3]. Extract bibliographic metadata, generate semantic tags for each item, and compile the results into a structured CSV file named [OUTPUT_FILENAME].csv. Include a summary of search efficiency metrics (e.g., precision, recall) based on the applied strategies.
### Zotero Multi-Strategy Search Results: Quantum Computing in Financial Risk Management **Search Strategies Applied:** 1. **Keyword Search:** 'quantum computing' AND 'financial risk' (127 items) 2. **Citation Chaining:** Forward citations from seminal paper *Quantum Algorithms for Portfolio Optimization* (2021) (43 items) 3. **Semantic Tagging:** Applied tags: 'quantum finance', 'risk modeling', 'algorithmic trading' (89 items) **Results Summary:** - Total unique items retrieved: 189 - Items with semantic tags: 89 (47% coverage) - Top 5 most cited papers: 1. *Quantum Algorithms for Portfolio Optimization* (2021) - 142 citations 2. *Machine Learning and Quantum Computing in Finance* (2020) - 89 citations 3. *Risk Assessment in Quantum Financial Systems* (2019) - 67 citations 4. *Hybrid Quantum-Classical Models for Risk Analysis* (2022) - 54 citations 5. *Quantum Monte Carlo for Financial Derivatives* (2018) - 45 citations **Semantic Tag Distribution:** - 'quantum finance': 67 items - 'risk modeling': 54 items - 'algorithmic trading': 32 items - 'portfolio optimization': 28 items **Efficiency Metrics:** - Precision (relevance of retrieved items): 89% - Recall (coverage of target domain): 76% - Average search time per strategy: 2.3 minutes **Output File:** `quantum_finance_search_results.csv` (attached) **Next Steps:** 1. Review items with missing semantic tags for manual tagging. 2. Cross-reference with recent conference proceedings (e.g., QIP 2023). 3. Validate citation counts against Google Scholar for accuracy.
On-demand house cleaning with real-time tracking
Powerful quantitative forecasting models
Networked note-taking with bidirectional linking
Enterprise workflow automation and service management platform
Get more done every day with Microsoft Teams – powered by AI
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan