Skip to main content
Glama

word-footnotes-bibliography-mcp

A self-contained Model Context Protocol server that adds footnotes, in-text citations, and a bibliography / references / works-cited section to Microsoft Word .docx files — without Word.

Styles: APA 7, MLA 9, Chicago 17 (author-date and notes). Transport: stdio.

Prefer a Claude skill (SKILL.md + a CLI, no server) with the same capabilities? See the companion repo word-footnotes-bibliography-skill.

What's in here

word-footnotes-bibliography-mcp/
├── server.py            the MCP server (10 tools)
├── docx_fnbib/          the engine (python-docx + lxml) — importable on its own
├── pyproject.toml       installs `docx-fnbib-mcp` console script
├── requirements.txt
├── examples/build_demo.py
└── tests/               pytest suite (13 tests)

Related MCP server: mcp-server-docx

Install

git clone https://github.com/<you>/word-footnotes-bibliography-mcp
cd word-footnotes-bibliography-mcp
pip install -e .            # or: pip install -r requirements.txt

Requires Python 3.10+ and the mcp SDK v2 (MCPServer). For SDK v1, change the import in server.py to from mcp.server.fastmcp import FastMCP — the tool API is identical.

Run

docx-fnbib-mcp            # console script (after pip install -e .)
python server.py         # or run the module directly

Register with a client

{
  "mcpServers": {
    "docx-fnbib": { "command": "docx-fnbib-mcp" }
  }
}

Without installing the console script:

{
  "mcpServers": {
    "docx-fnbib": {
      "command": "python",
      "args": ["/absolute/path/to/word-footnotes-bibliography-mcp/server.py"]
    }
  }
}

Tools

Tool

Purpose

create_document

new .docx with optional title + paragraphs

document_outline

list paragraphs as {index, style, text} (indices for the calls below)

add_footnote

footnote on a paragraph; anchor places the mark after a phrase

list_footnotes

existing footnotes {id, text}

add_source

add/replace a bibliography source (matched by tag)

list_sources / remove_source

manage the source store

import_references

bulk import BibTeX or CSL-JSON

add_citation

in-text citation (a footnote, for chicago-notes)

add_bibliography

References / Works Cited section

Styles: apa, mla, chicago-author-date, chicago-notes. Modes: text (formatted by the server) or field (Word CITATION / BIBLIOGRAPHY fields the user refreshes in Word).

Paths resolve on the machine running the server; edits are in place unless an out path is passed.

Example session

create_document {path: "paper.docx", title: "Draft", paragraphs: ["A claim.", "Another point about Rome."]}
add_source      {path: "paper.docx", source: {tag: "Syme1939", type: "Book", authors: ["Syme, Ronald"], title: "The Roman Revolution", year: "1939", city: "Oxford", publisher: "Clarendon Press"}}
add_footnote    {path: "paper.docx", paragraph_index: 2, text: "Founded 753 BC.", anchor: "Rome"}
add_citation    {path: "paper.docx", paragraph_index: 1, tag: "Syme1939", style: "chicago-notes", page: "47"}
add_bibliography{path: "paper.docx", style: "chicago-author-date", heading: "Bibliography"}

How it works (short version)

  • Footnotes — creates word/footnotes.xml, the separator notes, the FootnoteText / FootnoteReference styles, and numbered reference marks. Reopen-safe: numbering continues from existing notes.

  • Sources — stored in Word's native customXml bibliography part (b: namespace), so References ▸ Manage Sources in Word sees them.

  • Rendering — text mode formats entries itself (italic titles, hanging indent, sorted); field mode writes Word fields and sets SelectedStyle. chicago-notes emits real footnotes.

Run the tests

pip install -e ".[test]"
pytest

Limitations

  • field mode needs desktop Word to render; elsewhere fields show cached text.

  • The text formatter covers common source types well but is not a full CSL engine.

  • Endnotes: create as footnotes, then Convert Notes in Word.

  • Verify important documents open cleanly in your target Word version.

License

MIT — see LICENSE.

Available Tools

10 tools
add_bibliographyB

Append a References / Works Cited section built from the stored sources.

Inputs: path (required), out, mode, style, +1 more. Returns: object

add_citationB

Append an in-text citation for tag to a paragraph.

With style 'chicago-notes' the citation is rendered as a footnote instead of parenthetical text.

Inputs: tag (required), path (required), paragraph_index (required), out, +4 more. Returns: object

add_footnoteA

Attach a footnote to a paragraph.

If anchor is given, the footnote mark is placed right after that substring; otherwise it goes at the end of the paragraph. Creates word/footnotes.xml and the FootnoteText/FootnoteReference styles on first use.

Inputs: path (required), text (required), paragraph_index (required), out, +1 more. Returns: object

add_sourceB

Add or replace a bibliography source (matched by tag).

Source fields: tag, type (Book|BookSection|JournalArticle| ArticleInAPeriodical|ConferenceProceedings|Report| DocumentFromInternetSite|Misc), authors/editors/translators (list of {last,first,middle} or {corporate} or "Last, First" strings), title, year, month, day, publisher, city, journal, volume, issue, pages, edition, doi, url, accessed, note.

Inputs: path (required), source (required), out. Returns: object

create_documentB

Create a new .docx at path with an optional title and body paragraphs.

Inputs: path (required), title, paragraphs. Returns: object

document_outlineA

List every paragraph as {index, style, text} so you can target one.

Inputs: path (required). Returns: result

import_referencesC

Bulk-import sources from a BibTeX (fmt='bibtex') or CSL-JSON (fmt='csl-json') string.

Inputs: data (required), path (required), fmt, out. Returns: object

list_footnotesB

Return existing footnotes as {id, text}.

Inputs: path (required). Returns: result

list_sourcesB

Return all sources stored in the document.

Inputs: path (required). Returns: result

remove_sourceC

Delete the source with the given tag.

Inputs: tag (required), path (required), out. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools clearly target distinct resources: paragraphs, footnotes, sources, citations, and the document itself. Minor ambiguity exists between add_footnote and add_citation when using 'chicago-notes' style, since the citation is rendered as a footnote, but the descriptions clarify the intent.

    Naming Consistency4/5

    The naming is mostly consistent with a verb_noun pattern: add_footnote, list_footnotes, add_source, list_sources, remove_source, add_citation, add_bibliography, create_document. The exception is document_outline, which is a noun phrase rather than a verb-led action, making it the one inconsistent name.

    Tool Count5/5

    With 10 tools, the set is well-scoped for a docx footnote and bibliography server. Each tool covers a distinct part of the workflow without unnecessary duplication or bloat.

    Completeness4/5

    The surface covers the full creation workflow: document creation, outlining, footnote insertion/listing, source management, citation insertion, and bibliography generation. Minor gaps exist—there is no way to remove or edit footnotes or citations, and source updates are only handled through add_source/import_references.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers