CiteClaw is a citation and bibliography toolkit built on top of Wikimedia Citoid, Crossref, Semantic Scholar, and Zotero-oriented workflows.
It is designed for two related jobs:
- fast citation resolution from DOI, URL, arXiv, anthology pages, and PDFs
- larger bibliography workflows such as cleaning BibTeX, expanding literature coverage, and maintaining Zotero-backed reference sets
CiteClaw combines:
- a CLI for citation lookup, metadata export, PDF resolution, and batch jobs
- an HTTP service compatible with Citoid-style API flows
- an MCP server mode for agent/tool integrations
- Zotero automation for query, cite, add, update, notes, dedup, enrichment, and export
- optional translator/style sync commands for broader coverage and local CSL rendering
Run from npm:
npx citeclaw --help
npx citeclaw citoid formats
npx citeclaw cite bibtex 10.48550/arXiv.1706.03762
npx citeclaw crossref "10.1021/acsomega.2c05310"Typical resolution flows:
npx citeclaw citoid bibtex "10.1145/3589334.3648158"
npx citeclaw citoid bibtex "https://arxiv.org/abs/2305.19860"
npx citeclaw citoid bibtex "https://aclanthology.org/2023.emnlp-main.398/"
npx citeclaw cite mediawiki "https://arxiv.org/abs/1706.03762"Fresh npm installs can run normal citation commands directly. CiteClaw will bootstrap Zotero and build a local translator runtime automatically from the bundled Zotero translator set.
Install dependencies and start the service:
npm install
npm run start -- -c config.dev.yamlThen open:
- API docs:
http://localhost:1970/?doc - OpenAPI spec:
http://localhost:1970/?spec - Service info:
http://localhost:1970/_info
The service layer is still based on the Wikimedia Citoid architecture:
- homepage: https://www.mediawiki.org/wiki/Citoid
- HTTP entrypoints: server.js, app.js
Start the MCP server over stdio:
npx citeclaw mcpImplemented methods:
initializepingtools/listtools/call
Exposed tools:
citecite_pdffetch_pdfopenurl_resolvecitoidcrossrefsemantic_scholarsemantic_scholar_api
Identity and login:
npx citeclaw zotero whoami --api-key <zotero_api_key>
npx citeclaw zotero login --api-key <zotero_api_key>Core item operations:
npx citeclaw zotero query "transformer" --limit 20
npx citeclaw zotero cite AB12CD34
npx citeclaw zotero add '{"itemType":"journalArticle","title":"Demo"}'
npx citeclaw zotero update AB12CD34 '{"title":"Updated title"}'Note and maintenance operations:
npx citeclaw zotero note add AB12CD34 "<p>Key takeaway: ...</p>"
npx citeclaw zotero dedup --limit 300
npx citeclaw zotero enrich --apply
npx citeclaw zotero export md --out ./library.mdSafety defaults:
- destructive deletes require confirmation unless
-y updateanddeleteuse version preconditionssafe-modeand--dry-runare available for write protection
For npm installs, extra runtime assets can be synced explicitly when you want broader translator coverage or local style rendering:
npx citeclaw translators sync
npx citeclaw styles syncNotes:
translators syncwill clone or update the translator sources withgitwhen neededstyles syncwill clone or update style repositories withgitwhen local CSL styles are unavailable- normal
citecommands can run without manually syncing translators first cite-stylewill fetch style sources on demand if local styles are missing- if
gitis not installed, the commands fail with an explicit message
This repo includes a higher-level bibliography workflow skill:
Use it when the task is broader than “generate one citation”, for example:
- clean a noisy
.bib - expand a survey bibliography to dozens or hundreds of references
- split core references from supplemental references
- build a topic-wise literature map for an appendix
Useful commands:
npm run test
npm run test:zotero
npm run coverage
npm run lint
npm run pack:dry-runCurrent package metadata and entrypoints live in:
This repo includes a GitHub Actions workflow for npm publishing:
- workflow file:
.github/workflows/npm-publish.yml - trigger: push a tag like
v2.0.8that matchespackage.json'sversion - required secret: add
NPM_TOKENin GitHub repository settings with publish permission for theciteclawpackage
Typical release flow:
npm version patch
git push origin master --follow-tagsThe workflow installs dependencies with npm ci, checks that the tag matches package.json, validates the tarball with npm pack --dry-run, and then runs npm publish --access public --provenance.
- The npm package name and primary CLI are
citeclaw. - Primary install/run path is
npx citeclaw ....