Zotero Chunk RAG
The Zotero Chunk RAG server enables semantic search and retrieval over a Zotero research library using AI embeddings and configurable reranking. Key capabilities include:
search_papers— Passage-level semantic search across indexed PDF chunks, returning matched text with surrounding context (0–3 adjacent chunks) and bibliographic metadata (authors, year, citation keys), with optional year filtering.search_topic— Find the most relevant papers (deduplicated by document) for a broad topic, scoring each by average and best chunk relevance, with optional year filtering and up to 50 results.get_passage_context— Expand the context window around a specific passage from a prior search, retrieving 1–5 surrounding chunks for deeper reading.search_tables— Find tables within indexed PDFs by content using natural language, returning results in markdown format with captions and bibliographic details.get_reranking_config— View current reranking settings (section weights, journal quartile weights, alpha exponent) to understand result ordering.get_index_stats— Check index status: total documents, total chunks, and average chunks per document.
Results are reranked using a composite score combining semantic similarity with document metadata (e.g., paper section like 'Results'/'Methods' and journal impact quartile). The system also supports OCR for scanned PDFs and customizable ranking weights.
Enables passage-level semantic search and retrieval across a Zotero library, allowing users to find relevant papers by topic, extract bibliographic metadata, and access specific text passages with surrounding context from PDF attachments.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Zotero Chunk RAGFind passages in my papers about transformer architecture."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DeepZotero
Semantic search over a Zotero library. PDFs are extracted (text, tables, figures), chunked, embedded, and stored in ChromaDB. An MCP server exposes the index to Claude Code (or any MCP client) as 10 tools for semantic and exact-word search over text, tables and figures, context expansion, citation graph lookup, indexing, and cost tracking.
What it extracts
Text — section-aware chunks with overlap, classified by document section (abstract, methods, results, etc.)
Tables — vision-based extraction via Claude Haiku 4.5. Each table is rendered to PNG and transcribed to structured markdown (headers, rows, footnotes). Table extraction is vision-only: with vision disabled, or without an Anthropic key, no tables are extracted.
Figures — detected with captions, extracted as PNGs, searchable by caption text.
Related MCP server: archilles
Requirements
Python 3.10+
A Gemini API key for embeddings (unless using
embedding_provider: "local")An Anthropic API key for vision-based table extraction (optional but recommended)
Zotero 8 with PDFs in
storage/. Citation keys are read from Zotero's nativecitationKeyfield, which earlier versions do not have — on Zotero 7 every citation key comes back empty.Tesseract-OCR — only needed to OCR scanned / image-only PDF pages. Install Tesseract with the language data you need, then set the
TESSDATA_PREFIXenvironment variable to itstessdatadirectory (e.g.C:\Program Files\Tesseract-OCR\tessdata). PyMuPDF locates the OCR data via that variable; without it, scanned pages are skipped ("OCR disabled because Tesseract language data not found."). Text-based PDFs do not need Tesseract.
Install as a Claude Code plugin
Requires uv on PATH. The repo is its own marketplace:
/plugin marketplace add ccam80/deep-zotero
/plugin install deep-zoteroThe server launches through uvx, which fetches the pinned deep-zotero wheel from PyPI and caches it.
In the environment Claude Code starts from, set DEEP_ZOTERO_DATA_DIR (the Zotero data directory holding zotero.sqlite and storage/), DEEP_ZOTERO_CHROMA_PATH (where the index lives), GEMINI_API_KEY (embeddings) and ANTHROPIC_API_KEY (vision table extraction during indexing).
Index the library once before searching: deep-zotero-index -v.
/deep-zotero:install walks a coding agent through the whole setup: variables, Tesseract, and the first index.
Setup
1. Configuration
The four environment variables above are the whole configuration. Every other setting has a sensible default.
To override more than those four, write a JSON config and point DEEP_ZOTERO_CONFIG at it (or pass --config PATH to the CLI):
{
"zotero_data_dir": "~/Zotero",
"chroma_db_path": "~/.local/share/deep-zotero/chroma",
"gemini_api_key": "YOUR_GEMINI_KEY",
"anthropic_api_key": "YOUR_ANTHROPIC_KEY"
}A config file takes precedence over the environment wherever both supply a setting. See Configuration reference for every field.
2. API keys
Gemini (required for default embeddings):
Get a key at aistudio.google.com/app/apikey. Set it as gemini_api_key in config or GEMINI_API_KEY env var. If you don't want to use Gemini, set "embedding_provider": "local" to use ChromaDB's built-in all-MiniLM-L6-v2 model (no API key needed, lower quality).
Anthropic (required for vision table extraction):
Get a key at console.anthropic.com. Set it as anthropic_api_key in config or ANTHROPIC_API_KEY env var. Table extraction is vision-only — without this key, text and figures are still indexed but no tables are extracted. Vision extraction uses the Anthropic Batch API with Claude Haiku 4.5 — cost is roughly $0.016 per table, with prompt caching reducing cost on large batches.
To disable vision extraction entirely:
{
"vision_enabled": false
}3. Index your library
deep-zotero-index -vTo test with a subset first:
deep-zotero-index --limit 10 -vThis reads the Zotero SQLite database (read-only, safe while Zotero is open), extracts text/tables/figures from each PDF, chunks the text, embeds via Gemini, and stores everything in ChromaDB.
CLI options:
Flag | Description |
| Delete and rebuild index for all matching items |
| Only index N items |
| Index a single Zotero item |
| Regex filter on title (case-insensitive) |
| Skip vision table extraction for this run |
| Use a different config file |
| Debug logging |
The indexer is incremental — it only processes items not already in the index. Use --force after changing chunk_size, embedding_dimensions, or ocr_language.
You can also trigger indexing from the MCP client via the index_library tool.
4. Check it works
Call get_index_stats from Claude Code. It should report the documents and chunks just indexed.
If the tools are missing, the server did not start: confirm uv is on PATH and that the environment variables are visible to Claude Code's process.
For scanned-page OCR, TESSDATA_PREFIX (see Requirements) must be set in that same environment.
Configuration reference
Zotero
Field | Default | Description |
|
| Path to Zotero's data directory (contains |
|
| Where the ChromaDB index is stored on disk. Falls back to |
Embedding
Field | Default | Description |
|
|
|
|
| Gemini model name (only used when provider is |
|
| Output vector dimensions. |
|
| Falls back to |
|
| Timeout in seconds for embedding API calls |
|
| Max retries for failed embedding calls |
|
| Seconds to wait before retrying after an HTTP 429 (per-minute quota) |
Chunking
Field | Default | Description |
|
| Target chunk size in tokens (~4 chars/token). Changing requires |
|
| Overlap between consecutive chunks in tokens |
Vision
Field | Default | Description |
|
| Enable vision table extraction during indexing |
|
| Anthropic model for table transcription |
|
| Falls back to |
Reranking
Field | Default | Description |
|
| Enable composite score reranking |
|
| Similarity exponent (0-1). Lower = more metadata influence |
|
| Override default section weights |
|
| Override default journal quartile weights |
|
| Oversample factor before reranking |
|
| Additional factor for |
OCR
Field | Default | Description |
|
| Tesseract language code for scanned pages ( |
OpenAlex
Field | Default | Description |
|
| Email for OpenAlex polite pool (10 req/s vs 1 req/s). Falls back to |
MCP tools
Semantic search
search_papers — Passage-level semantic search. Returns matching text with surrounding context, reranked by composite score (similarity × section weight × journal weight). Supports required_terms for combining semantic search with exact word matching — each term must appear as a whole word in the passage.
Parameters: query (optional when required_terms is given), top_k (1-50), context_chunks (0-3), year_min, year_max, author, tag, collection, chunk_types (text/figure/table), sections, journal_quartiles, section_weights, journal_weights, required_terms (words that must appear as whole words), terms_operator (AND/OR).
search_topic — Paper-level topic search, deduplicated by document. Groups chunks by paper, scores by average and best composite relevance.
Parameters: query, num_papers (1-50), year_min, year_max, author, tag, collection, chunk_types, sections, journal_quartiles, section_weights, journal_weights.
Filtering
search_papers(query="baroreflex sensitivity", author="Olufsen", journal_quartiles=["Q1"])
search_papers(required_terms=["SDNN"], sections=["results"], year_min=1991, year_max=1995)Parameter | Applied | Match |
| during retrieval | exact |
| after retrieval | case-insensitive substring |
| during reranking, so only with | reorders, excludes nothing |
Valid sections: abstract, introduction, background, methods, results, discussion, conclusion, references, appendix, preamble, table, figure, unknown.
Valid journal_quartiles: Q1, Q2, Q3, Q4, and unknown for journals with no quartile.
Tables and figures
search_papers covers text, tables and figures. Every result names its
chunk_type; narrow with chunk_types:
search_papers("impedance measurement", chunk_types=["table"])Table results add table_index, caption, num_rows and num_cols, with the
table markdown in passage. Figure results add figure_index, caption and
image_path (the extracted PNG), with the caption in passage.
Table and figure chunks carry section values of table and figure rather
than the section they appeared in. Both weigh 1.0 in reranking.
Exact word matching
required_terms lists words that must appear in the passage as whole words,
case-insensitively — heart matches Heart but not hearth. terms_operator
is AND (default) or OR.
Terms constrain the search itself, so a passage containing a rare acronym is found even when semantic similarity would not rank it:
search_papers("autonomic regulation", required_terms=["SDNN"])Omit query to retrieve every matching passage in the index, unranked, with no
embedding call:
search_papers(required_terms=["propranolol", "SDNN"], terms_operator="AND")At least one of query or required_terms is required. section_weights and
journal_weights affect ranking only and are ignored when query is omitted.
No phrase search, no stemming.
Context expansion
get_passage_context — Expand context around a passage from search_papers. For table results, pass table_page and table_index to find body text citing the table.
Parameters: doc_id, chunk_index, window (1-5), table_page, table_index.
Citation graph (OpenAlex)
Requires the document to have a DOI in Zotero.
find_citing_papers — Papers that cite a given document. Parameters: doc_id, limit (1-100).
find_references — Papers a document cites. Parameters: doc_id, limit (1-100).
get_citation_count — Citation and reference counts. Parameters: doc_id.
Index management
index_library — Trigger indexing from the MCP client. Parameters: force_reindex, limit, item_key, title_pattern, no_vision.
get_index_stats — Document/chunk/table/figure counts, section coverage, journal coverage. Counts cover the entire collection. The result is cached in index_stats.sqlite next to the Chroma database and refreshed at the end of every indexing run; pass refresh: true to force a recount.
get_reranking_config — Current reranking weights and valid override values.
get_vision_costs — Vision API batch usage and cost summary. Parameters: last_n (recent entries to show).
Reranking
Search results are scored:
composite_score = similarity^alpha * section_weight * journal_weightDefault section weights:
Section | Weight |
results | 1.0 |
conclusion | 1.0 |
table | 0.9 |
methods | 0.85 |
abstract | 0.75 |
background | 0.7 |
unknown | 0.7 |
discussion | 0.65 |
introduction | 0.5 |
preamble | 0.3 |
appendix | 0.3 |
references | 0.1 |
Default journal weights: Q1=1.0, Q2=0.85, Q3=0.65, Q4=0.45.
Override per-call via section_weights and journal_weights parameters. Set a section to 0 to exclude it. Disable reranking entirely with "rerank_enabled": false.
Shared filter parameters
Parameter | Type | Description |
| string | Case-insensitive substring match against author names |
| string | Case-insensitive substring match against Zotero tags |
| string | Case-insensitive substring match against collection names |
| int | Publication year range |
| dict | Override section weights for this call |
| dict | Override journal quartile weights |
| list | Exact whole-word matches required in passage ( |
Research agent skill
examples/zotero-research/SKILL.md is a ready-made Claude Code skill that wraps these
tools into a spawnable research agent — it takes a high-level research question, runs
the appropriate searches, and returns consolidated findings with citation keys. Copy it
into .claude/skills/ (or your global skills directory) to use it.
Development
Debug viewer
tools/debug_viewer.py is a PyQt6 browser for inspecting the ChromaDB index — view papers, tables (rendered markdown vs PDF), figures, and individual chunks.
.venv/Scripts/python.exe tools/debug_viewer.pyTests
.venv/Scripts/python.exe -m pytestTests that make real Anthropic API calls are marked vision_api and excluded by
default; run them with -m vision_api.
tests/stress_test_real_library.py is the end-to-end quality gate: it pulls 10 papers
from the live Zotero library, runs the full extraction → index → search pipeline into a
temp ChromaDB, and asserts on extraction and retrieval quality. It writes
STRESS_TEST_REPORT.md and _stress_test_debug.db.
.venv/Scripts/python.exe tests/stress_test_real_library.py--vision-only re-runs just the vision extraction against an existing
_stress_test_debug.db, optionally narrowed to one paper with --paper KEY.
Releasing
python tools/release.py --bump patch (or an explicit X.Y.Z) rewrites the version in pyproject.toml and plugin/.claude-plugin/plugin.json, including the pinned package the plugin launches, then commits and tags. It refuses a dirty tree, a non-main branch, and an existing tag.
Pushing the tag runs .github/workflows/publish.yml, which re-checks that tag, both manifests and the pin agree before publishing to PyPI.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables interaction with Zotero libraries for searching, managing collections, items, tags, and attachments, plus optional semantic search across PDFs via local embeddings.Last updated382MIT
- Alicense-qualityAmaintenanceEnables semantic search over local Calibre libraries via MCP, allowing AI assistants to query books, annotations, and export bibliographies while keeping data private.Last updated5MIT
- Flicense-qualityDmaintenanceEnables AI assistants like Claude, ChatGPT, and Gemini to search and query local PDF documents using natural language through vector embeddings and the MCP protocol.Last updated
- Alicense-qualityBmaintenanceEnables searching and reading full text of papers in a Zotero library by converting PDF attachments to Markdown and exposing a full-text search index to LLM tools.Last updatedMIT
Related MCP Connectors
Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.
Agentic search over your Dewey document collections from any MCP-compatible client.
Local-first RAG engine with MCP server for AI agent integration.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ccam80/deep-zotero'
If you have feedback or need assistance with the MCP directory API, please join our Discord server