ON

OneCite MCP Server: Academic Reference Generator

Generate citations with the MCP server from DOI, arXiv, title or URL in BibTeX/APA/MLA, with 7+ literature types, 10+ databases and smart metadata.

Overview

OneCite MCP Server is a lightweight Model Context Protocol (MCP) service that turns messy reference snippets into canonical academic citations. Feed it a DOI, arXiv ID, URL, title, ISBN, or plain text query and it returns structured metadata and formatted references (BibTeX, APA, MLA, and more). The server wraps OneCite’s resolution pipeline into an HTTP/MCP endpoint so other tools — language models, notebooks, CI pipelines, or editor extensions — can request citations programmatically.

The server focuses on reliability and metadata quality: it queries multiple scholarly databases, merges matches, fills missing fields, and validates identifiers so outputs are consistent and ready for LaTeX, reference managers, or downstream NLP workflows.

Features

  • Fuzzy matching across multiple scholarly sources (DOI, arXiv, title, URL, ISBN, PMID)
  • Outputs: BibTeX, APA, MLA, and raw structured JSON
  • Handles 7+ literature types (journal article, conference paper, book, thesis, dataset, software, preprint)
  • Intelligent field completion (journal, volume, pages, authors, publisher, year)
  • Multi-source lookup: CrossRef, arXiv, OpenAlex, Semantic Scholar, PubMed, DataCite, Zenodo, Google Books, dblp
  • 4-stage resolution pipeline: clean → query → validate → format
  • Interactive disambiguation mode (when multiple matches are plausible)
  • Configurable templates and fallback BibTeX types via YAML
  • Simple MCP-compatible HTTP API for integration with LLMs and agent frameworks

Installation / Configuration

Install from PyPI:

pip install onecite

Run a local MCP server (example):

# start a basic server on port 8080
onecite serve --port 8080

Environment variables (examples):

# optional API keys to improve coverage
export CROSSREF_EMAIL="[email protected]"
export SEMANTIC_SCHOLAR_API_KEY="your_key_here"
export OPENALEX_EMAIL="[email protected]"

Example YAML config (onecite-config.yaml):

server:
  host: 0.0.0.0
  port: 8080
sources:
  priority: ["crossref", "arxiv", "openalex", "semanticscholar", "datacite"]
templates:
  default_bibtype: article
interactive: true

Start using a specific config:

onecite serve --config onecite-config.yaml

Available Resources

The MCP server consults multiple public scholarly APIs and resources to maximize match quality:

  • CrossRef (DOI metadata)
  • arXiv (preprints and identifiers)
  • OpenAlex (disambiguation and alternate identifiers)
  • Semantic Scholar (citation graphs, abstracts)
  • PubMed / Entrez (biomedical metadata)
  • DataCite (datasets)
  • Zenodo (software/dataset DOIs)
  • Google Books (book metadata and ISBN)
  • dblp (computer science metadata)

API (MCP) Examples

Minimal JSON request (POST /mcp/generate):

curl -sS -X POST "http://localhost:8080/mcp/generate" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "10.1145/3292500.3330899",
    "format": "bibtex"
  }'

Example request using a title:

curl -X POST http://localhost:8080/mcp/generate \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Attention Is All You Need",
    "format": "apa"
  }'

Example JSON response (structured):

{
  "input": "10.1145/3292500.3330899",
  "matched_source": "crossref",
  "type": "inproceedings",
  "metadata": {
    "title": "An example paper",
    "authors": ["A. Author", "B. Writer"],
    "year": 2019,
    "journal": "Conference Name",
    "doi": "10.1145/3292500.3330899"
  },
  "outputs": {
    "bibtex": "@inproceedings{author2019example, ...}",
    "apa": "Author, A., & Writer, B. (2019). An example paper. Conference Name.",
    "mla": "Author, A., and B. Writer. “An example paper.” Conference Name, 2019."
  }
}

Options supported in requests:

  • format: bibtex | apa | mla | json
  • prefer_source: list or single (e.g., [“arxiv”,“crossref”])
  • interactive: true/false — if true, server returns candidate list for manual selection
  • force_type: override detected bibtex type

Use Cases

  • Bulk-convert a messy text file of DOIs, arXiv IDs and titles into a clean .bib for LaTeX.
  • Let an LLM ask the MCP server for citation metadata during content generation (structured context for claims).
  • CI pipeline: automatically validate and normalize references before publishing documentation or papers.
  • Editor integration: “select text → generate citation” using an HTTP call to the local MCP server.
  • Data enrichment: populate missing DOI/ISBN fields in institutional repositories.

Concrete example — batch CLI:

# convert a text file of mixed identifiers to a .bib file
onecite import references.txt --output references.bib
  • GitHub: https://github.com/HzaCode/OneCite
  • Documentation / Examples: (see repo README and docs directory)
  • Recommended: export contact/email env vars for CrossRef/OpenAlex to reduce rate-limiting

Contributions and bug reports are handled via the GitHub repository. The MCP server is intended to