Expand description
Database access layer — direct SQLite reads on Zotero’s databases.
§The key insight
Zotero stores everything in SQLite. The Python MCP server was slow because it went through BBT JSON-RPC (a JavaScript plugin inside Zotero’s Electron app) to read this same data. By reading SQLite directly, we eliminate the dominant bottleneck: ~300ms per BBT RPC call → <1ms per SQLite query.
§Two databases
-
zotero.sqlite— all item metadata, collections, tags, creators, attachments, notes. Uses an EAV (Entity-Attribute-Value) schema:items → itemData → itemDataValueswith field IDs mapped viafields. -
better-bibtex.migrated— citekey assignments. Maps Zotero item keys (like “9MS26VH5”) to citation keys (like “demilloHintsTestData1978”). This file may not exist if BBT isn’t installed.
Both are opened read-only. We never write to Zotero’s databases directly — writes go through the Zotero Web API.
Modules§
Structs§
- DbPool
- Holds connections to both Zotero databases.