Module config

Source
Expand description

Configuration for the Zotero MCP server.

§Design

The server needs to know where three things live:

  1. zotero.sqlite — Zotero’s main database (71MB, ~7000 refs). This is where all item metadata, collections, tags, creators, and attachments are stored. We open it read-only.

  2. better-bibtex.migrated — BBT’s citekey mapping database. Contains a citationkey table mapping (itemID, itemKey) → citekey. This lets us resolve “demilloHintsTestData1978” to Zotero item key “9MS26VH5” without calling the BBT JSON-RPC API.

  3. Zotero storage — directory where PDFs live, organized as storage/{2-char}/{8-char}/filename.pdf.

For write operations, we also need the Zotero Web API key and the BBT JSON-RPC URL (for BibTeX export only).

§Environment variables

Same variable names as the Python server for drop-in replacement:

VariableDefault
ZOTERO_SQLITE_PATH~/Zotero/zotero.sqlite
ZOTERO_STORAGE_PATH~/Zotero/storage
BBT_MIGRATED_PATH~/Zotero/better-bibtex.migrated
ZOTERO_API_KEY(none — writes disabled)
ZOTERO_LIBRARY_ID(none — required for writes)
ZOTERO_LIBRARY_TYPEuser
BBT_URLhttp://localhost:23119/better-bibtex/json-rpc
ZOTERO_MCP_LOGinfo

Structs§

Config
Server configuration, loaded from environment variables.

Enums§

LogLevel

Functions§

env_path 🔒
load_resolver_config 🔒
Load resolver config from TOML file if present, otherwise defaults.