MCP ScannerCustom audit
All servers

SecurityRonin/docx-mcp

MCP server for reading and editing Word (.docx) documents with track changes, comments, footnotes, and structural validation

Packagedocx-mcp-server
Version0.7.4 in pyproject.toml
PublisherSecurityRonin community
MCP Registrynot listed
Scanned2026-11-25
Scannerv1.3.0
Methodologyv1.2
Stars 69Forks 21Last push 2026-08-05
Python 100.0%by source files the scanner reads
Code safetypartly tracedExposure8.3Prompts10.0Supply chain1.7Secrets10.0Transparency10.0
Analysis confidence91%
How much of the server the scanner could read: tools analyzed, files parsed, limits hit.
Code Safetypartly traced—

Paths from tool input into commands, SQL, files and URLs

Capability Exposure8.3/10Good

How much power the tools give an agent over the machine

Prompt Integritynothing published yet10.0/10

Hidden instructions and poisoning in text for the model

Supply Chain1.7/10Poor

Known vulnerabilities in the packages the server uses

Secrets & Credentialsnothing published yet10.0/10

How the server reads credentials and where they can go

Behavior Transparencynothing published yet10.0/10

Whether the tools do only what their descriptions say

How far the analysis went

The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.

  • In 212 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there

Top risks in plain words

  • CRITICAL15 production dependencies have known vulnerabilities (worst: critical).
  • HIGHTool create_from_markdown reads or writes any file path by design: an agent steered by prompt injection can use it that way.

How to use it safely

Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.

  • Give it only the folder it needs

    create_from_markdown can read or write any file path. Mount a single project folder, read-only where you can.

  • Turn off the tools you do not use

    Most MCP clients let you disable single tools. If you do not need create_from_markdown, switch them off.

  • Update its vulnerable packages

    Use anyio 4.14.2 or later, certifi 2026.10.18 or later, cryptography 50.0.0 or later, filelock 4.2.1 or later and 11 more.

  • Keep confirmations on

    Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.

What its tools can do on your machine

The server offers 219 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.

Read or write filesopen, create, change or delete files
create_document, create_from_markdown, open_document, save_document
4 of 219

No tool was seen to: start other programs on the machine; connect to the internet or other hosts; read passwords, tokens or keys; read environment variables; touch sensitive locations.

Where its requests and secrets go

Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.

Hosts written in the code

The literal addresses the tools' requests name.

  • None: no request names a fixed host.
Addresses from settings

Constants or settings that start an address; the value comes from configuration.

  • None seen.
Secrets it reads

Credential-like environment variables. Give the server a key with the least access it needs.

  • None: no credential-like variable is read by the tools.

Text it brings in from outside

Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.

  • files1 tool · create_from_markdown

Tool annotations

No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.

Tools, prompts and resources (219: 219 tools)

Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.

create_from_markdowntool Create a new .docx document from markdown content.Filesoutside textReads/writes files
Create a new .docx document from markdown content.

    Supports full GitHub-Flavored Markdown: headings, bold/italic/strikethrough,
    links, images, bullet/numbered/nested lists, code blocks, blockquotes,
    tables, footnotes, and task lists. Smart typography (curly quotes, em/en
    dashes, ellipses) is applied automatically.

    Provide exactly one of md_path or markdown. The document is automatically
    opened for editing under the given handle.

    Args:
        output_path: Path for the new .docx file.
        md_path: Path to a .md file. Mutually exclusive with markdown.
        markdown: Raw markdown text. Mutually exclusive with md_path.
        template_path: Optional path to a .dotx template file.
        document_handle: Optional handle to store this document under.
accept_all_changestool Accept all tracked changes in document order.
Accept all tracked changes in document order.

    Returns a JSON object with the count of accepted changes: {"accepted": int}.
accept_changetool Accept a single tracked change by its change_id.
Accept a single tracked change by its change_id.

    For insertions: keeps the inserted text (unwraps w:ins).
    For deletions: discards the deleted text (removes w:del).

    Args:
        change_id: The integer id attribute of the w:ins or w:del element.
accept_changestool Accept tracked changes — keep insertions, remove deletions. Empty author = all.
Accept tracked changes — keep insertions, remove deletions. Empty author = all.
add_bookmarktool Add a named bookmark wrapping the specified paragraph.
Add a named bookmark wrapping the specified paragraph.
add_column_to_tabletool Add a new column to every row of a table. First row gets header_text.
Add a new column to every row of a table. First row gets header_text.
add_commenttool Add a comment anchored to a paragraph.
Add a comment anchored to a paragraph.
add_content_controltool Wrap a paragraph in an SDT content control.
Wrap a paragraph in an SDT content control.

    Args:
        para_id: paraId of the paragraph to wrap.
        tag: Unique tag name for the control.
        control_type: One of text|checkbox|dropdown|date.
        label: Optional display label (w:alias).
        options: List of option strings for dropdown controls.
        default: Default display text (or date string for date controls).
add_cross_referencetool Add a cross-reference link from one paragraph to another.
Add a cross-reference link from one paragraph to another.
add_endnotetool Add an endnote to a paragraph.
Add an endnote to a paragraph.
add_equationtool Insert a LaTeX equation as OMML. Requires: pip install latex2mathml.
Insert a LaTeX equation as OMML. Requires: pip install latex2mathml.

    Args:
        para_id: paraId of the paragraph after which the equation is inserted.
        latex: LaTeX source string (e.g. r"\\frac{1}{2}").
add_fieldtool Insert a Word field at end of paragraph.
Insert a Word field at end of paragraph.

    Common field codes: PAGE, NUMPAGES, DATE, SEQ Figure, REF MyBookmark,
    STYLEREF Heading.

    Args:
        para_id: w14:paraId of the target paragraph.
        field_code: The field instruction text (e.g. "PAGE").
        cached_value: Optional display text cached in the document.
add_footnotetool Add a footnote to a paragraph. url, if provided, is rendered as a hotlink.
Add a footnote to a paragraph. url, if provided, is rendered as a hotlink.
add_footnote_reftool Add a subsequent reference to an existing footnote without creating a new definition.
Add a subsequent reference to an existing footnote without creating a new definition.

    Use when the same source must be cited again in a different paragraph. Inserts a
    hyperlink-wrapped footnoteReference that navigates to the same footnote as the
    original citation. Does not duplicate the footnote definition in footnotes.xml.
add_hyperlinktool Append an external hyperlink at the end of a paragraph.
Append an external hyperlink at the end of a paragraph.

    Creates a relationship entry in word/_rels/document.xml.rels and a
    w:hyperlink element with a Hyperlink-styled run in word/document.xml.

    Args:
        para_id: w14:paraId of the target paragraph.
        text: Display text for the hyperlink.
        url: The URL the hyperlink points to.
add_internal_linktool Append an internal anchor hyperlink (w:anchor) at the end of a paragraph.
Append an internal anchor hyperlink (w:anchor) at the end of a paragraph.

    Internal links reference bookmarks by name and do NOT add a relationship.

    Args:
        para_id: w14:paraId of the target paragraph.
        text: Display text for the hyperlink.
        bookmark: Name of the bookmark to link to.
add_listtool Apply list formatting to paragraphs (bullet or numbered).
Apply list formatting to paragraphs (bullet or numbered).
add_page_breaktool Insert a page break after a paragraph.
Insert a page break after a paragraph.
add_section_breaktool Add a section break at a paragraph. break_type: nextPage/continuous/evenPage/oddPage.
Add a section break at a paragraph. break_type: nextPage/continuous/evenPage/oddPage.
add_tabletool Insert a new table after a paragraph with tracked insertion.
Insert a new table after a paragraph with tracked insertion.
add_table_rowtool Add a row to a table with tracked insertion. row_idx=-1 appends.
Add a row to a table with tracked insertion. row_idx=-1 appends.
apply_style_to_rangetool Apply a style to a list of paragraphs by their paraIds.
Apply a style to a list of paragraphs by their paraIds.

    Args:
        para_ids: List of paragraph paraIds to update.
        style_name_or_id: Style name or styleId to apply.

    Returns:
        {"applied": int, "style_id": str, "para_ids": list[str]}
audit_documenttool Run a comprehensive structural audit of the document.
Run a comprehensive structural audit of the document.
bates_numbertool Add Bates numbering stamp to document footer.
Add Bates numbering stamp to document footer.

    Args:
        prefix: Bates prefix string (e.g. "ACME-").
        start: Starting Bates number.
        digits: Zero-padding width for the number.
        position: Hint for stamp position (currently "footer-right").
check_accessibilitytool Scan the document for accessibility issues.
Scan the document for accessibility issues.

    Checks images for missing alt text and tables for missing header rows.

    Returns:
        {"issue_count": int, "issues": list[dict]}
clear_run_formattingtool Remove all character formatting from a run, causing it to inherit paragraph/style defaults.
Remove all character formatting from a run, causing it to inherit paragraph/style defaults.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
close_documenttool Close a document and clean up temporary files.
Close a document and clean up temporary files.

    Args:
        document_handle: Handle of the document to close. Empty = `__default__` slot.
compare_contractstool Clause-aware diff between the open contract and another .docx file.
Clause-aware diff between the open contract and another .docx file.
compare_documentstool Diff two DOCX files and produce a tracked-change document.
Diff two DOCX files and produce a tracked-change document.

    Paragraph-level LCS diff:
      - Unchanged paragraphs copied verbatim.
      - Deleted paragraphs (in base, absent in revised) wrapped in w:del.
      - Inserted paragraphs (in revised, absent in base) wrapped in w:ins.
      - Modified paragraphs (1:1 replacement) get word-level del+ins inline.

    The output is a valid DOCX readable in Word/LibreOffice showing the changes
    as tracked revisions.

    Args:
        base_path: Path to the original DOCX.
        revised_path: Path to the revised DOCX.
        output_path: Destination path. Auto-generated if empty.
convert_to_pdftool Convert the open document to PDF using LibreOffice headless.
Convert the open document to PDF using LibreOffice headless.

    Requires LibreOffice to be installed ('libreoffice' or 'soffice' on PATH).

    Args:
        output_path: Destination path for the output PDF file.

    Returns:
        {"pdf_path": str}
copy_documenttool Save a complete snapshot of the open document to a new path.
Save a complete snapshot of the open document to a new path.

    The active session and source path are unchanged.

    Args:
        output_path: Destination file path (must end in .docx).

    Returns:
        {"copied_to": output_path}
copy_styletool Deep-copy an existing style under a new name.
Deep-copy an existing style under a new name.

    Args:
        source_name_or_id: Name or styleId of the style to copy.
        new_name: Name for the new style (spaces stripped for styleId).

    Returns:
        {"style_id": str, "name": str, "type": str}
copy_tabletool Deep-copy a table and insert the copy immediately after the original.
Deep-copy a table and insert the copy immediately after the original.

    Args:
        table_idx: 0-based table index.

    Returns:
        {"source_index": int, "new_index": int}
create_documenttool Create a new blank .docx document (or from a .dotx template).Files
Create a new blank .docx document (or from a .dotx template).

    The document is automatically opened for editing under the given handle.
    Use save_document to save changes, or start editing immediately with
    insert_text, add_table, etc.

    Args:
        output_path: Path for the new .docx file.
        template_path: Optional path to a .dotx template file.
        document_handle: Optional handle to store this document under.
create_multilevel_listtool Create a multilevel list in numbering.xml. Each level dict: {num_fmt, lvl_text, indent, hanging, style?}.
Create a multilevel list in numbering.xml. Each level dict: {num_fmt, lvl_text, indent, hanging, style?}.
create_styletool Create a new style in the document.
Create a new style in the document.

    Args:
        name: Style name (used as styleId after removing spaces).
        style_type: "paragraph", "character", "table", or "numbering".
        based_on: Optional styleId this style inherits from.
        next_style: Optional styleId applied to the next paragraph.
csv_to_tabletool Insert a table from CSV text.
Insert a table from CSV text.
delete_column_from_tabletool Delete a column (0-based) from every row of a table.
Delete a column (0-based) from every row of a table.
delete_commenttool Delete a comment and remove its range markers from the document.
Delete a comment and remove its range markers from the document.

    Args:
        comment_id: ID of the comment to delete.
delete_content_controltool Remove an SDT content control wrapper, keeping its content in place.
Remove an SDT content control wrapper, keeping its content in place.

    Args:
        control_id: The w:id value of the content control to unwrap.
delete_custom_propertytool Delete a custom document property by name.
Delete a custom document property by name.

    Args:
        name: Property name to delete.
delete_endnotetool Delete an endnote and its in-body reference.
Delete an endnote and its in-body reference.

    Removes the endnote definition from endnotes.xml and removes the
    endnoteReference run from the document body.

    Args:
        endnote_id: The numeric ID of the endnote to delete.
delete_fieldtool Remove a complete complex field (begin through end runs) from the document.
Remove a complete complex field (begin through end runs) from the document.

    Args:
        field_id: Positional identifier returned by list_fields (e.g. "field_0").
delete_footertool Delete a footer by location: default, first, or even.
Delete a footer by location: default, first, or even.
delete_footnotetool Delete a footnote and its in-body reference.
Delete a footnote and its in-body reference.

    Removes the footnote definition from footnotes.xml and removes the
    footnoteReference run from the document body.

    Args:
        footnote_id: The numeric ID of the footnote to delete.
delete_headertool Delete a header by location: default, first, or even.
Delete a header by location: default, first, or even.
delete_imagetool Remove the drawing containing the image with the given rId from the document.
Remove the drawing containing the image with the given rId from the document.

    Also removes the relationship entry from word/_rels/document.xml.rels.

    Args:
        rId: The relationship ID of the image to delete (e.g. 'rId5').
delete_paragraphtool Delete the paragraph with the given paraId.
Delete the paragraph with the given paraId.

    Args:
        para_id: paraId of the paragraph to remove.
delete_section_breaktool Remove a section break from a paragraph.
Remove a section break from a paragraph.

    Removes the w:sectPr from the paragraph's w:pPr. After removal the
    paragraph's content flows into the next section rather than ending one.

    Args:
        para_id: paraId of the paragraph that holds the section break.

    Raises:
        ValueError: If the paragraph has no section break.
delete_styletool Delete a style from the document.
Delete a style from the document.

    Args:
        name: Style name or styleId (case-insensitive).
delete_tabletool Delete a table by index (0-based). Raises IndexError if out of range.
Delete a table by index (0-based). Raises IndexError if out of range.
delete_table_rowtool Delete a table row with tracked changes.
Delete a table row with tracked changes.
delete_texttool Delete text from a paragraph.
Delete text from a paragraph.

    Finds the text within the paragraph (across run boundaries if needed).
    With tracked=True (default) the deleted text stays visible as red strikethrough
    in Word's Track Changes view — the human reviewer must accept the deletion to
    remove it permanently. With tracked=False the text is removed immediately.

    Provide context_before/context_after to disambiguate when the same text
    appears multiple times, or when it contains smart quotes / special whitespace.

    Args:
        para_id: paraId of the target paragraph.
        text: Text to delete (ASCII quotes/dashes/spaces match their Unicode equivalents).
        author: Author name shown in Word's review pane (tracked=True only).
        context_before: Text immediately before the target (for precise anchoring).
        context_after: Text immediately after the target (for precise anchoring).
        ignore_case: If True, match text and context case-insensitively.
        tracked: True (default) = red strikethrough the human accepts/rejects.
                 False = text removed immediately, no markup.
        document_handle: Optional handle for concurrent session isolation.
demote_list_itemtool Increase the list indentation level (ilvl) of a paragraph by 1, maximum 8.
Increase the list indentation level (ilvl) of a paragraph by 1, maximum 8.

    Returns {para_id, ilvl}. Raises ValueError if paragraph is not a list item.
diff_to_texttool Compare two separate DOCX files and produce a tracked-change DOCX plus a plain-text summary.
Compare two separate DOCX files and produce a tracked-change DOCX plus a plain-text summary.

    Use this when you have two distinct files (e.g. an original and a revised copy)
    and want to show what changed between them. Produces:
      1. A DOCX with tracked-change markup (deletions in red, insertions underlined).
      2. A .txt summary suitable for pasting into an email or pull-request description.

    If you have already made tracked edits to the currently open document and just
    want to summarise those changes, use generate_change_summary instead.

    Args:
        base_path: Path to the original DOCX.
        revised_path: Path to the revised DOCX.
        docx_output: Output path for the tracked-change DOCX (auto-generated if empty).
        text_output: Output path for the plain-text summary .txt (auto-generated if empty).
duplicate_table_rowtool Deep-copy a table row and insert the copy immediately after it.
Deep-copy a table row and insert the copy immediately after it.

    Args:
        table_idx: 0-based table index.
        row_index: 0-based index of the row to duplicate.

    Returns:
        {"row_index": int, "new_row_index": int}
edit_header_footertool Edit text in a header or footer.
Edit text in a header or footer.

    By default (tracked=True) the change is recorded as a deletion of the old text
    and an insertion of the new text — the human reviewer accepts/rejects in Word.
    Pass tracked=False to replace the text directly with no revision markup.

    Args:
        location: "header" or "footer" (matches the first found of that type).
        old_text: Text to find and replace.
        new_text: Replacement text.
        author: Author name shown in Word's review pane (tracked=True only).
        tracked: True (default) = tracked del+ins. False = direct replacement, no markup.
        document_handle: Optional handle for concurrent session isolation.
export_markdowntool Export the open document as Markdown.
Export the open document as Markdown.

    Converts the document body (headings, bold/italic runs, lists, tables,
    plain paragraphs) to GitHub-Flavoured Markdown and writes it to a file.

    Args:
        output_path: Destination path for the .md file.
            Defaults to <workdir>/export.md when empty.

    Returns: {"output_path": str, "paragraphs": int, "tables": int}
export_session_scripttool Write session operations as a Python replay script.
Write session operations as a Python replay script.

    Returns: {"output_path": str, "operations": int}
fill_templatetool Fill SDT content controls from data dict. Keys match w:tag values.
Fill SDT content controls from data dict. Keys match w:tag values.

    Args:
        data: Mapping of tag names to values. Use list[str] for repeating sections.
        remove_empty: If True, remove SDTs with no matching key in data.
find_replace_formattedtool Find all occurrences of a string and replace with formatted text.
Find all occurrences of a string and replace with formatted text.

    Replaces every occurrence of `find` across all paragraphs in the document
    with `replace`, applying the specified character formatting to the replacement
    run only.

    Args:
        find: Text to search for (must be non-empty).
        replace: Replacement text.
        bold: True to bold, False to explicitly un-bold, None to leave unchanged.
        italic: True to italicise, False to explicitly un-italicise, None to leave unchanged.
        color: Font color as 6-digit hex (e.g. "FF0000"). None leaves color unchanged.
        size_pt: Font size in points (e.g. 12.0). None leaves size unchanged.
flatten_documenttool Accept all tracked changes and remove all revision markup.
Accept all tracked changes and remove all revision markup.

    Accepts every w:ins / w:del and strips all w:rPrChange and w:pPrChange
    elements, leaving plain text with no tracked-change metadata.

    Returns:
        {"changes_accepted": int, "formatting_changes_removed": int}
generate_change_summarytool Summarise tracked changes already present in the open document as an email-ready .txt.
Summarise tracked changes already present in the open document as an email-ready .txt.

    Use this after making edits with tracked=True (the default) and saving, to produce
    a human-readable change log of what was modified. Reads the document's existing
    w:ins / w:del elements, groups adjacent deletion+insertion pairs as REPLACEMENT
    entries, and writes a numbered list with author, date, and text per change.

    Typical workflow:
      open_document → edit with tracked=True → save_document → generate_change_summary

    If you have two separate files to compare rather than an already-edited document,
    use diff_to_text instead.

    Args:
        output_path: Destination .txt path. Auto-generated from the document stem if empty.
        document_handle: Optional handle for concurrent session isolation.
generate_list_of_figurestool Insert a List of Figures field (requires SEQ Figure captions).
Insert a List of Figures field (requires SEQ Figure captions).
generate_list_of_tablestool Insert a List of Tables field (requires SEQ Table captions).
Insert a List of Tables field (requires SEQ Table captions).
generate_privilege_logtool Generate a privilege log DOCX from document metadata.
Generate a privilege log DOCX from document metadata.

    Args:
        output_path: Destination path. If empty, writes to a temp file.
generate_redaction_logtool Write a DOCX table of all redactions made this session.
Write a DOCX table of all redactions made this session.

    Args:
        output_path: Destination path. If empty, writes to a temp file.
generate_toctool Generate a Table of Contents from document headings.
Generate a Table of Contents from document headings.
generate_toftool Insert a Table of Figures field block after the paragraph with para_id.
Insert a Table of Figures field block after the paragraph with para_id.

    Collects caption-styled paragraphs starting with 'Figure' as entries.
generate_tottool Insert a Table of Tables field block after the paragraph with para_id.
Insert a Table of Tables field block after the paragraph with para_id.

    Collects caption-styled paragraphs starting with 'Table' as entries.
get_alt_texttool Get the alt text and title for an image by 0-based index.
Get the alt text and title for an image by 0-based index.

    Args:
        image_index: 0-based index across all wp:docPr elements in document.xml.

    Returns:
        {"image_index": int, "alt_text": str, "title": str}
get_body_texttool Return the full accepted-view text of the document.
Return the full accepted-view text of the document.

    Accepted view: w:ins text included, w:del text excluded.
    Includes text inside w:hyperlink runs.
    Paragraphs are joined by newline.
    Footnote text is returned separately.

    Returns JSON: {"body": str, "footnotes": str}
get_bookmarked_texttool Get the text content within a named bookmark.
Get the text content within a named bookmark.
get_cell_texttool Return text content of a specific cell.
Return text content of a specific cell.

    Args:
        table_idx: 0-based table index.
        row_idx: 0-based row index.
        col_idx: 0-based column index.

    Returns:
        {"table_index": int, "row_index": int, "col_index": int, "text": str}
get_commentstool List all comments with their ID, author, date, and text.
List all comments with their ID, author, date, and text.
get_content_controltool Return details of a single content control by its w:id.
Return details of a single content control by its w:id.

    Args:
        control_id: The w:id value of the content control to retrieve.
get_content_controlstool List all SDT content controls in the document.
List all SDT content controls in the document.
get_custom_propertiestool Get custom document properties from docProps/custom.xml.
Get custom document properties from docProps/custom.xml.
get_document_infotool Get overview stats: paragraph count, headings, footnotes, comments, images.
Get overview stats: paragraph count, headings, footnotes, comments, images.
get_document_outlinetool Return a flat list of headings as a document outline.
Return a flat list of headings as a document outline.

    Walks the document body and returns every heading paragraph up to the
    specified level.

    Args:
        max_level: Maximum heading level to include (1–6, default 6).

    Returns:
        JSON list of dicts with keys: level (int), text (str), para_id (str).
get_endnotestool Get all endnotes with their ID and text content.
Get all endnotes with their ID and text content.
get_equationstool Return all equations in the document as OMML XML strings.
Return all equations in the document as OMML XML strings.
get_fieldtool Return details of a single field by field_id.
Return details of a single field by field_id.

    Args:
        field_id: Positional identifier returned by list_fields (e.g. "field_0").
get_footnotestool List all footnotes with their ID and text content.
List all footnotes with their ID and text content.
get_headers_footerstool Get all headers and footers with their text content.
Get all headers and footers with their text content.
get_headingstool Get the document heading structure with levels, text, and paraIds.
Get the document heading structure with levels, text, and paraIds.

    Returns a list of headings in document order, each with:
    - level (1-9)
    - text (heading content)
    - style (e.g., "Heading1")
    - paraId (unique paragraph identifier for targeting edits)
get_imagestool Get all embedded images with rId, filename, content type, and dimensions.
Get all embedded images with rId, filename, content type, and dimensions.
get_liststool Return all list definitions from numbering.xml.
Return all list definitions from numbering.xml.

    Each entry: {abstract_num_id, num_format, levels}.
    Returns [] if no numbering.xml exists.
get_paragraphtool Get the full text and style of a specific paragraph by its paraId.
Get the full text and style of a specific paragraph by its paraId.

    Args:
        para_id: The 8-character hex paraId (e.g., "1A2B3C4D").
get_paragraph_formattool Read all formatting attributes of a paragraph.
Read all formatting attributes of a paragraph.

    Returns style, alignment, indentation, line spacing, border, shading, and list info.

    Args:
        para_id: paraId of the target paragraph.
get_propertiestool Get core document properties (title, creator, subject, dates, revision).
Get core document properties (title, creator, subject, dates, revision).
get_reading_timetool Estimate reading time for the open document.
Estimate reading time for the open document.

    Args:
        words_per_minute: Assumed reading speed (default 200 wpm).

    Returns:
        {"word_count": int, "words_per_minute": int, "minutes": float, "seconds": int}
get_runstool Get all runs in a paragraph with their formatting properties.
Get all runs in a paragraph with their formatting properties.

    Args:
        para_id: paraId of the target paragraph.
get_sectionstool List all sections in the document with their properties.
List all sections in the document with their properties.

    Returns a JSON array of section objects, each containing:
    index, break_type, page_width, page_height, orientation, columns,
    margin_top, margin_bottom (all sizes in twips/DXA).
    The final section always has break_type="".
get_session_logtool Return all operations performed this session as replayable JSON.
Return all operations performed this session as replayable JSON.
get_statisticstool Return document statistics for the open document.
Return document statistics for the open document.

    Returns a dict with keys: word_count, character_count, paragraph_count,
    table_count, image_count, section_count.
get_styletool Get details of a single style by name or styleId (case-insensitive).
Get details of a single style by name or styleId (case-insensitive).

    Args:
        name_or_id: Style name or styleId to look up.

    Returns:
        {"style_id": str, "name": str, "type": str, "base_style": str, "next_style": str}
get_stylestool Get all defined styles with ID, name, type, and base style.
Get all defined styles with ID, name, type, and base style.
get_tabletool Get structured info for a single table by zero-based index.
Get structured info for a single table by zero-based index.

    Args:
        table_idx: 0-based table index.

    Returns:
        {"index": int, "row_count": int, "col_count": int, "cells": list[list[str]]}
get_tablestool Get all tables with row/column counts and cell text content.
Get all tables with row/column counts and cell text content.
get_theme_colorstool Return the named color slots from word/theme/theme1.xml.
Return the named color slots from word/theme/theme1.xml.

    Returns a dict mapping slot names (dk1, lt1, accent1, ...) to 6-digit hex strings.
    Returns an empty dict if the document has no theme file.
get_tracked_changestool Return all pending tracked changes (insertions and deletions) as a JSON list.
Return all pending tracked changes (insertions and deletions) as a JSON list.

    Each entry contains: type, change_id, author, date, para_id, text.
    Changes are returned in document order.
get_word_counttool Return the word count of the open document body.
Return the word count of the open document body.

    Returns: {"word_count": int}
insert_bar_charttool Insert a native bar chart (no Excel required).
Insert a native bar chart (no Excel required).

    series: [{"name": str, "values": [float, ...]}]
insert_blockquotetool Insert a blockquote paragraph after the given paragraph.
Insert a blockquote paragraph after the given paragraph.

    The new paragraph has 720-twip left indent and italic formatting.

    Args:
        para_id: paraId of the reference paragraph (new para inserted after it).
        text: Text content of the blockquote.
insert_captiontool Insert a caption paragraph after the specified paragraph.
Insert a caption paragraph after the specified paragraph.

    Args:
        after_para_id: paraId of the paragraph to insert after.
        text: Caption description text (without label/number prefix).
        label: Caption label, e.g. "Figure" or "Table" (default "Figure").
insert_code_blocktool Insert a code-block paragraph after the given paragraph.
Insert a code-block paragraph after the given paragraph.

    The new paragraph uses Courier New 10pt with light-gray background shading.

    Args:
        para_id: paraId of the reference paragraph (new para inserted after it).
        text: Code text content.
        language: Optional language hint (stored in return value only).
insert_date_fieldtool Insert a DATE field at the end of a paragraph.
Insert a DATE field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
        date_format: Date picture switch (default: \\@ "MMMM d, yyyy").
insert_floating_imagetool Insert a floating (anchored) image. wrap: square|topbottom|none.
Insert a floating (anchored) image. wrap: square|topbottom|none.
insert_if_fieldtool Insert a Word IF conditional field at the end of a paragraph.
Insert a Word IF conditional field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
        condition: The condition expression (e.g. "x > 0").
        true_text: Text to display when condition is true.
        false_text: Text to display when condition is false.
insert_imagetool Insert an image into the document after a paragraph.
Insert an image into the document after a paragraph.
insert_line_charttool Insert a native line chart.
Insert a native line chart.

    series: [{"name": str, "values": [float, ...]}]
insert_merge_fieldtool Insert a MERGEFIELD (mail merge) field at the end of a paragraph.
Insert a MERGEFIELD (mail merge) field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
        field_name: The merge field name (e.g. "FirstName").
insert_page_number_fieldtool Insert a PAGE field at the end of a paragraph.
Insert a PAGE field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
insert_paragraphtool Insert a new paragraph after the paragraph with the given paraId.
Insert a new paragraph after the paragraph with the given paraId.

    Args:
        after_para_id: paraId of the paragraph to insert after.
        text: Text content for the new paragraph.
        style: Optional paragraph style name (e.g., "Heading1", "Normal").
insert_pie_charttool Insert a native pie chart (single series, fixed 14x9 cm).
Insert a native pie chart (single series, fixed 14x9 cm).

    series: [{"name": str, "values": [float, ...]}]
insert_sequence_fieldtool Insert a SEQ (sequence) field for figure/table numbering.
Insert a SEQ (sequence) field for figure/table numbering.

    Args:
        para_id: w14:paraId of the target paragraph.
        seq_name: The sequence identifier (e.g. "Figure", "Table").
        reset: If True, restarts the sequence counter at 1.
insert_texttool Insert text into a paragraph.
Insert text into a paragraph.

    By default (tracked=True) the insertion is marked as a proposed addition
    that appears underlined in Word's Track Changes view. The human reviewer
    must accept it in Word before it becomes permanent. Pass tracked=False to
    write the text directly with no revision markup.

    Args:
        para_id: paraId of the target paragraph.
        text: Text to insert.
        position: Where to insert — "start", "end", or a substring to insert after.
        author: Author name shown in Word's review pane (tracked=True only).
        context_before: Text immediately before the insertion point (for precise anchoring).
        context_after: Text immediately after the insertion point (for precise anchoring).
        ignore_case: If True, match context_before/context_after case-insensitively.
        tracked: True (default) = revision markup the human accepts/rejects in Word.
                 False = text written directly, no markup.
        document_handle: Optional handle for concurrent session isolation.
insert_text_boxtool Insert an inline text box after the paragraph with para_id.
Insert an inline text box after the paragraph with para_id.

    Args:
        para_id: paraId of the reference paragraph (insert after this).
        text: Text content for the text box.
        width_cm: Width in centimetres (default 5.0).
        height_cm: Height in centimetres (default 2.0).

    Returns:
        JSON with para_id (new paragraph), text, width_cm, height_cm.
insert_watermarktool Insert a VML watermark into the document's default header.
Insert a VML watermark into the document's default header.

    Places a <v:shape> with a <v:textpath> inside the default header, which is
    the standard Word watermark pattern.

    Args:
        text: Watermark text (e.g. "DRAFT", "CONFIDENTIAL").
        diagonal: If True (default), diagonal orientation; if False, horizontal.
        document_handle: Optional handle for concurrent session isolation.
list_bookmarkstool List all bookmarks in the document.
List all bookmarks in the document.
list_comment_threadstool List all comment threads (root comments with their replies).
List all comment threads (root comments with their replies).

    Returns a list of thread dicts: {root: {id, author, date, text}, replies: [...]}.
list_fieldstool List all fields in the document with their codes and cached values.
List all fields in the document with their codes and cached values.
list_hyperlinkstool List all hyperlinks in the document.
List all hyperlinks in the document.

    Returns a list of dicts with keys: id, url_or_anchor, text, para_id, type.
    type is "external" (r:id based) or "internal" (w:anchor based).
list_partstool List all XML parts (files) in the open DOCX zip.
List all XML parts (files) in the open DOCX zip.
list_template_fieldstool List all SDT template fields (tag, label, type) in the document.
List all SDT template fields (tag, label, type) in the document.
lock_content_controltool Lock a content control to prevent editing.
Lock a content control to prevent editing.

    Args:
        tag: Tag name of the control to lock.
        lock: Lock type — sdtLocked|contentLocked|sdtContentLocked.
merge_cellstool Merge a rectangular range of cells. Horizontal: gridSpan. Vertical: vMerge.
Merge a rectangular range of cells. Horizontal: gridSpan. Vertical: vMerge.
merge_documentstool Merge another DOCX document's content into the current document.
Merge another DOCX document's content into the current document.
merge_review_roundstool Merge tracked changes from N reviewer copies into the open document.
Merge tracked changes from N reviewer copies into the open document.
modify_celltool Modify a table cell.
Modify a table cell.

    By default (tracked=True) the old content is marked as a deletion and the new
    content as an insertion — the human reviewer accepts/rejects in Word's Track
    Changes view. Pass tracked=False to overwrite the cell directly with no markup.

    Args:
        table_idx: Table index (0-based).
        row: Row index (0-based).
        col: Column index (0-based).
        text: New cell text.
        author: Author name shown in Word's review pane (tracked=True only).
        tracked: True (default) = tracked del+ins. False = direct overwrite, no markup.
        document_handle: Optional handle for concurrent session isolation.
open_documenttool Open a .docx file for reading and editing.Files
Open a .docx file for reading and editing.

    Unpacks the DOCX archive, parses all XML parts, and caches them in memory
    under a handle. Multiple documents may be open concurrently, each under
    its own handle.

    Args:
        path: Absolute path to the .docx file.
        document_handle: Optional handle to store this document under. Empty
            string uses the shared `__default__` slot (legacy behavior); pass
            a unique value (e.g. a UUID) per concurrent session for isolation.
promote_list_itemtool Decrease the list indentation level (ilvl) of a paragraph by 1, minimum 0.
Decrease the list indentation level (ilvl) of a paragraph by 1, minimum 0.

    Returns {para_id, ilvl}. Raises ValueError if paragraph is not a list item.
read_parttool Read raw XML of any DOCX part (e.g. 'word/document.xml').
Read raw XML of any DOCX part (e.g. 'word/document.xml').
    Use list_parts() to discover available parts.
redact_texttool True redaction: remove text and replace with black rectangle. Use exact_text or pattern.
True redaction: remove text and replace with black rectangle. Use exact_text or pattern.

    Args:
        pattern: Regex pattern to match run text.
        para_ids: Optional list of paragraph paraId values to limit scope.
        exact_text: Exact string to match against run text.
        reason: Reason for redaction (stored in log).
reject_all_changestool Reject all tracked changes in document order.
Reject all tracked changes in document order.

    Returns a JSON object with the count of rejected changes: {"rejected": int}.
reject_changetool Reject a single tracked change by its change_id.
Reject a single tracked change by its change_id.

    For insertions: discards the inserted text (removes w:ins).
    For deletions: keeps the deleted text (unwraps w:del, restoring text).

    Args:
        change_id: The integer id attribute of the w:ins or w:del element.
reject_changestool Reject tracked changes — remove insertions, restore deleted text.
Reject tracked changes — remove insertions, restore deleted text.
remove_bookmarktool Remove a bookmark by name (keeps paragraph content).
Remove a bookmark by name (keeps paragraph content).
remove_hyperlinktool Remove a hyperlink wrapper, preserving the text runs inside.
Remove a hyperlink wrapper, preserving the text runs inside.

    The paragraph text remains; only the w:hyperlink element is unwrapped.

    Args:
        para_id: w14:paraId of the paragraph containing the hyperlink.
        url_or_anchor: URL (for external) or bookmark name (for internal) to match.
remove_watermarktool Remove VML watermarks (e.g., DRAFT) from all document headers.
Remove VML watermarks (e.g., DRAFT) from all document headers.
replace_texttool Replace text in a paragraph.
Replace text in a paragraph.

    With tracked=True (default) the old text is shown as red strikethrough and the
    new text as an underlined insertion — the human reviewer accepts/rejects in Word.
    Only the actually-changed portion is marked; common leading/trailing text is left
    as plain runs. With tracked=False the replacement is applied immediately without
    any visible markup.

    Args:
        para_id: paraId of the target paragraph.
        find: Text to find and replace (may span run boundaries).
        replace: Replacement text.
        author: Author name shown in Word's review pane (tracked=True only).
        context_before: Text immediately before the target (for precise anchoring).
        context_after: Text immediately after the target (for precise anchoring).
        tracked: True (default) = strikethrough + underline the human accepts/rejects.
                 False = replaced immediately, no markup.
        document_handle: Optional handle for concurrent session isolation.
reply_to_commenttool Reply to an existing comment (creates a threaded reply).
Reply to an existing comment (creates a threaded reply).
resolve_commenttool Mark a comment as resolved (sets w15:done='1' in commentsExtended.xml).
Mark a comment as resolved (sets w15:done='1' in commentsExtended.xml).

    Args:
        comment_id: ID of the comment to resolve.
restart_numberingtool Restart list numbering at a paragraph. Adds lvlOverride with startOverride.
Restart list numbering at a paragraph. Adds lvlOverride with startOverride.
sanitize_metadatatool Write a sanitized copy of the open document to output_path.
Write a sanitized copy of the open document to output_path.

    Level 1: Remove rsid session-fingerprint attributes from document.xml.
    Level 2: + Replace tracked-change author names (w:author on w:ins/w:del).
    Level 3: + Clear creator/lastModifiedBy/revision in docProps/core.xml
             + Clear Company in docProps/app.xml
             + Remove attachedTemplate reference from word/settings.xml

    Args:
        output_path: Destination path for the sanitized DOCX. Must be non-empty.
        level: Sanitization depth (1, 2, or 3). Default 1.
        redact_authors_as: Replacement author string for level 2+. Default "Anonymous".
save_documenttool Save all changes back to a .docx file.Files
Save all changes back to a .docx file.

    Args:
        output_path: Path for the output file. If empty, overwrites the original
            source path of the document under this handle.
        document_handle: Handle of the document to save. Empty = `__default__`.
scrub_piitool [EXPERIMENTAL] Detect and redact PII from the open document using Presidio + spaCy NER.
[EXPERIMENTAL] Detect and redact PII from the open document using Presidio + spaCy NER.

    WARNING: This tool WILL miss PII. It is experimental and NOT suitable for production
    use or as the sole control for privileged, regulated, or legally sensitive documents.
    Always run with dry_run=True first and manually review every detected entity before
    committing a redacted file.

    Known limitations (statistical NER gaps):
      - Names in ALL-CAPS (ledger headers, table cells) are frequently missed.
      - Single-token names with no surrounding context are unreliable.
      - Non-English names (Arabic, CJK, African) have low recall on this English model.
      - Names embedded in legal boilerplate ("Borrower: Jane Doe") are often skipped.

    NER model (en_core_web_lg, ~560MB) downloads automatically on first use.

    Detects: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, CREDIT_CARD, SSN, IP_ADDRESS,
             IBAN_CODE, US_BANK_NUMBER, US_PASSPORT, and more via Presidio.

    Redacted text is replaced with a solid black DrawingML rectangle — true XML
    redaction where the original text is deleted from the OOXML entirely, not
    merely hidden by formatting.

    Args:
        output_path: Destination path. Required when dry_run=False.
        entities: Presidio entity types to redact. None = all detected types.
        confidence_threshold: Presidio score floor (default 0.35).
        dry_run: If True, detect only — return entity list, write no file.
        also_sanitize_metadata: Apply level-3 metadata sanitization (default True).
        redact_authors_as: Replacement author string for metadata pass.
search_texttool Search for text across the document body, footnotes, and comments.
Search for text across the document body, footnotes, and comments.

    Args:
        query: Text to search for (case-insensitive), or a regex pattern.
        regex: If true, treat query as a Python regular expression.

    Returns matching paragraphs with their paraId, source part, and context.
set_alt_texttool Set the alt text (and optionally title) on an image by 0-based index.
Set the alt text (and optionally title) on an image by 0-based index.

    Args:
        image_index: 0-based index across all wp:docPr elements in document.xml.
        alt_text: Accessibility description to set on the image.
        title: Optional title attribute; removed from XML if empty.

    Returns:
        {"image_index": int, "alt_text": str}
set_cell_shadingtool Set background shading fill color on a table cell.
Set background shading fill color on a table cell.
set_cell_vertical_alignmenttool Set vertical alignment of a table cell: top, center, or bottom.
Set vertical alignment of a table cell: top, center, or bottom.
set_cell_widthtool Set the width of a table cell in millimetres (stored as DXA).
Set the width of a table cell in millimetres (stored as DXA).
set_character_positiontool Set vertical character position (raised/lowered) for a specific run.
Set vertical character position (raised/lowered) for a specific run.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        position_pt: Offset in points (positive = raised, negative = lowered).
set_character_spacingtool Set character spacing (tracking) for a specific run in a paragraph.
Set character spacing (tracking) for a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        spacing_pt: Spacing in points (positive = expanded, negative = condensed).
set_column_widthstool Set column widths in cm. len(widths_cm) must match column count.
Set column widths in cm. len(widths_cm) must match column count.
set_content_control_valuetool Update the value/text of a content control by its tag.
Update the value/text of a content control by its tag.

    Args:
        tag: Tag name of the control to update.
        value: New value. For checkbox: 'true'/'1' = checked, 'false'/'0' = unchecked.
set_custom_propertytool Set (upsert) a custom document property.
Set (upsert) a custom document property.

    Args:
        name: Property name.
        value: Property value as a string.
        vt_type: VT type element name (lpwstr, i4, bool, etc.).
set_different_first_pagetool Enable or disable a different first-page header/footer for a section.
Enable or disable a different first-page header/footer for a section.

    When enabled, the section can have a unique header/footer on its first page,
    separate from the header/footer used on subsequent pages.

    Args:
        section_index: Zero-based section index (use get_sections to find it).
        enabled: True to enable different first page, False to disable.

    Returns:
        {"section_index": int, "different_first_page": bool}
set_document_languagetool Set the default document language.
Set the default document language.

    Writes the BCP-47 language tag into the default paragraph style's run
    properties (``w:rPr/w:lang``) in ``word/styles.xml``.

    Args:
        language_code: BCP-47 language tag, e.g. "en-US", "fr-FR", "de-DE".

    Returns:
        {"language": language_code}
set_document_protectiontool Set document protection. edit: trackedChanges/comments/readOnly/forms/none.
Set document protection. edit: trackedChanges/comments/readOnly/forms/none.
set_formattingtool Apply character formatting to text with tracked-change markup.
Apply character formatting to text with tracked-change markup.
set_header_rowtool Mark the first row as a repeating header row.
Mark the first row as a repeating header row.
set_image_alt_texttool Set accessibility alt text and title on an embedded image.
Set accessibility alt text and title on an embedded image.

    Args:
        rId: The relationship ID of the image.
        alt_text: Alt text (descr attribute on wp:docPr).
        title: Optional title attribute on wp:docPr.
set_image_bordertool Set or remove a border on an embedded image.
Set or remove a border on an embedded image.

    Args:
        rId: The relationship ID of the image (e.g. 'rId6').
        border_pt: Border width in points. Use 0 to remove the border.
        color: RGB hex color string without '#' (default '000000' = black).

    Returns:
        JSON with rId, border_pt, and color fields.
set_image_sizetool Resize an embedded image by updating its EMU extent attributes.
Resize an embedded image by updating its EMU extent attributes.

    Args:
        rId: The relationship ID of the image to resize.
        width_cm: New width in centimetres.
        height_cm: New height in centimetres.
set_keep_lines_togethertool Keep all lines of this paragraph on the same page.
Keep all lines of this paragraph on the same page.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to enable keep-lines-together, False to remove it.
set_keep_with_nexttool Keep this paragraph on the same page as the next paragraph.
Keep this paragraph on the same page as the next paragraph.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to enable keep-with-next, False to remove it.
set_line_spacingtool Set line spacing and paragraph spacing.
Set line spacing and paragraph spacing.

    Args:
        para_id: paraId of the target paragraph.
        line_rule: "auto" | "exact" | "atLeast". None leaves unchanged.
        line_value: For "auto": 240=single, 360=1.5x, 480=double. For "exact"/"atLeast": twips.
        space_before_pt: Space before paragraph in points (None = unchanged).
        space_after_pt: Space after paragraph in points (None = unchanged).
set_odd_even_headerstool Enable or disable different odd/even page headers globally.
Enable or disable different odd/even page headers globally.

    This is a document-level setting stored in word/settings.xml. When enabled,
    even-numbered pages can use a different header/footer from odd-numbered pages.

    Args:
        enabled: True to enable different odd/even headers, False to disable.

    Returns:
        {"odd_even_headers": bool}
set_page_break_beforetool Force a page break before this paragraph.
Force a page break before this paragraph.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to force page break before, False to remove it.
set_page_marginstool Set page margins from millimetre values.
Set page margins from millimetre values.

    Args:
        top_mm: Top margin in mm. None = unchanged.
        bottom_mm: Bottom margin in mm. None = unchanged.
        left_mm: Left margin in mm. None = unchanged.
        right_mm: Right margin in mm. None = unchanged.
        para_id: paraId of paragraph with section break. None = body section.
set_page_orientationtool Set page orientation, swapping width/height dimensions if needed.
Set page orientation, swapping width/height dimensions if needed.

    Args:
        orientation: "portrait" or "landscape".
        para_id: paraId of paragraph with section break. None = body section.
set_page_sizetool Set page size from millimetre values.
Set page size from millimetre values.

    Args:
        width_mm: Page width in mm (e.g. 210 for A4, 215.9 for Letter).
        height_mm: Page height in mm (e.g. 297 for A4, 279.4 for Letter).
        para_id: paraId of paragraph with section break. None = body section.
set_paragraph_bordertool Set borders on one or more sides of a paragraph.
Set borders on one or more sides of a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        sides: List of sides: "top", "bottom", "left", "right", "between".
        color: Border color as 6-digit hex (default "000000").
        size: Border width in eighths of a point (default 4 = 0.5pt).
set_paragraph_indentationtool Set indentation on a paragraph.
Set indentation on a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        left_cm: Left indent in centimetres (None = unchanged).
        right_cm: Right indent in centimetres (None = unchanged).
        first_line_cm: First-line indent in cm (mutually exclusive with hanging_cm).
        hanging_cm: Hanging indent in cm (mutually exclusive with first_line_cm).
set_paragraph_shadingtool Set background shading on a paragraph.
Set background shading on a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        fill_color: Fill color as 6-digit hex (e.g., "FFFF00").
        pattern: Shading pattern (default "clear").
set_propertiestool Set core document properties. Empty string = unchanged.
Set core document properties. Empty string = unchanged.
set_row_heighttool Set row height in millimetres. rule: exact, atLeast, or auto.
Set row height in millimetres. rule: exact, atLeast, or auto.
set_run_colortool Set the font color of a specific run in a paragraph.
Set the font color of a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        color: Hex color without # (e.g., "FF0000").
set_run_fonttool Set the font of a specific run (zero-based index) in a paragraph.
Set the font of a specific run (zero-based index) in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        font_name: Font name (e.g., "Arial", "Times New Roman").
set_run_highlighttool Set highlight color of a specific run in a paragraph.
Set highlight color of a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        color: Word highlight color name (e.g., "yellow", "green", "cyan", "none").
set_run_languagetool Set the language on a run for spell-checking purposes.
Set the language on a run for spell-checking purposes.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        language_code: BCP-47 language code (e.g., "en-US", "fr-FR", "de-DE").
set_run_sizetool Set the font size of a specific run in a paragraph.
Set the font size of a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        size_pt: Font size in points (e.g., 12.0).
set_run_strikethroughtool Set strikethrough on a specific run in a paragraph.
Set strikethrough on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        double: False for single strikethrough, True for double strikethrough.
set_run_subscripttool Set subscript vertical alignment on a specific run in a paragraph.
Set subscript vertical alignment on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
set_run_superscripttool Set superscript vertical alignment on a specific run in a paragraph.
Set superscript vertical alignment on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
set_run_underlinetool Set underline style on a specific run in a paragraph.
Set underline style on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        style: Underline style (e.g., "single", "double", "dotted", "none").
set_section_columnstool Set the number of columns in a section.
Set the number of columns in a section.

    Args:
        section_index: Zero-based section index (use get_sections to find it).
        num_columns: Number of text columns (1 = single column).
        equal_width: If True, all columns are equal width. Default True.
set_section_propertiestool Modify section properties (page size, orientation, margins). 0/empty = unchanged.
Modify section properties (page size, orientation, margins). 0/empty = unchanged.
set_table_alignmenttool Set table alignment: left, center, or right.
Set table alignment: left, center, or right.
set_table_borderstool Set borders on all six sides of a table (top, bottom, left, right, insideH, insideV).
Set borders on all six sides of a table (top, bottom, left, right, insideH, insideV).
set_table_styletool Apply a named table style (e.g. TableGrid, LightShading-Accent1) to a table.
Apply a named table style (e.g. TableGrid, LightShading-Accent1) to a table.
set_text_casetool Set text case transformation on a run.
Set text case transformation on a run.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        case: "upper" (all caps), "small" (small caps), or "none" (remove case transform).
set_theme_colortool Update a named color slot in the document theme.
Update a named color slot in the document theme.

    Args:
        slot: One of dk1, lt1, dk2, lt2, accent1-accent6, hlink, folHlink.
        hex_color: 6-character hex string without # (e.g. "FF0000").
set_track_changestool Enable or disable revision tracking in the document.
Enable or disable revision tracking in the document.

    When enabled, Word/LibreOffice will record future edits as tracked changes.

    Args:
        enabled: True to enable tracking, False to disable.
        author: Optional author name (stored in response for reference only).

    Returns:
        {"track_changes": bool, "author": str}
set_widow_controltool Enable widow/orphan control for this paragraph.
Enable widow/orphan control for this paragraph.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to enable widow control, False to remove it.
sort_tabletool Sort the non-header rows of a table by the text content of a column.
Sort the non-header rows of a table by the text content of a column.

    Header rows (marked with w:tblHeader) remain at the top. Rows with a
    missing cell at column_index sort as empty string.

    Args:
        table_idx: 0-based table index.
        column_index: 0-based column to sort by.
        ascending: True for A→Z (default), False for Z→A.

    Returns:
        {"sorted_rows": int, "column_index": int, "ascending": bool}
split_documenttool Split the open document into multiple DOCX files, one per heading section.
Split the open document into multiple DOCX files, one per heading section.

    Args:
        output_dir: Directory for output files. Defaults to <workdir>/split_output.
        at_heading_level: Heading level to split on (default 1).

    Returns: {"output_dir": str, "files": list[str], "parts": int}
split_tabletool Split a table into two tables at the given row index.
Split a table into two tables at the given row index.

    Rows 0..at_row_index-1 remain in the original table; rows
    at_row_index..end move to a new table inserted immediately after.

    Args:
        table_idx: 0-based table index.
        at_row_index: 0-based row index to split at (must be > 0 and < row_count).

    Returns:
        {"table1_rows": int, "table2_rows": int}
suppress_numberingtool Remove list numbering from a paragraph by setting numId to 0.
Remove list numbering from a paragraph by setting numId to 0.
table_to_csvtool Export a table as CSV string.
Export a table as CSV string.
update_chart_datatool Replace data series in an existing chart by chart_id.
Replace data series in an existing chart by chart_id.

    series: [{"name": str, "values": [float, ...]}]
update_commenttool Replace the text of an existing comment.
Replace the text of an existing comment.

    Args:
        comment_id: ID of the comment to update.
        text: New comment text.
update_content_controltool Modify properties of an existing content control.
Modify properties of an existing content control.

    Args:
        control_id: The w:id value of the content control to update.
        title: New title (w:alias/@w:val). Omit to leave unchanged.
        tag: New tag (w:tag/@w:val). Omit to leave unchanged.
        placeholder_text: New placeholder text. Omit to leave unchanged.
update_endnotetool Update the text of an existing endnote.
Update the text of an existing endnote.

    Args:
        endnote_id: The numeric ID of the endnote to update (must be >= 1).
        text: The new text content for the endnote.
update_fieldstool Mark all fields as dirty so Word recalculates on open.
Mark all fields as dirty so Word recalculates on open.
update_footnotetool Update the text of an existing footnote.
Update the text of an existing footnote.

    Args:
        footnote_id: The numeric ID of the footnote to update (must be >= 1).
        text: The new text content for the footnote.
update_hyperlinktool Update the target URL of an existing external hyperlink relationship.
Update the target URL of an existing external hyperlink relationship.

    Args:
        r_id: The relationship ID (e.g. "rId7") to update.
        new_url: The new target URL.
update_imagetool Replace the binary for an existing image in-place.
Replace the binary for an existing image in-place.

    The image dimensions and position in the document are preserved.

    Args:
        rId: The relationship ID of the image to replace.
        new_image_path: Absolute path to the new image file on disk.
update_paragraphtool Update the text and/or style of an existing paragraph.
Update the text and/or style of an existing paragraph.

    Args:
        para_id: paraId of the paragraph to update.
        text: New text content. Empty string leaves text unchanged.
        style: New paragraph style name. Empty string leaves style unchanged.
        tracked: If True, wrap old runs in w:del and new text in w:ins.
        author: Author name shown in Word's review pane (tracked=True only).
update_styletool Update an existing style's basedOn and/or next properties.
Update an existing style's basedOn and/or next properties.

    Args:
        name: Style name or styleId (case-insensitive).
        based_on: New basedOn styleId (replaces existing).
        next_style: New next styleId (replaces existing).
update_toctool Regenerate ToC entries from current headings.
Regenerate ToC entries from current headings.
validate_endnotestool Cross-reference endnote IDs between document.xml and endnotes.xml.
Cross-reference endnote IDs between document.xml and endnotes.xml.
validate_footnotestool Cross-reference footnote IDs between document.xml and footnotes.xml.
Cross-reference footnote IDs between document.xml and footnotes.xml.
validate_paraidstool Check paraId uniqueness across all document parts.
Check paraId uniqueness across all document parts.
validate_template_datatool Validate data dict covers all template fields. Returns missing and extra keys.
Validate data dict covers all template fields. Returns missing and extra keys.
write_parttool Replace a DOCX part with new XML. Validates well-formedness first.
Replace a DOCX part with new XML. Validates well-formedness first.
    WARNING: Direct XML manipulation can corrupt the document if used incorrectly.
xpath_querytool Run XPath against any DOCX part. Pre-bound namespaces: w, w14, r, wp, a, mc.
Run XPath against any DOCX part. Pre-bound namespaces: w, w14, r, wp, a, mc.

    Examples:
      xpath="//w:p" — all paragraphs
      xpath="//w:t/text()" — all text content
      xpath="//w:p[w:pPr/w:pStyle/@w:val='Heading1']" — Heading 1 paragraphs

Text the model reads (219)

Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.

open_document tool
Open a .docx file for reading and editing.

    Unpacks the DOCX archive, parses all XML parts, and caches them in memory
    under a handle. Multiple documents may be open concurrently, each under
    its own handle.

    Args:
        path: Absolute path to the .docx file.
        document_handle: Optional handle to store this document under. Empty
            string uses the shared `__default__` slot (legacy behavior); pass
            a unique value (e.g. a UUID) per concurrent session for isolation.
close_document tool
Close a document and clean up temporary files.

    Args:
        document_handle: Handle of the document to close. Empty = `__default__` slot.
create_document tool
Create a new blank .docx document (or from a .dotx template).

    The document is automatically opened for editing under the given handle.
    Use save_document to save changes, or start editing immediately with
    insert_text, add_table, etc.

    Args:
        output_path: Path for the new .docx file.
        template_path: Optional path to a .dotx template file.
        document_handle: Optional handle to store this document under.
create_from_markdown tool
Create a new .docx document from markdown content.

    Supports full GitHub-Flavored Markdown: headings, bold/italic/strikethrough,
    links, images, bullet/numbered/nested lists, code blocks, blockquotes,
    tables, footnotes, and task lists. Smart typography (curly quotes, em/en
    dashes, ellipses) is applied automatically.

    Provide exactly one of md_path or markdown. The document is automatically
    opened for editing under the given handle.

    Args:
        output_path: Path for the new .docx file.
        md_path: Path to a .md file. Mutually exclusive with markdown.
        markdown: Raw markdown text. Mutually exclusive with md_path.
        template_path: Optional path to a .dotx template file.
        document_handle: Optional handle to store this document under.
get_document_info tool
Get overview stats: paragraph count, headings, footnotes, comments, images.
get_headings tool
Get the document heading structure with levels, text, and paraIds.

    Returns a list of headings in document order, each with:
    - level (1-9)
    - text (heading content)
    - style (e.g., "Heading1")
    - paraId (unique paragraph identifier for targeting edits)
search_text tool
Search for text across the document body, footnotes, and comments.

    Args:
        query: Text to search for (case-insensitive), or a regex pattern.
        regex: If true, treat query as a Python regular expression.

    Returns matching paragraphs with their paraId, source part, and context.
get_paragraph tool
Get the full text and style of a specific paragraph by its paraId.

    Args:
        para_id: The 8-character hex paraId (e.g., "1A2B3C4D").
get_tables tool
Get all tables with row/column counts and cell text content.
add_table tool
Insert a new table after a paragraph with tracked insertion.
modify_cell tool
Modify a table cell.

    By default (tracked=True) the old content is marked as a deletion and the new
    content as an insertion — the human reviewer accepts/rejects in Word's Track
    Changes view. Pass tracked=False to overwrite the cell directly with no markup.

    Args:
        table_idx: Table index (0-based).
        row: Row index (0-based).
        col: Column index (0-based).
        text: New cell text.
        author: Author name shown in Word's review pane (tracked=True only).
        tracked: True (default) = tracked del+ins. False = direct overwrite, no markup.
        document_handle: Optional handle for concurrent session isolation.
add_table_row tool
Add a row to a table with tracked insertion. row_idx=-1 appends.
delete_table_row tool
Delete a table row with tracked changes.
merge_cells tool
Merge a rectangular range of cells. Horizontal: gridSpan. Vertical: vMerge.
set_header_row tool
Mark the first row as a repeating header row.
set_column_widths tool
Set column widths in cm. len(widths_cm) must match column count.
csv_to_table tool
Insert a table from CSV text.
table_to_csv tool
Export a table as CSV string.
delete_table tool
Delete a table by index (0-based). Raises IndexError if out of range.
add_column_to_table tool
Add a new column to every row of a table. First row gets header_text.
delete_column_from_table tool
Delete a column (0-based) from every row of a table.
set_cell_width tool
Set the width of a table cell in millimetres (stored as DXA).
set_cell_vertical_alignment tool
Set vertical alignment of a table cell: top, center, or bottom.
set_row_height tool
Set row height in millimetres. rule: exact, atLeast, or auto.
set_table_alignment tool
Set table alignment: left, center, or right.
set_table_borders tool
Set borders on all six sides of a table (top, bottom, left, right, insideH, insideV).
set_cell_shading tool
Set background shading fill color on a table cell.
set_table_style tool
Apply a named table style (e.g. TableGrid, LightShading-Accent1) to a table.
add_list tool
Apply list formatting to paragraphs (bullet or numbered).
get_styles tool
Get all defined styles with ID, name, type, and base style.
create_style tool
Create a new style in the document.

    Args:
        name: Style name (used as styleId after removing spaces).
        style_type: "paragraph", "character", "table", or "numbering".
        based_on: Optional styleId this style inherits from.
        next_style: Optional styleId applied to the next paragraph.
update_style tool
Update an existing style's basedOn and/or next properties.

    Args:
        name: Style name or styleId (case-insensitive).
        based_on: New basedOn styleId (replaces existing).
        next_style: New next styleId (replaces existing).
delete_style tool
Delete a style from the document.

    Args:
        name: Style name or styleId (case-insensitive).
get_style tool
Get details of a single style by name or styleId (case-insensitive).

    Args:
        name_or_id: Style name or styleId to look up.

    Returns:
        {"style_id": str, "name": str, "type": str, "base_style": str, "next_style": str}
copy_style tool
Deep-copy an existing style under a new name.

    Args:
        source_name_or_id: Name or styleId of the style to copy.
        new_name: Name for the new style (spaces stripped for styleId).

    Returns:
        {"style_id": str, "name": str, "type": str}
apply_style_to_range tool
Apply a style to a list of paragraphs by their paraIds.

    Args:
        para_ids: List of paragraph paraIds to update.
        style_name_or_id: Style name or styleId to apply.

    Returns:
        {"applied": int, "style_id": str, "para_ids": list[str]}
get_headers_footers tool
Get all headers and footers with their text content.
edit_header_footer tool
Edit text in a header or footer.

    By default (tracked=True) the change is recorded as a deletion of the old text
    and an insertion of the new text — the human reviewer accepts/rejects in Word.
    Pass tracked=False to replace the text directly with no revision markup.

    Args:
        location: "header" or "footer" (matches the first found of that type).
        old_text: Text to find and replace.
        new_text: Replacement text.
        author: Author name shown in Word's review pane (tracked=True only).
        tracked: True (default) = tracked del+ins. False = direct replacement, no markup.
        document_handle: Optional handle for concurrent session isolation.
delete_header tool
Delete a header by location: default, first, or even.
delete_footer tool
Delete a footer by location: default, first, or even.
get_properties tool
Get core document properties (title, creator, subject, dates, revision).
set_properties tool
Set core document properties. Empty string = unchanged.
get_custom_properties tool
Get custom document properties from docProps/custom.xml.
set_custom_property tool
Set (upsert) a custom document property.

    Args:
        name: Property name.
        value: Property value as a string.
        vt_type: VT type element name (lpwstr, i4, bool, etc.).
delete_custom_property tool
Delete a custom document property by name.

    Args:
        name: Property name to delete.
get_images tool
Get all embedded images with rId, filename, content type, and dimensions.
insert_image tool
Insert an image into the document after a paragraph.
insert_floating_image tool
Insert a floating (anchored) image. wrap: square|topbottom|none.
delete_image tool
Remove the drawing containing the image with the given rId from the document.

    Also removes the relationship entry from word/_rels/document.xml.rels.

    Args:
        rId: The relationship ID of the image to delete (e.g. 'rId5').
update_image tool
Replace the binary for an existing image in-place.

    The image dimensions and position in the document are preserved.

    Args:
        rId: The relationship ID of the image to replace.
        new_image_path: Absolute path to the new image file on disk.
set_image_size tool
Resize an embedded image by updating its EMU extent attributes.

    Args:
        rId: The relationship ID of the image to resize.
        width_cm: New width in centimetres.
        height_cm: New height in centimetres.
set_image_alt_text tool
Set accessibility alt text and title on an embedded image.

    Args:
        rId: The relationship ID of the image.
        alt_text: Alt text (descr attribute on wp:docPr).
        title: Optional title attribute on wp:docPr.
set_image_border tool
Set or remove a border on an embedded image.

    Args:
        rId: The relationship ID of the image (e.g. 'rId6').
        border_pt: Border width in points. Use 0 to remove the border.
        color: RGB hex color string without '#' (default '000000' = black).

    Returns:
        JSON with rId, border_pt, and color fields.
get_endnotes tool
Get all endnotes with their ID and text content.
add_endnote tool
Add an endnote to a paragraph.
validate_endnotes tool
Cross-reference endnote IDs between document.xml and endnotes.xml.
get_footnotes tool
List all footnotes with their ID and text content.
add_footnote tool
Add a footnote to a paragraph. url, if provided, is rendered as a hotlink.
add_footnote_ref tool
Add a subsequent reference to an existing footnote without creating a new definition.

    Use when the same source must be cited again in a different paragraph. Inserts a
    hyperlink-wrapped footnoteReference that navigates to the same footnote as the
    original citation. Does not duplicate the footnote definition in footnotes.xml.
validate_footnotes tool
Cross-reference footnote IDs between document.xml and footnotes.xml.
update_footnote tool
Update the text of an existing footnote.

    Args:
        footnote_id: The numeric ID of the footnote to update (must be >= 1).
        text: The new text content for the footnote.
delete_footnote tool
Delete a footnote and its in-body reference.

    Removes the footnote definition from footnotes.xml and removes the
    footnoteReference run from the document body.

    Args:
        footnote_id: The numeric ID of the footnote to delete.
update_endnote tool
Update the text of an existing endnote.

    Args:
        endnote_id: The numeric ID of the endnote to update (must be >= 1).
        text: The new text content for the endnote.
delete_endnote tool
Delete an endnote and its in-body reference.

    Removes the endnote definition from endnotes.xml and removes the
    endnoteReference run from the document body.

    Args:
        endnote_id: The numeric ID of the endnote to delete.
add_page_break tool
Insert a page break after a paragraph.
add_section_break tool
Add a section break at a paragraph. break_type: nextPage/continuous/evenPage/oddPage.
set_section_properties tool
Modify section properties (page size, orientation, margins). 0/empty = unchanged.
set_page_size tool
Set page size from millimetre values.

    Args:
        width_mm: Page width in mm (e.g. 210 for A4, 215.9 for Letter).
        height_mm: Page height in mm (e.g. 297 for A4, 279.4 for Letter).
        para_id: paraId of paragraph with section break. None = body section.
set_page_margins tool
Set page margins from millimetre values.

    Args:
        top_mm: Top margin in mm. None = unchanged.
        bottom_mm: Bottom margin in mm. None = unchanged.
        left_mm: Left margin in mm. None = unchanged.
        right_mm: Right margin in mm. None = unchanged.
        para_id: paraId of paragraph with section break. None = body section.
set_page_orientation tool
Set page orientation, swapping width/height dimensions if needed.

    Args:
        orientation: "portrait" or "landscape".
        para_id: paraId of paragraph with section break. None = body section.
get_sections tool
List all sections in the document with their properties.

    Returns a JSON array of section objects, each containing:
    index, break_type, page_width, page_height, orientation, columns,
    margin_top, margin_bottom (all sizes in twips/DXA).
    The final section always has break_type="".
set_section_columns tool
Set the number of columns in a section.

    Args:
        section_index: Zero-based section index (use get_sections to find it).
        num_columns: Number of text columns (1 = single column).
        equal_width: If True, all columns are equal width. Default True.
delete_section_break tool
Remove a section break from a paragraph.

    Removes the w:sectPr from the paragraph's w:pPr. After removal the
    paragraph's content flows into the next section rather than ending one.

    Args:
        para_id: paraId of the paragraph that holds the section break.

    Raises:
        ValueError: If the paragraph has no section break.
set_different_first_page tool
Enable or disable a different first-page header/footer for a section.

    When enabled, the section can have a unique header/footer on its first page,
    separate from the header/footer used on subsequent pages.

    Args:
        section_index: Zero-based section index (use get_sections to find it).
        enabled: True to enable different first page, False to disable.

    Returns:
        {"section_index": int, "different_first_page": bool}
set_odd_even_headers tool
Enable or disable different odd/even page headers globally.

    This is a document-level setting stored in word/settings.xml. When enabled,
    even-numbered pages can use a different header/footer from odd-numbered pages.

    Args:
        enabled: True to enable different odd/even headers, False to disable.

    Returns:
        {"odd_even_headers": bool}
add_cross_reference tool
Add a cross-reference link from one paragraph to another.
set_document_protection tool
Set document protection. edit: trackedChanges/comments/readOnly/forms/none.
merge_documents tool
Merge another DOCX document's content into the current document.
validate_paraids tool
Check paraId uniqueness across all document parts.
insert_watermark tool
Insert a VML watermark into the document's default header.

    Places a <v:shape> with a <v:textpath> inside the default header, which is
    the standard Word watermark pattern.

    Args:
        text: Watermark text (e.g. "DRAFT", "CONFIDENTIAL").
        diagonal: If True (default), diagonal orientation; if False, horizontal.
        document_handle: Optional handle for concurrent session isolation.
remove_watermark tool
Remove VML watermarks (e.g., DRAFT) from all document headers.
audit_document tool
Run a comprehensive structural audit of the document.
insert_text tool
Insert text into a paragraph.

    By default (tracked=True) the insertion is marked as a proposed addition
    that appears underlined in Word's Track Changes view. The human reviewer
    must accept it in Word before it becomes permanent. Pass tracked=False to
    write the text directly with no revision markup.

    Args:
        para_id: paraId of the target paragraph.
        text: Text to insert.
        position: Where to insert — "start", "end", or a substring to insert after.
        author: Author name shown in Word's review pane (tracked=True only).
        context_before: Text immediately before the insertion point (for precise anchoring).
        context_after: Text immediately after the insertion point (for precise anchoring).
        ignore_case: If True, match context_before/context_after case-insensitively.
        tracked: True (default) = revision markup the human accepts/rejects in Word.
                 False = text written directly, no markup.
        document_handle: Optional handle for concurrent session isolation.
delete_text tool
Delete text from a paragraph.

    Finds the text within the paragraph (across run boundaries if needed).
    With tracked=True (default) the deleted text stays visible as red strikethrough
    in Word's Track Changes view — the human reviewer must accept the deletion to
    remove it permanently. With tracked=False the text is removed immediately.

    Provide context_before/context_after to disambiguate when the same text
    appears multiple times, or when it contains smart quotes / special whitespace.

    Args:
        para_id: paraId of the target paragraph.
        text: Text to delete (ASCII quotes/dashes/spaces match their Unicode equivalents).
        author: Author name shown in Word's review pane (tracked=True only).
        context_before: Text immediately before the target (for precise anchoring).
        context_after: Text immediately after the target (for precise anchoring).
        ignore_case: If True, match text and context case-insensitively.
        tracked: True (default) = red strikethrough the human accepts/rejects.
                 False = text removed immediately, no markup.
        document_handle: Optional handle for concurrent session isolation.
replace_text tool
Replace text in a paragraph.

    With tracked=True (default) the old text is shown as red strikethrough and the
    new text as an underlined insertion — the human reviewer accepts/rejects in Word.
    Only the actually-changed portion is marked; common leading/trailing text is left
    as plain runs. With tracked=False the replacement is applied immediately without
    any visible markup.

    Args:
        para_id: paraId of the target paragraph.
        find: Text to find and replace (may span run boundaries).
        replace: Replacement text.
        author: Author name shown in Word's review pane (tracked=True only).
        context_before: Text immediately before the target (for precise anchoring).
        context_after: Text immediately after the target (for precise anchoring).
        tracked: True (default) = strikethrough + underline the human accepts/rejects.
                 False = replaced immediately, no markup.
        document_handle: Optional handle for concurrent session isolation.
get_body_text tool
Return the full accepted-view text of the document.

    Accepted view: w:ins text included, w:del text excluded.
    Includes text inside w:hyperlink runs.
    Paragraphs are joined by newline.
    Footnote text is returned separately.

    Returns JSON: {"body": str, "footnotes": str}
get_tracked_changes tool
Return all pending tracked changes (insertions and deletions) as a JSON list.

    Each entry contains: type, change_id, author, date, para_id, text.
    Changes are returned in document order.
accept_changes tool
Accept tracked changes — keep insertions, remove deletions. Empty author = all.
reject_changes tool
Reject tracked changes — remove insertions, restore deleted text.
accept_change tool
Accept a single tracked change by its change_id.

    For insertions: keeps the inserted text (unwraps w:ins).
    For deletions: discards the deleted text (removes w:del).

    Args:
        change_id: The integer id attribute of the w:ins or w:del element.
reject_change tool
Reject a single tracked change by its change_id.

    For insertions: discards the inserted text (removes w:ins).
    For deletions: keeps the deleted text (unwraps w:del, restoring text).

    Args:
        change_id: The integer id attribute of the w:ins or w:del element.
accept_all_changes tool
Accept all tracked changes in document order.

    Returns a JSON object with the count of accepted changes: {"accepted": int}.
reject_all_changes tool
Reject all tracked changes in document order.

    Returns a JSON object with the count of rejected changes: {"rejected": int}.
set_formatting tool
Apply character formatting to text with tracked-change markup.
get_comments tool
List all comments with their ID, author, date, and text.
add_comment tool
Add a comment anchored to a paragraph.
reply_to_comment tool
Reply to an existing comment (creates a threaded reply).
update_comment tool
Replace the text of an existing comment.

    Args:
        comment_id: ID of the comment to update.
        text: New comment text.
delete_comment tool
Delete a comment and remove its range markers from the document.

    Args:
        comment_id: ID of the comment to delete.
resolve_comment tool
Mark a comment as resolved (sets w15:done='1' in commentsExtended.xml).

    Args:
        comment_id: ID of the comment to resolve.
list_comment_threads tool
List all comment threads (root comments with their replies).

    Returns a list of thread dicts: {root: {id, author, date, text}, replies: [...]}.
save_document tool
Save all changes back to a .docx file.

    Args:
        output_path: Path for the output file. If empty, overwrites the original
            source path of the document under this handle.
        document_handle: Handle of the document to save. Empty = `__default__`.
scrub_pii tool
[EXPERIMENTAL] Detect and redact PII from the open document using Presidio + spaCy NER.

    WARNING: This tool WILL miss PII. It is experimental and NOT suitable for production
    use or as the sole control for privileged, regulated, or legally sensitive documents.
    Always run with dry_run=True first and manually review every detected entity before
    committing a redacted file.

    Known limitations (statistical NER gaps):
      - Names in ALL-CAPS (ledger headers, table cells) are frequently missed.
      - Single-token names with no surrounding context are unreliable.
      - Non-English names (Arabic, CJK, African) have low recall on this English model.
      - Names embedded in legal boilerplate ("Borrower: Jane Doe") are often skipped.

    NER model (en_core_web_lg, ~560MB) downloads automatically on first use.

    Detects: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, CREDIT_CARD, SSN, IP_ADDRESS,
             IBAN_CODE, US_BANK_NUMBER, US_PASSPORT, and more via Presidio.

    Redacted text is replaced with a solid black DrawingML rectangle — true XML
    redaction where the original text is deleted from the OOXML entirely, not
    merely hidden by formatting.

    Args:
        output_path: Destination path. Required when dry_run=False.
        entities: Presidio entity types to redact. None = all detected types.
        confidence_threshold: Presidio score floor (default 0.35).
        dry_run: If True, detect only — return entity list, write no file.
        also_sanitize_metadata: Apply level-3 metadata sanitization (default True).
        redact_authors_as: Replacement author string for metadata pass.
sanitize_metadata tool
Write a sanitized copy of the open document to output_path.

    Level 1: Remove rsid session-fingerprint attributes from document.xml.
    Level 2: + Replace tracked-change author names (w:author on w:ins/w:del).
    Level 3: + Clear creator/lastModifiedBy/revision in docProps/core.xml
             + Clear Company in docProps/app.xml
             + Remove attachedTemplate reference from word/settings.xml

    Args:
        output_path: Destination path for the sanitized DOCX. Must be non-empty.
        level: Sanitization depth (1, 2, or 3). Default 1.
        redact_authors_as: Replacement author string for level 2+. Default "Anonymous".
compare_documents tool
Diff two DOCX files and produce a tracked-change document.

    Paragraph-level LCS diff:
      - Unchanged paragraphs copied verbatim.
      - Deleted paragraphs (in base, absent in revised) wrapped in w:del.
      - Inserted paragraphs (in revised, absent in base) wrapped in w:ins.
      - Modified paragraphs (1:1 replacement) get word-level del+ins inline.

    The output is a valid DOCX readable in Word/LibreOffice showing the changes
    as tracked revisions.

    Args:
        base_path: Path to the original DOCX.
        revised_path: Path to the revised DOCX.
        output_path: Destination path. Auto-generated if empty.
diff_to_text tool
Compare two separate DOCX files and produce a tracked-change DOCX plus a plain-text summary.

    Use this when you have two distinct files (e.g. an original and a revised copy)
    and want to show what changed between them. Produces:
      1. A DOCX with tracked-change markup (deletions in red, insertions underlined).
      2. A .txt summary suitable for pasting into an email or pull-request description.

    If you have already made tracked edits to the currently open document and just
    want to summarise those changes, use generate_change_summary instead.

    Args:
        base_path: Path to the original DOCX.
        revised_path: Path to the revised DOCX.
        docx_output: Output path for the tracked-change DOCX (auto-generated if empty).
        text_output: Output path for the plain-text summary .txt (auto-generated if empty).
generate_change_summary tool
Summarise tracked changes already present in the open document as an email-ready .txt.

    Use this after making edits with tracked=True (the default) and saving, to produce
    a human-readable change log of what was modified. Reads the document's existing
    w:ins / w:del elements, groups adjacent deletion+insertion pairs as REPLACEMENT
    entries, and writes a numbered list with author, date, and text per change.

    Typical workflow:
      open_document → edit with tracked=True → save_document → generate_change_summary

    If you have two separate files to compare rather than an already-edited document,
    use diff_to_text instead.

    Args:
        output_path: Destination .txt path. Auto-generated from the document stem if empty.
        document_handle: Optional handle for concurrent session isolation.
list_parts tool
List all XML parts (files) in the open DOCX zip.
read_part tool
Read raw XML of any DOCX part (e.g. 'word/document.xml').
    Use list_parts() to discover available parts.
write_part tool
Replace a DOCX part with new XML. Validates well-formedness first.
    WARNING: Direct XML manipulation can corrupt the document if used incorrectly.
xpath_query tool
Run XPath against any DOCX part. Pre-bound namespaces: w, w14, r, wp, a, mc.

    Examples:
      xpath="//w:p" — all paragraphs
      xpath="//w:t/text()" — all text content
      xpath="//w:p[w:pPr/w:pStyle/@w:val='Heading1']" — Heading 1 paragraphs
list_bookmarks tool
List all bookmarks in the document.
add_bookmark tool
Add a named bookmark wrapping the specified paragraph.
remove_bookmark tool
Remove a bookmark by name (keeps paragraph content).
get_bookmarked_text tool
Get the text content within a named bookmark.
list_hyperlinks tool
List all hyperlinks in the document.

    Returns a list of dicts with keys: id, url_or_anchor, text, para_id, type.
    type is "external" (r:id based) or "internal" (w:anchor based).
add_hyperlink tool
Append an external hyperlink at the end of a paragraph.

    Creates a relationship entry in word/_rels/document.xml.rels and a
    w:hyperlink element with a Hyperlink-styled run in word/document.xml.

    Args:
        para_id: w14:paraId of the target paragraph.
        text: Display text for the hyperlink.
        url: The URL the hyperlink points to.
add_internal_link tool
Append an internal anchor hyperlink (w:anchor) at the end of a paragraph.

    Internal links reference bookmarks by name and do NOT add a relationship.

    Args:
        para_id: w14:paraId of the target paragraph.
        text: Display text for the hyperlink.
        bookmark: Name of the bookmark to link to.
remove_hyperlink tool
Remove a hyperlink wrapper, preserving the text runs inside.

    The paragraph text remains; only the w:hyperlink element is unwrapped.

    Args:
        para_id: w14:paraId of the paragraph containing the hyperlink.
        url_or_anchor: URL (for external) or bookmark name (for internal) to match.
update_hyperlink tool
Update the target URL of an existing external hyperlink relationship.

    Args:
        r_id: The relationship ID (e.g. "rId7") to update.
        new_url: The new target URL.
add_field tool
Insert a Word field at end of paragraph.

    Common field codes: PAGE, NUMPAGES, DATE, SEQ Figure, REF MyBookmark,
    STYLEREF Heading.

    Args:
        para_id: w14:paraId of the target paragraph.
        field_code: The field instruction text (e.g. "PAGE").
        cached_value: Optional display text cached in the document.
update_fields tool
Mark all fields as dirty so Word recalculates on open.
list_fields tool
List all fields in the document with their codes and cached values.
get_field tool
Return details of a single field by field_id.

    Args:
        field_id: Positional identifier returned by list_fields (e.g. "field_0").
delete_field tool
Remove a complete complex field (begin through end runs) from the document.

    Args:
        field_id: Positional identifier returned by list_fields (e.g. "field_0").
insert_date_field tool
Insert a DATE field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
        date_format: Date picture switch (default: \\\\@ "MMMM d, yyyy").
insert_page_number_field tool
Insert a PAGE field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
insert_if_field tool
Insert a Word IF conditional field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
        condition: The condition expression (e.g. "x > 0").
        true_text: Text to display when condition is true.
        false_text: Text to display when condition is false.
insert_sequence_field tool
Insert a SEQ (sequence) field for figure/table numbering.

    Args:
        para_id: w14:paraId of the target paragraph.
        seq_name: The sequence identifier (e.g. "Figure", "Table").
        reset: If True, restarts the sequence counter at 1.
insert_merge_field tool
Insert a MERGEFIELD (mail merge) field at the end of a paragraph.

    Args:
        para_id: w14:paraId of the target paragraph.
        field_name: The merge field name (e.g. "FirstName").
generate_toc tool
Generate a Table of Contents from document headings.
update_toc tool
Regenerate ToC entries from current headings.
generate_list_of_figures tool
Insert a List of Figures field (requires SEQ Figure captions).
generate_list_of_tables tool
Insert a List of Tables field (requires SEQ Table captions).
generate_tof tool
Insert a Table of Figures field block after the paragraph with para_id.

    Collects caption-styled paragraphs starting with 'Figure' as entries.
generate_tot tool
Insert a Table of Tables field block after the paragraph with para_id.

    Collects caption-styled paragraphs starting with 'Table' as entries.
add_content_control tool
Wrap a paragraph in an SDT content control.

    Args:
        para_id: paraId of the paragraph to wrap.
        tag: Unique tag name for the control.
        control_type: One of text|checkbox|dropdown|date.
        label: Optional display label (w:alias).
        options: List of option strings for dropdown controls.
        default: Default display text (or date string for date controls).
get_content_controls tool
List all SDT content controls in the document.
set_content_control_value tool
Update the value/text of a content control by its tag.

    Args:
        tag: Tag name of the control to update.
        value: New value. For checkbox: 'true'/'1' = checked, 'false'/'0' = unchecked.
lock_content_control tool
Lock a content control to prevent editing.

    Args:
        tag: Tag name of the control to lock.
        lock: Lock type — sdtLocked|contentLocked|sdtContentLocked.
delete_content_control tool
Remove an SDT content control wrapper, keeping its content in place.

    Args:
        control_id: The w:id value of the content control to unwrap.
get_content_control tool
Return details of a single content control by its w:id.

    Args:
        control_id: The w:id value of the content control to retrieve.
update_content_control tool
Modify properties of an existing content control.

    Args:
        control_id: The w:id value of the content control to update.
        title: New title (w:alias/@w:val). Omit to leave unchanged.
        tag: New tag (w:tag/@w:val). Omit to leave unchanged.
        placeholder_text: New placeholder text. Omit to leave unchanged.
fill_template tool
Fill SDT content controls from data dict. Keys match w:tag values.

    Args:
        data: Mapping of tag names to values. Use list[str] for repeating sections.
        remove_empty: If True, remove SDTs with no matching key in data.
list_template_fields tool
List all SDT template fields (tag, label, type) in the document.
validate_template_data tool
Validate data dict covers all template fields. Returns missing and extra keys.
create_multilevel_list tool
Create a multilevel list in numbering.xml. Each level dict: {num_fmt, lvl_text, indent, hanging, style?}.
restart_numbering tool
Restart list numbering at a paragraph. Adds lvlOverride with startOverride.
suppress_numbering tool
Remove list numbering from a paragraph by setting numId to 0.
get_lists tool
Return all list definitions from numbering.xml.

    Each entry: {abstract_num_id, num_format, levels}.
    Returns [] if no numbering.xml exists.
promote_list_item tool
Decrease the list indentation level (ilvl) of a paragraph by 1, minimum 0.

    Returns {para_id, ilvl}. Raises ValueError if paragraph is not a list item.
demote_list_item tool
Increase the list indentation level (ilvl) of a paragraph by 1, maximum 8.

    Returns {para_id, ilvl}. Raises ValueError if paragraph is not a list item.
bates_number tool
Add Bates numbering stamp to document footer.

    Args:
        prefix: Bates prefix string (e.g. "ACME-").
        start: Starting Bates number.
        digits: Zero-padding width for the number.
        position: Hint for stamp position (currently "footer-right").
redact_text tool
True redaction: remove text and replace with black rectangle. Use exact_text or pattern.

    Args:
        pattern: Regex pattern to match run text.
        para_ids: Optional list of paragraph paraId values to limit scope.
        exact_text: Exact string to match against run text.
        reason: Reason for redaction (stored in log).
generate_redaction_log tool
Write a DOCX table of all redactions made this session.

    Args:
        output_path: Destination path. If empty, writes to a temp file.
generate_privilege_log tool
Generate a privilege log DOCX from document metadata.

    Args:
        output_path: Destination path. If empty, writes to a temp file.
add_equation tool
Insert a LaTeX equation as OMML. Requires: pip install latex2mathml.

    Args:
        para_id: paraId of the paragraph after which the equation is inserted.
        latex: LaTeX source string (e.g. r"\\\\frac{1}{2}").
get_equations tool
Return all equations in the document as OMML XML strings.
insert_bar_chart tool
Insert a native bar chart (no Excel required).

    series: [{"name": str, "values": [float, ...]}]
insert_line_chart tool
Insert a native line chart.

    series: [{"name": str, "values": [float, ...]}]
insert_pie_chart tool
Insert a native pie chart (single series, fixed 14x9 cm).

    series: [{"name": str, "values": [float, ...]}]
update_chart_data tool
Replace data series in an existing chart by chart_id.

    series: [{"name": str, "values": [float, ...]}]
merge_review_rounds tool
Merge tracked changes from N reviewer copies into the open document.
compare_contracts tool
Clause-aware diff between the open contract and another .docx file.
get_session_log tool
Return all operations performed this session as replayable JSON.
export_session_script tool
Write session operations as a Python replay script.

    Returns: {"output_path": str, "operations": int}
insert_paragraph tool
Insert a new paragraph after the paragraph with the given paraId.

    Args:
        after_para_id: paraId of the paragraph to insert after.
        text: Text content for the new paragraph.
        style: Optional paragraph style name (e.g., "Heading1", "Normal").
update_paragraph tool
Update the text and/or style of an existing paragraph.

    Args:
        para_id: paraId of the paragraph to update.
        text: New text content. Empty string leaves text unchanged.
        style: New paragraph style name. Empty string leaves style unchanged.
        tracked: If True, wrap old runs in w:del and new text in w:ins.
        author: Author name shown in Word's review pane (tracked=True only).
delete_paragraph tool
Delete the paragraph with the given paraId.

    Args:
        para_id: paraId of the paragraph to remove.
set_paragraph_border tool
Set borders on one or more sides of a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        sides: List of sides: "top", "bottom", "left", "right", "between".
        color: Border color as 6-digit hex (default "000000").
        size: Border width in eighths of a point (default 4 = 0.5pt).
set_paragraph_shading tool
Set background shading on a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        fill_color: Fill color as 6-digit hex (e.g., "FFFF00").
        pattern: Shading pattern (default "clear").
set_paragraph_indentation tool
Set indentation on a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        left_cm: Left indent in centimetres (None = unchanged).
        right_cm: Right indent in centimetres (None = unchanged).
        first_line_cm: First-line indent in cm (mutually exclusive with hanging_cm).
        hanging_cm: Hanging indent in cm (mutually exclusive with first_line_cm).
set_keep_with_next tool
Keep this paragraph on the same page as the next paragraph.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to enable keep-with-next, False to remove it.
set_keep_lines_together tool
Keep all lines of this paragraph on the same page.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to enable keep-lines-together, False to remove it.
set_page_break_before tool
Force a page break before this paragraph.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to force page break before, False to remove it.
set_widow_control tool
Enable widow/orphan control for this paragraph.

    Args:
        para_id: paraId of the target paragraph.
        enabled: True to enable widow control, False to remove it.
insert_blockquote tool
Insert a blockquote paragraph after the given paragraph.

    The new paragraph has 720-twip left indent and italic formatting.

    Args:
        para_id: paraId of the reference paragraph (new para inserted after it).
        text: Text content of the blockquote.
insert_code_block tool
Insert a code-block paragraph after the given paragraph.

    The new paragraph uses Courier New 10pt with light-gray background shading.

    Args:
        para_id: paraId of the reference paragraph (new para inserted after it).
        text: Code text content.
        language: Optional language hint (stored in return value only).
set_line_spacing tool
Set line spacing and paragraph spacing.

    Args:
        para_id: paraId of the target paragraph.
        line_rule: "auto" | "exact" | "atLeast". None leaves unchanged.
        line_value: For "auto": 240=single, 360=1.5x, 480=double. For "exact"/"atLeast": twips.
        space_before_pt: Space before paragraph in points (None = unchanged).
        space_after_pt: Space after paragraph in points (None = unchanged).
get_paragraph_format tool
Read all formatting attributes of a paragraph.

    Returns style, alignment, indentation, line spacing, border, shading, and list info.

    Args:
        para_id: paraId of the target paragraph.
get_runs tool
Get all runs in a paragraph with their formatting properties.

    Args:
        para_id: paraId of the target paragraph.
set_run_font tool
Set the font of a specific run (zero-based index) in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        font_name: Font name (e.g., "Arial", "Times New Roman").
set_run_color tool
Set the font color of a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        color: Hex color without # (e.g., "FF0000").
set_run_size tool
Set the font size of a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        size_pt: Font size in points (e.g., 12.0).
set_character_spacing tool
Set character spacing (tracking) for a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        spacing_pt: Spacing in points (positive = expanded, negative = condensed).
set_character_position tool
Set vertical character position (raised/lowered) for a specific run.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        position_pt: Offset in points (positive = raised, negative = lowered).
set_run_highlight tool
Set highlight color of a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        color: Word highlight color name (e.g., "yellow", "green", "cyan", "none").
set_run_strikethrough tool
Set strikethrough on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        double: False for single strikethrough, True for double strikethrough.
set_run_superscript tool
Set superscript vertical alignment on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
set_run_subscript tool
Set subscript vertical alignment on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
set_run_underline tool
Set underline style on a specific run in a paragraph.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        style: Underline style (e.g., "single", "double", "dotted", "none").
clear_run_formatting tool
Remove all character formatting from a run, causing it to inherit paragraph/style defaults.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
set_run_language tool
Set the language on a run for spell-checking purposes.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        language_code: BCP-47 language code (e.g., "en-US", "fr-FR", "de-DE").
set_text_case tool
Set text case transformation on a run.

    Args:
        para_id: paraId of the target paragraph.
        run_idx: Zero-based index of the run.
        case: "upper" (all caps), "small" (small caps), or "none" (remove case transform).
export_markdown tool
Export the open document as Markdown.

    Converts the document body (headings, bold/italic runs, lists, tables,
    plain paragraphs) to GitHub-Flavoured Markdown and writes it to a file.

    Args:
        output_path: Destination path for the .md file.
            Defaults to <workdir>/export.md when empty.

    Returns: {"output_path": str, "paragraphs": int, "tables": int}
get_theme_colors tool
Return the named color slots from word/theme/theme1.xml.

    Returns a dict mapping slot names (dk1, lt1, accent1, ...) to 6-digit hex strings.
    Returns an empty dict if the document has no theme file.
set_theme_color tool
Update a named color slot in the document theme.

    Args:
        slot: One of dk1, lt1, dk2, lt2, accent1-accent6, hlink, folHlink.
        hex_color: 6-character hex string without # (e.g. "FF0000").
insert_caption tool
Insert a caption paragraph after the specified paragraph.

    Args:
        after_para_id: paraId of the paragraph to insert after.
        text: Caption description text (without label/number prefix).
        label: Caption label, e.g. "Figure" or "Table" (default "Figure").
find_replace_formatted tool
Find all occurrences of a string and replace with formatted text.

    Replaces every occurrence of `find` across all paragraphs in the document
    with `replace`, applying the specified character formatting to the replacement
    run only.

    Args:
        find: Text to search for (must be non-empty).
        replace: Replacement text.
        bold: True to bold, False to explicitly un-bold, None to leave unchanged.
        italic: True to italicise, False to explicitly un-italicise, None to leave unchanged.
        color: Font color as 6-digit hex (e.g. "FF0000"). None leaves color unchanged.
        size_pt: Font size in points (e.g. 12.0). None leaves size unchanged.
split_document tool
Split the open document into multiple DOCX files, one per heading section.

    Args:
        output_dir: Directory for output files. Defaults to <workdir>/split_output.
        at_heading_level: Heading level to split on (default 1).

    Returns: {"output_dir": str, "files": list[str], "parts": int}
get_word_count tool
Return the word count of the open document body.

    Returns: {"word_count": int}
get_statistics tool
Return document statistics for the open document.

    Returns a dict with keys: word_count, character_count, paragraph_count,
    table_count, image_count, section_count.
get_document_outline tool
Return a flat list of headings as a document outline.

    Walks the document body and returns every heading paragraph up to the
    specified level.

    Args:
        max_level: Maximum heading level to include (1–6, default 6).

    Returns:
        JSON list of dicts with keys: level (int), text (str), para_id (str).
set_document_language tool
Set the default document language.

    Writes the BCP-47 language tag into the default paragraph style's run
    properties (``w:rPr/w:lang``) in ``word/styles.xml``.

    Args:
        language_code: BCP-47 language tag, e.g. "en-US", "fr-FR", "de-DE".

    Returns:
        {"language": language_code}
set_track_changes tool
Enable or disable revision tracking in the document.

    When enabled, Word/LibreOffice will record future edits as tracked changes.

    Args:
        enabled: True to enable tracking, False to disable.
        author: Optional author name (stored in response for reference only).

    Returns:
        {"track_changes": bool, "author": str}
split_table tool
Split a table into two tables at the given row index.

    Rows 0..at_row_index-1 remain in the original table; rows
    at_row_index..end move to a new table inserted immediately after.

    Args:
        table_idx: 0-based table index.
        at_row_index: 0-based row index to split at (must be > 0 and < row_count).

    Returns:
        {"table1_rows": int, "table2_rows": int}
duplicate_table_row tool
Deep-copy a table row and insert the copy immediately after it.

    Args:
        table_idx: 0-based table index.
        row_index: 0-based index of the row to duplicate.

    Returns:
        {"row_index": int, "new_row_index": int}
sort_table tool
Sort the non-header rows of a table by the text content of a column.

    Header rows (marked with w:tblHeader) remain at the top. Rows with a
    missing cell at column_index sort as empty string.

    Args:
        table_idx: 0-based table index.
        column_index: 0-based column to sort by.
        ascending: True for A→Z (default), False for Z→A.

    Returns:
        {"sorted_rows": int, "column_index": int, "ascending": bool}
get_table tool
Get structured info for a single table by zero-based index.

    Args:
        table_idx: 0-based table index.

    Returns:
        {"index": int, "row_count": int, "col_count": int, "cells": list[list[str]]}
get_cell_text tool
Return text content of a specific cell.

    Args:
        table_idx: 0-based table index.
        row_idx: 0-based row index.
        col_idx: 0-based column index.

    Returns:
        {"table_index": int, "row_index": int, "col_index": int, "text": str}
copy_table tool
Deep-copy a table and insert the copy immediately after the original.

    Args:
        table_idx: 0-based table index.

    Returns:
        {"source_index": int, "new_index": int}
copy_document tool
Save a complete snapshot of the open document to a new path.

    The active session and source path are unchanged.

    Args:
        output_path: Destination file path (must end in .docx).

    Returns:
        {"copied_to": output_path}
convert_to_pdf tool
Convert the open document to PDF using LibreOffice headless.

    Requires LibreOffice to be installed ('libreoffice' or 'soffice' on PATH).

    Args:
        output_path: Destination path for the output PDF file.

    Returns:
        {"pdf_path": str}
flatten_document tool
Accept all tracked changes and remove all revision markup.

    Accepts every w:ins / w:del and strips all w:rPrChange and w:pPrChange
    elements, leaving plain text with no tracked-change metadata.

    Returns:
        {"changes_accepted": int, "formatting_changes_removed": int}
get_reading_time tool
Estimate reading time for the open document.

    Args:
        words_per_minute: Assumed reading speed (default 200 wpm).

    Returns:
        {"word_count": int, "words_per_minute": int, "minutes": float, "seconds": int}
set_alt_text tool
Set the alt text (and optionally title) on an image by 0-based index.

    Args:
        image_index: 0-based index across all wp:docPr elements in document.xml.
        alt_text: Accessibility description to set on the image.
        title: Optional title attribute; removed from XML if empty.

    Returns:
        {"image_index": int, "alt_text": str}
get_alt_text tool
Get the alt text and title for an image by 0-based index.

    Args:
        image_index: 0-based index across all wp:docPr elements in document.xml.

    Returns:
        {"image_index": int, "alt_text": str, "title": str}
check_accessibility tool
Scan the document for accessibility issues.

    Checks images for missing alt text and tables for missing header rows.

    Returns:
        {"issue_count": int, "issues": list[dict]}
insert_text_box tool
Insert an inline text box after the paragraph with para_id.

    Args:
        para_id: paraId of the reference paragraph (insert after this).
        text: Text content for the text box.
        width_cm: Width in centimetres (default 5.0).
        height_cm: Height in centimetres (default 2.0).

    Returns:
        JSON with para_id (new paragraph), text, width_cm, height_cm.

What we checked

The same checks run on every server. Each line below has one of these marks:

FoundA published issue such as a risky tool or a CVE
PassedWe ran the check on this server and found nothing
After reviewChecked; we publish it once a person verifies it
Partly tracedRan, but the scanner could not follow every path to its end
FactWhat the code does, not a judgement either way
Not checkedThe scanner had nothing to read for it, or it needs the live server
Code Safetypartly traced
  • 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injection
    Checked on every scan. Results in this category are published only after a person has verified them.
Capability Exposure8.3
  • Runs programs the caller chooses
    No tool runs a command or program the caller supplies — 219 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Executes caller-supplied code
    No tool evaluates code the caller supplies — 219 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Reads or writes any file path
    1 finding the scanner could not decide; see the findings below
  • Requests any address
    No tool sends a request to an address the caller supplies — 219 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Runs caller-supplied SQL
    No tool executes a query the caller supplies — 219 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Tools that start processes
    Not seen in the traced code of 219 capabilities; 219 more call code the scanner could not follow, where it may happen
  • Tools that touch files
    4 of 219 capabilities touch files; 215 more call code the scanner could not follow, where it may happen
  • Tools that call the network
    Not seen in the traced code of 219 capabilities; 219 more call code the scanner could not follow, where it may happen
Where the code is: 219 handlers in 1 file at commit 9c0c0b7694d8
Prompt Integrity10.0
  • 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrity
    Checked on every scan. Results in this category are published only after a person has verified them.
Supply Chain1.7
  • Dependency manifests
    1 manifest: pyproject.toml
  • Lockfiles checked against OSV
    1 file resolved and checked against the OSV database; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
  • Known vulnerabilities in production dependencies CRITICAL
    15 production packages with known advisories
  • Known vulnerabilities in other dependencies
    2 packages with advisories used only for development, tests or examples; an install of the server leaves them out
  • MCP SDK version
    mcp >=1.0.0
Secrets & Credentials10.0
  • 3 checks: credential harvesting, undeclared credential access, credentials sent over the network
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tools that read credentials
    Not seen in the traced code of 219 capabilities; 219 more call code the scanner could not follow, where it may happen
  • Authentication declared
    Not checked: needs the live server's tools/list (a remote server declares how clients authenticate)
Behavior Transparency10.0
  • 3 checks: undeclared network access, undeclared file access, undeclared process execution
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tool descriptions present
    Every tool has a description the model and the user can read
  • Statically known names
    Every tool's name could be read from the code
  • Input schemas
    Not checked: needs the live server's tools/list (every tool declares an input schema)
  • Destructive tools annotated
    Not checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)

Dependencies with known vulnerabilities (15 in production)

Dependency ranges were not resolved against a lockfile, so the score is capped at 7.

PackageInstalledWorstAdvisoriesFixed in
pyjwtPyPI 2.12.1 CRITICAL 30 advisories 2.13.02.14.02.15.0
  • CRITICALGHSA-ffc3-869f-jxw9 CVE-2026-102268 PYSEC-2026-4145PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
  • HIGHGHSA-p4g4-x82p-q773 CVE-2026-102271 PYSEC-2026-4149PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
  • HIGHGHSA-pxh4-856f-4h89PyJWT: HS256/384/512 verify accepts empty HMAC key via oct JWK (PyJWK/PyJWKClient) enabling token forgery
  • HIGHGHSA-9v7f-9g4p-ffgj CVE-2026-102267 PYSEC-2026-4144PyJWT: PyJWKClient follows redirects when fetching JWKS
  • HIGHGHSA-xgmm-8j9v-c9wx CVE-2026-48526 PYSEC-2026-179PyJWT: Public-key JWK accepted as HMAC secret enables forged HS256 tokens when mixed families are allowed
  • MEDIUMPYSEC-2026-4146 CVE-2026-103001 GHSA-gvp8-978c-rx2qPyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
  • MEDIUMGHSA-w7vc-732c-9m39 CVE-2026-48525 PYSEC-2026-178PyJWT: Unauthenticated DoS via unbounded Base64URL decoding of unused payload segment in b64=false detached JWS
  • MEDIUMPYSEC-2026-4145 CVE-2026-102268 GHSA-ffc3-869f-jxw9PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
  • MEDIUMGHSA-2gx3-rcp4-g85q CVE-2026-101917 PYSEC-2026-4140PyJWT: PyJWKClient still amplifies unauthenticated JWKS fetches on unknown kid values (incomplete fix of CVE-2026-48524)
  • MEDIUMGHSA-993g-76c3-p5m4 CVE-2026-48522 PYSEC-2026-175PyJWKClient: missing scheme allowlist enables CVE-2024-21643-class SSRF + token forgery via file://, ftp://, data: schemes
  • MEDIUMPYSEC-2026-4152 CVE-2026-102274 GHSA-w6j9-cwv2-h6wqPyJWT: Malformed RSA JWK aborts parsing of an entire JWK Set
  • MEDIUMGHSA-jwrc-g2q2-pq5p CVE-2026-102270 PYSEC-2026-4148PyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
  • MEDIUMPYSEC-2026-175 CVE-2026-48522 GHSA-993g-76c3-p5m4PyJWT is a JSON Web Token implementation in Python. Prior to 2.13.0, PyJWKClient passes its uri argument directly to urllib.request.urlopen() which uses Python stdlib's default OpenerDirector registering HTTPHandler, HTTPSHandler, FTPHandler, FileHandler, and DataHandler. There is currently no documented option to restrict which schemes PyJWKClient will fetch. If an application's jku URL ingestion path accepts attacker-influenced URLs (e.g., from JWT header, configuration file, OAuth flow parameter), the attacker can cause PyJWKClient to read arbitrary local files via file:// (SSRF on local filesystem), cause PyJWKClient to attempt FTP / data-URI fetches (broader SSRF surface), or forge tokens that PyJWT verifies as valid. The library does not directly return non-HTTP(S) URI contents to the attacker; the chained "plant a JWKS to forge tokens" scenario described in the original report requires additional application-layer flaws (attacker write access to a filesystem path, untrusted jku derivation) that this fix does not address. This vulnerability is fixed in 2.13.0.
  • MEDIUMPYSEC-2026-4144 CVE-2026-102267 GHSA-9v7f-9g4p-ffgjPyJWT: PyJWKClient follows redirects when fetching JWKS
  • MEDIUMGHSA-x33g-cr3x-6449 CVE-2026-102275 PYSEC-2026-4183PyJWT accepts inconsistent OKP x/d JWKs, causing public/private key identity confusion
  • MEDIUMPYSEC-2026-4147 CVE-2026-102269 GHSA-hxm8-2xgr-2p9mPyJWT: Non-canonical signature segments enable raw-token revocation bypass
  • MEDIUMPYSEC-2026-4183 CVE-2026-102275 GHSA-x33g-cr3x-6449PyJWT is a Python implementation of JSON Web Token standards. From 2.1.0 until 2.15.0, PyJWT OKPAlgorithm.from_jwk in jwt/algorithms.py is affected because private-JWK import path does not compare the public key derived from d with x. This occurs when an OKP private JWK supplies non-corresponding x and d components. As a result, identity derived from x can differ from operations performed with d. Consequently, if an integration also accepts private key parameters from a proof header without rejecting them, an attacker may use a stolen sender-constrained token without the legitimate private key. This issue is fixed in version 2.15.0.
  • MEDIUMGHSA-gvp8-978c-rx2q CVE-2026-103001 PYSEC-2026-4146PyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
  • MEDIUMPYSEC-2026-4140 CVE-2026-101917 GHSA-2gx3-rcp4-g85qPyJWT: PyJWKClient still amplifies unauthenticated JWKS fetches on unknown kid values (incomplete fix of CVE-2026-48524)
  • MEDIUMPYSEC-2026-4148 CVE-2026-102270 GHSA-jwrc-g2q2-pq5pPyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
  • MEDIUMGHSA-w6j9-cwv2-h6wq CVE-2026-102274 PYSEC-2026-4152PyJWT: Malformed RSA JWK aborts parsing of an entire JWK Set
  • MEDIUMPYSEC-2026-178 CVE-2026-48525 GHSA-w7vc-732c-9m39PyJWT is a JSON Web Token implementation in Python. From 2.8.0 to 2.12.1, when verifying detached JWS tokens using the unencoded-payload option ("b64": false, RFC 7797), PyJWT performs Base64URL decoding of the compact-serialization payload segment before enforcing the detached-payload rules. For b64=false, PyJWT later discards that decoded payload and replaces it with the caller-provided detached_payload. In practice, this turns the middle segment into an attacker-controlled “work amplifier”: a remote client can supply an arbitrarily large Base64URL payload segment that forces CPU work + memory allocations even if the signature is invalid. This creates an unauthenticated DoS vector against any endpoint that verifies detached JWS using PyJWT. This vulnerability is fixed in 2.13.0.
  • MEDIUMGHSA-42vr-xj54-vc7v CVE-2026-101918 PYSEC-2026-4141PyJWT: Unauthenticated RecursionError DoS in pre-verification payload parse (PyJWKClient.get_signing_key_from_jwt / verify_signature=False)
  • MEDIUMPYSEC-2026-4141 CVE-2026-101918 GHSA-42vr-xj54-vc7vPyJWT: Unauthenticated RecursionError DoS in pre-verification payload parse (PyJWKClient.get_signing_key_from_jwt / verify_signature=False)
  • MEDIUMGHSA-jq35-7prp-9v3f CVE-2026-48523 PYSEC-2026-176PyJWT: Algorithm allow-list bypass when decoding with `PyJWK` / `PyJWKClient` keys
  • MEDIUMPYSEC-2026-4149 CVE-2026-102271 GHSA-p4g4-x82p-q773PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
  • MEDIUMPYSEC-2026-177 CVE-2026-48524 GHSA-fhv5-28vv-h8m8PyJWT is a JSON Web Token implementation in Python. Prior to 2.13.0, PyJWKClient.get_signing_key() forces a fresh HTTP request to the JWKS endpoint for every JWT with an unknown kid value, with no rate limiting. Since kid comes from the unverified token header, an attacker can trigger unlimited outbound requests. The vulnerability surfaces only when a JWKS fetch fails; an attacker can attempt to provoke that with sustained unknown-kid traffic, but the outcome depends on upstream JWKS-endpoint behavior (rate limiting, transient errors) which is beyond the attacker's control. This vulnerability is fixed in 2.13.0.
  • MEDIUMGHSA-hxm8-2xgr-2p9m CVE-2026-102269 PYSEC-2026-4147PyJWT: Non-canonical signature segments enable raw-token revocation bypass
  • MEDIUMPYSEC-2026-179 CVE-2026-48526 GHSA-xgmm-8j9v-c9wxPyJWT is a JSON Web Token implementation in Python. Prior to 2.13.0, when the verifier is decoding JSON Web Tokens, while supporting both asymmetric and HMAC algorithms, the library does not validate use of JSON Web Keys in HMAC algorithm, allowing attacker to use the issuer public key as the secret key for HMAC algorithm. This vulnerability is fixed in 2.13.0.
  • LOWGHSA-fhv5-28vv-h8m8 CVE-2026-48524 PYSEC-2026-177PyJWKClient unbounded JWKS endpoint requests via attacker-controlled kid values (DoS)
anyioPyPI 4.12.1 CRITICAL 4 advisories 4.14.2
  • CRITICALGHSA-82r6-8w77-94w6 CVE-2026-63374 PYSEC-2026-4025AnyIO: TLSStream IDNA 2003 host name encoding enables potential TLS certificate spoofing
  • MEDIUMPYSEC-2026-4024 CVE-2026-64847 GHSA-5p39-cfhj-2xmpAnyIO process-pool workers can block indefinitely on undrained stderr
  • MEDIUMPYSEC-2026-4025 CVE-2026-63374 GHSA-82r6-8w77-94w6AnyIO: TLSStream IDNA 2003 host name encoding enables potential TLS certificate spoofing
  • MEDIUMGHSA-5p39-cfhj-2xmp CVE-2026-64847 PYSEC-2026-4024AnyIO process-pool workers can block indefinitely on undrained stderr
certifiPyPI 2026.2.25 CRITICAL 2 advisories 2026.10.18
  • CRITICALGHSA-6q48-6c7w-9gw2 PYSEC-2026-4320certifi bundles emSign root CAs with compromised intermediate CA keys
  • MEDIUMPYSEC-2026-4320 GHSA-6q48-6c7w-9gw2certifi bundles emSign root CAs with compromised intermediate CA keys
mistunePyPI 3.2.0 HIGH 35 advisories 3.2.13.3.03.3.4
  • HIGHGHSA-phmp-hrw4-r36r CVE-2026-97698Mistune: Quadratic-time DoS in parse_link_href via unbounded parenthesis scan on empty-label links
  • HIGHGHSA-ww7q-mxrj-5ffg CVE-2026-97699Mistune: Quadratic-time DoS in inline image parsing (precedence_scan) bypasses not-is-image guards
  • HIGHGHSA-c8j7-8cv4-2xmq CVE-2026-59922 PYSEC-2026-2210Mistune plugins/formatting: quadratic-time parsing on long runs of `~~x~~`, `==x==`, and `^^x^^` markers (strikethrough / mark / insert)
  • HIGHGHSA-8mp2-v27r-99xp CVE-2026-33079 PYSEC-2026-2651Mistune has a ReDoS in LINK_TITLE_RE that allows denial of service via crafted Markdown input
  • HIGHGHSA-ffq3-xpv3-j92q CVE-2026-59928 PYSEC-2026-2216Mistune block_parser: quadratic-time parsing on long lists of repeated reference-link definitions
  • HIGHGHSA-h7ww-273w-6cm8 CVE-2026-115355Mistune: Path Traversal and XSS in Include directive
  • HIGHGHSA-qcq2-496w-v96p CVE-2026-49851 PYSEC-2026-2652 Mistune: Potential DoS via quadratic-time parsing in parse_link_text
  • HIGHGHSA-4j32-57v6-6g45 CVE-2026-59925 PYSEC-2026-2213Mistune inline_parser: quadratic-time parsing on long runs of `**x**` and `***x***` emphasis pairs
  • MEDIUMPYSEC-2026-2206 CVE-2026-44708 GHSA-8g87-j6q8-g93xMistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, the mistune math plugin renders inline math ($...$) and block math ($$...$$) by concatenating the raw user-supplied content directly into the HTML output without any HTML escaping. This occurs even when the parser is explicitly created with escape=True, which is supposed to guarantee that all user-controlled text is sanitised before reaching the DOM. This vulnerability is fixed in 3.2.1.
  • MEDIUMGHSA-ccfx-mfmx-2fx9 CVE-2026-44899 PYSEC-2026-2209Mistune Image Directive CSS Injection Vulnerability
  • MEDIUMPYSEC-2026-2208 CVE-2026-44898 GHSA-6269-cqxg-mhhvMistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_toc_ul() builds a <ul> table-of-contents tree from a list of (level, id, text) tuples. Both the id value (used as href="#<id>") and the text value (used as the visible link label) are inserted into <a> tags via a plain Python format string — with no HTML escaping applied to either value. When heading IDs are derived from user-supplied heading text (the standard use-case for readable slug anchors), an attacker can craft a heading whose text breaks out of the href="#..." attribute context, injecting arbitrary HTML tags including <script> blocks directly into the rendered TOC. This vulnerability is fixed in 3.2.1.
  • MEDIUMPYSEC-2026-2211 CVE-2026-59923 GHSA-8c25-4j27-2rv3Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, HTMLRenderer.safe_url() does not block percent-encoded javascript URIs, allowing attacker-supplied Markdown links or images to bypass URL protections and execute script in rendered HTML. This issue is fixed in version 3.3.0.
  • MEDIUMGHSA-qfrw-5rxm-mhh2 CVE-2026-59929 PYSEC-2026-2217Mistune renderers/html.safe_url: HARMFUL_PROTOCOLS list misses legacy and chained schemes that historically chain to `javascript:` execution
  • MEDIUMPYSEC-2026-2209 CVE-2026-44899 GHSA-ccfx-mfmx-2fx9Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, the Image directive plugin validates the :width: and :height: options with a regex compiled as _num_re = re.compile(r"^\\d+(?:\\.\\d*)?"). When the validated value is not a plain integer, render_block_image() inserts it directly into a style="width:...;" or style="height:...;" attribute. Because the value was accepted by the prefix-only regex, any CSS after the leading digits reaches the style= attribute verbatim and without escaping. This vulnerability is fixed in 3.2.1.
  • MEDIUMGHSA-2hm2-hc3v-44h9 CVE-2026-59930 PYSEC-2026-2218Mistune toc / TableOfContents directive: heading IDs use predictable `toc_N` numbering with no slugification, allowing collision with attacker-controlled `id="toc_N"` content
  • MEDIUMGHSA-8mpj-m6qm-5qr8 CVE-2026-59927 PYSEC-2026-2215Mistune directives/include: mutual `.. include::` recursion crashes the renderer with `RecursionError`, denial of service via two attacker-controlled markdown files
  • MEDIUMGHSA-6269-cqxg-mhhv CVE-2026-44898 PYSEC-2026-2208Mistune TOC Anchor Injection XSS
  • MEDIUMPYSEC-2026-2213 CVE-2026-59925 GHSA-4j32-57v6-6g45Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
  • MEDIUMPYSEC-2026-2214 CVE-2026-59926 GHSA-g97x-gvcm-x72hMistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.
  • MEDIUMPYSEC-2026-2651 CVE-2026-33079 GHSA-8mp2-v27r-99xpMistune has a ReDoS in LINK_TITLE_RE that allows denial of service via crafted Markdown input
  • MEDIUMPYSEC-2026-2212 CVE-2026-59924 GHSA-r4rv-85jg-w4mfMistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, Include.parse() joins and normalizes user-supplied include paths without verifying that the result remains within the intended markdown directory, allowing crafted include paths to access files outside that directory when markdown files are processed using md.read(). This issue is fixed in version 3.3.0.
  • MEDIUMPYSEC-2026-2216 CVE-2026-59928 GHSA-ffq3-xpv3-j92qMistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, a Markdown document containing many repeated or distinct reference-link definitions causes quadratic work in src/mistune/block_parser.py and the ref_links environment dictionary handling, allowing denial of service through CPU exhaustion. This issue is fixed in version 3.3.0.
  • MEDIUMPYSEC-2026-2217 CVE-2026-59929 GHSA-qfrw-5rxm-mhh2Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the safe_url filter in src/mistune/renderers/html.py blocks only javascript:, vbscript:, file:, and data: schemes, allowing legacy or chained schemes such as feed:, view-source:, jar:, livescript:, mocha:, ms-its:, mk:, and res: to reach rendered href and src attributes and potentially execute script in affected user agents. This issue is fixed in version 3.3.0.
  • MEDIUMGHSA-r4rv-85jg-w4mf CVE-2026-59924 PYSEC-2026-2212Mistune: Arbitrary File Read via Include directive path traversal
  • MEDIUMGHSA-v87v-83h2-53w7 CVE-2026-44897 PYSEC-2026-2207Mistune Heading ID Attribute has Injection XSS
  • MEDIUMPYSEC-2026-2218 CVE-2026-59930 GHSA-2hm2-hc3v-44h9Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the toc plugin and TableOfContents directive generate heading IDs as predictable toc_N values without slugifying the heading text, allowing attacker-controlled id="toc_N" content to collide with generated anchors and redirect same-page navigation, CSS selectors, or JavaScript handlers. This issue is fixed in version 3.3.0.
  • MEDIUMGHSA-8g87-j6q8-g93x CVE-2026-44708 PYSEC-2026-2206Mistune Math Plugin has an XSS Escape Bypass
  • MEDIUMPYSEC-2026-2210 CVE-2026-59922 GHSA-c8j7-8cv4-2xmqMistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, a run of closed tilde, equals-sign, or caret marker pairs around a character causes quadratic work in src/mistune/plugins/formatting.py when the strikethrough, mark, or insert plugin scans for matching markers from each possible start position, allowing denial of service through CPU exhaustion. This issue is fixed in version 3.3.0.
  • MEDIUMPYSEC-2026-168 CVE-2026-44896 GHSA-58cw-g322-p94vMistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and realier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer.
  • MEDIUMPYSEC-2026-2207 CVE-2026-44897 GHSA-v87v-83h2-53w7Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, HTMLRenderer.heading() builds the opening <hN> tag by string-concatenating the id attribute value directly into the HTML — with no call to escape(), safe_entity(), or any other sanitisation function. A double-quote character " in the id value terminates the attribute, allowing an attacker to inject arbitrary additional attributes (event handlers, src=, href=, etc.) into the heading element. This vulnerability is fixed in 3.2.1.
  • MEDIUMGHSA-8c25-4j27-2rv3 CVE-2026-59923 PYSEC-2026-2211Mistune: XSS via percent-encoded javascript URI bypass in safe_url()
  • MEDIUMGHSA-g97x-gvcm-x72h CVE-2026-59926 PYSEC-2026-2214Mistune: XSS via unescaped class option in Admonition directive
  • MEDIUMGHSA-58cw-g322-p94v CVE-2026-44896 PYSEC-2026-168Mistune has XSS via unescaped figclass/figwidth in Figure directive
  • MEDIUMPYSEC-2026-2652 CVE-2026-49851 GHSA-qcq2-496w-v96p Mistune: Potential DoS via quadratic-time parsing in parse_link_text
  • MEDIUMPYSEC-2026-2215 CVE-2026-59927 GHSA-8mpj-m6qm-5qr8Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, the Include directive in src/mistune/directives/include.py detects only direct self-includes and not indirect cycles, allowing two markdown files that include each other to trigger unbounded recursion, raise RecursionError, and crash the rendering request. This issue is fixed in version 3.3.0.
python-multipartPyPI 0.0.22 HIGH 12 advisories 0.0.260.0.270.0.30+1 more
  • HIGHGHSA-5rvq-cxj2-64vf CVE-2026-53539 PYSEC-2026-3036python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service
  • HIGHGHSA-pp6c-gr5w-3c5g CVE-2026-42561 PYSEC-2026-3039python-multipart has Denial of Service via unbounded multipart part headers
  • MEDIUMPYSEC-2026-3040 CVE-2026-53540 GHSA-v9pg-7xvm-68hfpython-multipart: Negative Content-Length in parse_form buffers the entire body in memory
  • MEDIUMGHSA-mj87-hwqh-73pj CVE-2026-40347 PYSEC-2026-3038python-multipart affected by Denial of Service via large multipart preamble or epilogue data
  • MEDIUMPYSEC-2026-3037 CVE-2026-53538 GHSA-6jv3-5f52-599mpython-multipart: Semicolon treated as querystring field separator enables parameter smuggling
  • MEDIUMPYSEC-2026-3039 CVE-2026-42561 GHSA-pp6c-gr5w-3c5gpython-multipart has Denial of Service via unbounded multipart part headers
  • MEDIUMPYSEC-2026-3041 CVE-2026-53537 GHSA-vffw-93wf-4j4qpython-multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters
  • MEDIUMPYSEC-2026-3036 CVE-2026-53539 GHSA-5rvq-cxj2-64vfpython-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service
  • MEDIUMPYSEC-2026-3038 CVE-2026-40347 GHSA-mj87-hwqh-73pjpython-multipart affected by Denial of Service via large multipart preamble or epilogue data
  • LOWGHSA-v9pg-7xvm-68hf CVE-2026-53540 PYSEC-2026-3040python-multipart: Negative Content-Length in parse_form buffers the entire body in memory
  • LOWGHSA-6jv3-5f52-599m CVE-2026-53538 PYSEC-2026-3037python-multipart: Semicolon treated as querystring field separator enables parameter smuggling
  • LOWGHSA-vffw-93wf-4j4q CVE-2026-53537 PYSEC-2026-3041python-multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters
cryptographyPyPI 46.0.5 HIGH 11 advisories 46.0.646.0.748.0.1+2 more
  • HIGHGHSA-jwv3-5hgf-82ww CVE-2026-69249 PYSEC-2026-3553python-cryptography: Duplicate self-signed intermediates can cause exponential path-building
  • HIGHGHSA-537c-gmf6-5ccfVulnerable OpenSSL included in cryptography wheels
  • HIGHGHSA-g6cj-pr64-35w5 CVE-2026-69247 PYSEC-2026-3552cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
  • MEDIUMPYSEC-2026-35 CVE-2026-34073 GHSA-m959-cc7f-wv43cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Prior to version 46.0.6, DNS name constraints were only validated against SANs within child certificates, and not the "peer name" presented during each validation. Consequently, cryptography would allow a peer named bar.example.com to validate against a wildcard leaf certificate for *.example.com, even if the leaf's parent certificate (or upwards) contained an excluded subtree constraint for bar.example.com. This issue has been patched in version 46.0.6.
  • MEDIUMPYSEC-2026-36 CVE-2026-39892 GHSA-p423-j2cm-9vmqcryptography is a package designed to expose cryptographic primitives and recipes to Python developers. From 45.0.0 to before 46.0.7, if a non-contiguous buffer was passed to APIs which accepted Python buffers (e.g. Hash.update()), this could lead to buffer overflows. This vulnerability is fixed in 46.0.7.
  • MEDIUMPYSEC-2026-3554 CVE-2026-69248 GHSA-m2h6-j472-rp4cpython-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees
  • MEDIUMGHSA-m2h6-j472-rp4c CVE-2026-69248 PYSEC-2026-3554python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees
  • MEDIUMGHSA-p423-j2cm-9vmq CVE-2026-39892 PYSEC-2026-36Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs
  • MEDIUMPYSEC-2026-3552 CVE-2026-69247 GHSA-g6cj-pr64-35w5cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
  • MEDIUMPYSEC-2026-3553 CVE-2026-69249 GHSA-jwv3-5hgf-82wwpython-cryptography: Duplicate self-signed intermediates can cause exponential path-building
  • LOWGHSA-m959-cc7f-wv43 CVE-2026-34073 PYSEC-2026-35cryptography has incomplete DNS name constraint enforcement on peer names
mcpPyPI 1.26.0 HIGH 11 advisories 1.27.21.28.11.30.0+1 more
  • HIGHGHSA-jpw9-pfvf-9f58 CVE-2026-52869 PYSEC-2026-3482MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal
  • HIGHGHSA-qx49-fqc8-xw99 CVE-2026-115563Model Context Protocol Python SDK: OAuth client could send credentials to an authorization server chosen by the MCP server
  • HIGHGHSA-hvrp-rf83-w775 CVE-2026-52870 PYSEC-2026-3481MCP Python SDK: Experimental task handlers allow any client to access and cancel other clients' tasks
  • HIGHGHSA-vj7q-gjh5-988w CVE-2026-59950 PYSEC-2026-3483MCP Python SDK: WebSocket server transport does not support Host/Origin validation
  • MEDIUMGHSA-w4fh-qvv9-3v23 CVE-2026-116684Model Context Protocol Python SDK: Server bearer-token authentication accepts tokens issued for a different resource server
  • MEDIUMPYSEC-2026-3483 CVE-2026-59950 GHSA-vj7q-gjh5-988wMCP Python SDK: WebSocket server transport does not support Host/Origin validation
  • MEDIUMPYSEC-2026-3482 CVE-2026-52869 GHSA-jpw9-pfvf-9f58MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal
  • MEDIUMGHSA-rwrf-2pqf-9j8j CVE-2026-116686Model Context Protocol Python SDK: Client fetched server-chosen $ref URLs while validating tool results against output schemas
  • MEDIUMGHSA-5h93-6whr-6q8j CVE-2026-116685Model Context Protocol Python SDK: HTTP client transports followed cross-origin redirects carrying custom headers and bodies
  • MEDIUMGHSA-84m7-p3x7-pcfv CVE-2026-59951MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion
  • MEDIUMPYSEC-2026-3481 CVE-2026-52870 GHSA-hvrp-rf83-w775MCP Python SDK: Experimental task handlers allow any client to access and cancel other clients' tasks
starlettePyPI 0.52.1 HIGH 10 advisories 1.0.11.1.01.3.0+1 more
  • HIGHGHSA-82w8-qh3p-5jfq CVE-2026-54283 PYSEC-2026-249Starlette: request.form() limits silently ignored for application/x-www-form-urlencoded enable DoS
  • HIGHGHSA-wqp7-x3pw-xc5r CVE-2026-48818 PYSEC-2026-2281Starlette: SSRF and NTLM credential theft via UNC paths in StaticFiles on Windows
  • MEDIUMPYSEC-2026-2281 CVE-2026-48818 GHSA-wqp7-x3pw-xc5rStarlette is a lightweight ASGI framework/toolkit. In versions 1.0.1 and earlier, StaticFiles on Windows is vulnerable to SSRF. An UNC path such as \\\\attacker.com\\share can cause os.path.realpath to initiate an outbound SMB connection before the path is rejected, exposing the service account’s NTLMv2 credentials for offline cracking or relay even though the HTTP response is only a 404. The issue affects default follow_symlink=False deployments, including frameworks built on Starlette such as FastAPI; POSIX systems and follow_symlink=True are unaffected. The issue is fixed in 1.1.0.
  • MEDIUMPYSEC-2026-249 CVE-2026-54283 GHSA-82w8-qh3p-5jfqStarlette is a lightweight ASGI framework/toolkit. From 0.4.1 until 1.3.1, request.form() accepts max_fields and max_part_size to bound resource consumption while parsing form data. These limits are enforced for multipart/form-data, but silently ignored for application/x-www-form-urlencoded. An unauthenticated attacker can therefore send a urlencoded body with an arbitrarily large number of fields or an arbitrarily large field, even when the application configured limits it believed would apply. This vulnerability is fixed in 1.3.1.
  • MEDIUMPYSEC-2026-248 CVE-2026-54282 GHSA-jp82-jpqv-5vv3Starlette is a lightweight ASGI framework/toolkit. Prior to 1.3.0, the HTTP request path is not validated before being used to reconstruct request.url. Because request.url is rebuilt by concatenating {scheme}://{host}{path} and re-parsing the result, a path that does not begin with / (for example @google.com) moves the authority boundary during re-parsing, so request.url.hostname and request.url.netloc become attacker-controlled. Code that reads request.url.hostname (rather than the Host header or scope) can therefore be misled into trusting an attacker-supplied host. This vulnerability is fixed in 1.3.0.
  • MEDIUMPYSEC-2026-161 CVE-2026-48710 GHSA-86qp-5c8j-p5mr X41-2026-002BadHost: Missing Host header validation poisons request.url.path, bypassing path-based security checks
  • MEDIUMGHSA-x746-7m8f-x49c CVE-2026-48817 PYSEC-2026-2280Starlette: Arbitrary HTTP method dispatched to `HTTPEndpoint` attributes via `getattr`
  • MEDIUMPYSEC-2026-2280 CVE-2026-48817 GHSA-x746-7m8f-x49cStarlette is a lightweight ASGI framework/toolkit. In versions 1.0.1 and below, when dispatching a request, HTTPEndpoint selects the handler by lowercasing the HTTP method and looking it up as an attribute with getattr, without restricting the lookup to a known set of HTTP verbs. When an HTTPEndpoint subclass is registered through Route(...) without an explicit methods= argument, the route does not constrain the method and every method reaches the endpoint. If a non-standard HTTP method whose lowercased name matches an attribute on the endpoint subclass reaches the endpoint, that attribute is invoked as if it were a request handler. An attacker can use this to reach methods that were never meant to be HTTP handlers, such as internal helpers, without the authorization checks applied by the intended public handler. An application (including Starlette-based frameworks like FastAPI) is affected if it registers an HTTPEndpoint subclass via Route(...) without explicitly setting methods=, and that subclass includes extra methods named like non-standard HTTP verbs that take one request argument and return a response. This issue has been fixed in version 1.1.0.
  • MEDIUMGHSA-86qp-5c8j-p5mr CVE-2026-48710 PYSEC-2026-161 X41-2026-002Starlette has missing Host header validation that poisons request.url.path, bypassing path-based security checks
  • LOWGHSA-jp82-jpqv-5vv3 CVE-2026-54282 PYSEC-2026-248Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname
filelockPyPI 3.25.2 HIGH 9 advisories 4.0.94.2.1
  • HIGHGHSA-v4x8-3wr5-3wq8 CVE-2026-112940filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock user's process overwrite or unlink its own files
  • MEDIUMGHSA-fq56-3cx3-fjxp CVE-2026-112935filelock: SoftFileLock stale-lock break removes a live lock file on a reused inode number and admits two holders
  • MEDIUMGHSA-cwqr-hh33-gh44 CVE-2026-112915filelock ReadWriteLock: a crafted lock database makes every acquire stall or hang regardless of timeout
  • MEDIUMGHSA-8mx5-7m5m-r77g CVE-2026-112910filelock: WindowsFileLock ignores mode: a 0o600 lock file and the ReadWriteLock database inherit the directory ACL
  • MEDIUMGHSA-rfpc-qcw5-3pc4 CVE-2026-112939filelock: SoftFileLock removes a live holder's marker when another user forges the PID in a writable marker
  • MEDIUMGHSA-69hj-f68j-2879 CVE-2026-112909filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path
  • MEDIUMGHSA-j8f7-rjxc-mr56 CVE-2026-112936filelock: ReadWriteLock follows a symlink at the lock path into SQLite
  • LOWGHSA-9vhv-jxww-xfm5 CVE-2026-112913filelock: ReadWriteLock on Windows acts on SQLite side files another local user places beside its database
  • LOWGHSA-567q-5qvw-pf92 CVE-2026-112907filelock: On Windows an oplock on a soft lock's marker holds SoftFileLock.acquire() past its timeout and blocks the stale break
urllib3PyPI 2.7.0 HIGH 6 advisories 2.8.0
  • HIGHGHSA-8988-9cw3-xx77 CVE-2026-97687 PYSEC-2026-4175urllib3: HTTPS proxy TLS configuration may be ignored or overridden
  • HIGHGHSA-vxq7-64xx-v4gw CVE-2026-97689 PYSEC-2026-4177urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
  • MEDIUMGHSA-gh4c-6fx4-qh6g CVE-2026-97688 PYSEC-2026-4176urllib3: Chunked Deflate streaming can enter an infinite loop
  • MEDIUMPYSEC-2026-4177 CVE-2026-97689 GHSA-vxq7-64xx-v4gwurllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
  • MEDIUMPYSEC-2026-4176 CVE-2026-97688 GHSA-gh4c-6fx4-qh6gurllib3: Chunked Deflate streaming can enter an infinite loop
  • MEDIUMPYSEC-2026-4175 CVE-2026-97687 GHSA-8988-9cw3-xx77urllib3: HTTPS proxy TLS configuration may be ignored or overridden
lxmlPyPI 6.0.2 HIGH 2 advisories 6.1.0
  • HIGHGHSA-vfmq-68hx-4jfw CVE-2026-41066 PYSEC-2026-87lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE to local files
  • MEDIUMPYSEC-2026-87 CVE-2026-41066 GHSA-vfmq-68hx-4jfwlxml is a library for processing XML and HTML in the Python language. Prior to 6.1.0, using either of the two parsers in the default configuration (with resolve_entities=True) allows untrusted XML input to read local files. Setting the resolve_entities option explicitly to resolve_entities='internal' or resolve_entities=False disables the local file access. This vulnerability is fixed in 6.1.0.
setuptoolsPyPI 82.0.1 MEDIUM 3 advisories 83.0.084.1.0
  • MEDIUMPYSEC-2026-3447 BIT-setuptools-2026-59890 CVE-2026-59890 GHSA-h35f-9h28-mq5csetuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. Prior to 83.0.0, FileList applied MANIFEST.in exclude, global-exclude, recursive-exclude, and prune directives by matching compiled glob patterns against on-disk file names without Unicode normalization, so on macOS APFS or HFS+ an NFD file name could bypass an NFC exclusion rule and be packed into a source distribution. This issue is fixed in version 83.0.0.
  • MEDIUMGHSA-h35f-9h28-mq5c BIT-setuptools-2026-59890 CVE-2026-59890 PYSEC-2026-3447setuptools: MANIFEST.in exclusion bypass in sdist via Unicode normalization collision (NFC/NFD) on macOS APFS/HFS+
  • LOWGHSA-xmj3-9gf7-h52wsetuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description
idnaPyPI 3.11 MEDIUM 2 advisories 3.15
  • MEDIUMGHSA-65pc-fj4g-8rjx CVE-2026-45409 PYSEC-2026-215Internationalized Domain Names in Applications (IDNA): Specially crafted inputs to idna.encode() can bypass CVE-2024-3651 fix
  • MEDIUMPYSEC-2026-215 CVE-2026-45409 GHSA-65pc-fj4g-8rjxInternationalized Domain Names in Applications (IDNA) for Python provides support for Internationalized Domain Names in Applications (IDNA) and Unicode IDNA Compatibility Processing. In versions prior to 3.15, payloads such as `"\\u0660" * N` or `"\\u30fb" * N + "\\u6f22"` utilize the `valid_contexto` function prior to length rejection, and for high values of `N` will take a long time to process. This is the same issue as CVE-2024-3651, however the original remediation in 2024 was not a complete fix. A specially crafted argument to the `idna.encode()` function could consume significant resources. This may lead to a denial-of-service. Starting in version 3.14, the function rejects long inputs as soon as practicable prior to any further processing to minimize resource consumption. In version 3.15, this approach was extended to lesser used alternate functions (i.e. per-label conversions and codec support). A workaround is available. Domain names cannot exceed 253 characters in length. If this length limit is enforced prior to passing the domain to the `idna.encode()` function, it should no longer consume significant resources. This is triggered by arbitrarily large inputs that would not occur in normal usage, but may be passed to the library assuming there is no preliminary input validation by the higher-level application.
pygmentsPyPI 2.19.2 MEDIUM 2 advisories 2.20.0
  • MEDIUMPYSEC-2026-2987 CVE-2026-4539 GHSA-5239-wwwm-4pmqPygments has Regular Expression Denial of Service (ReDoS) due to Inefficient Regex for GUID Matching
  • LOWGHSA-5239-wwwm-4pmq CVE-2026-4539 PYSEC-2026-2987Pygments has Regular Expression Denial of Service (ReDoS) due to Inefficient Regex for GUID Matching
pydantic-settingsPyPI 2.13.1 MEDIUM 1 advisory 2.14.2
  • MEDIUMGHSA-4xgf-cpjx-pc3j CVE-2026-58203pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and bypassing secrets_dir_max_size
2 vulnerable packages outside the server itself (used only for development, tests or examples, not shipped)
PackageInstalledWorstAdvisoriesFixed in
virtualenvPyPI 21.2.0 HIGH 35 advisories 21.7.1121.7.1221.7.13+5 more
  • HIGHGHSA-p58f-9548-mpm2 BIT-virtualenv-2026-102925 CVE-2026-102925 PYSEC-2026-4013virtualenv bash and fish activation scripts execute commands embedded in paths
  • HIGHGHSA-5vjq-rrrf-7h2q BIT-virtualenv-2026-113726 CVE-2026-113726 PYSEC-2026-4385virtualenv activate runs commands from the environment name in zsh with PROMPT_SUBST
  • HIGHGHSA-8rjx-v5ww-45pp BIT-virtualenv-2026-113776 CVE-2026-113776 PYSEC-2026-4387virtualenv activation scripts run code from a path that contains a placeholder name
  • HIGHGHSA-c978-59m8-c77v BIT-virtualenv-2026-113722 CVE-2026-113722 PYSEC-2026-4381virtualenv: Generated POSIX console launchers interpret destination paths as shell syntax
  • HIGHGHSA-c947-3pg5-gm8q BIT-virtualenv-2026-113732 CVE-2026-113732 PYSEC-2026-4386virtualenv activate.fish runs commands from a path or prompt with a backslash before a quote
  • HIGHGHSA-6w3r-xr62-4xcp BIT-virtualenv-2026-113723 CVE-2026-113723 PYSEC-2026-4382virtualenv: Bash prompt values can change meaning under older compatibility modes
  • HIGHGHSA-vxj4-q4g9-crj7 BIT-virtualenv-2026-113725 CVE-2026-113725 PYSEC-2026-4384virtualenv bash activate runs commands from an environment name with a backslash before $
  • HIGHGHSA-94p9-xgh2-xp45 BIT-virtualenv-2026-102930 CVE-2026-102930 PYSEC-2026-4011virtualenv: Downloaded seed wheels (pip/setuptools) are not integrity-checked before use
  • HIGHGHSA-394h-qwmc-48pf BIT-virtualenv-2026-113718 CVE-2026-113718 PYSEC-2026-4377virtualenv: Xonsh activation literals depend on the script decoding codec
  • HIGHGHSA-x78j-v8h9-3j2q BIT-virtualenv-2026-102937 CVE-2026-102937 PYSEC-2026-4014virtualenv: Command injection via --prompt in activate.bat (batch activator)
  • MEDIUMPYSEC-2026-4386 BIT-virtualenv-2026-113732 CVE-2026-113732 GHSA-c947-3pg5-gm8qvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.2, FishActivator inherits ViaTemplateActivator.quote(), which uses POSIX shlex.quote() even though fish interprets backslashes and single quotes differently. An attacker-influenced environment path, --prompt, or VIRTUALENV_PROMPT value containing a backslash before a quote can therefore terminate the generated fish literal and execute command substitution when the user sources activate.fish. This issue is fixed in version 21.14.2.
  • MEDIUMPYSEC-2026-4013 BIT-virtualenv-2026-102925 CVE-2026-102925 GHSA-p58f-9548-mpm2virtualenv bash and fish activation scripts execute commands embedded in paths
  • MEDIUMPYSEC-2026-4375 BIT-virtualenv-2026-113716 CVE-2026-113716 GHSA-cw65-gx24-rc82virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the builtin creator calls ensure_dir() for executable, library, and package directories, and ensure_dir() accepts an existing symlink to a directory because exists() follows it. Interpreter creation, seed installation, and activation generation then write through the linked parent outside the requested destination when another local account prepared the tree and the invoking user can access the target. The --clear option removes the planted tree first, while ordinary creation reaches it; arbitrary attacker-selected output bytes are not established. This issue is fixed in version 21.14.9.
  • MEDIUMPYSEC-2026-4011 BIT-virtualenv-2026-102930 CVE-2026-102930 GHSA-94p9-xgh2-xp45Downloaded seed wheels (pip/setuptools) are not integrity-checked before use
  • MEDIUMPYSEC-2026-4380 BIT-virtualenv-2026-113721 CVE-2026-113721 GHSA-558c-9hv2-4prjvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, ViaTemplateActivator._generate() removes an existing output only when Path.exists() is true, allowing a dangling symlink to survive and redirect generated activation content, while PyEnvCfg.write() opens pyvenv.cfg without first replacing an existing symbolic or hard link. Another local account that prepares final entries inside the destination can therefore cause environment creation to create or overwrite files outside the requested tree with constrained virtualenv-generated content and the invoking user's permissions. The destination parent must remain controlled by the environment owner during creation; concurrent parent-directory replacement is a separate concern. This issue is fixed in version 21.14.9.
  • MEDIUMGHSA-cw65-gx24-rc82 BIT-virtualenv-2026-113716 CVE-2026-113716 PYSEC-2026-4375virtualenv: Builtin creation follows linked environment directories
  • MEDIUMGHSA-hhxq-47xx-j5xx BIT-virtualenv-2026-113719 CVE-2026-113719 PYSEC-2026-4378virtualenv: Seed replacement does not contain metadata deletion paths
  • MEDIUMPYSEC-2026-4014 BIT-virtualenv-2026-102937 CVE-2026-102937 GHSA-x78j-v8h9-3j2qCommand injection via --prompt in activate.bat (batch activator)
  • MEDIUMPYSEC-2026-4378 BIT-virtualenv-2026-113719 CVE-2026-113719 GHSA-hhxq-47xx-j5xxvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, PipInstall._uninstall_previous_version() accepts existing seed-package metadata and _uninstall_dist() joins entries from top_level.txt and RECORD to site-packages without checking containment. When a reused destination contains distribution metadata influenced by another account, relative traversal, absolute entries, or linked parents can cause app-data reseeding to delete files outside the environment or the environment root with the invoking user's permissions, provided that user has deletion rights over the named paths. The deletion occurs during environment creation before any later use of the environment. Fresh environments without existing package metadata and creation with --clear do not enter this cleanup path. This issue is fixed in version 21.14.9.
  • MEDIUMGHSA-9h9j-4vrj-gf7g BIT-virtualenv-2026-102938 CVE-2026-102938 PYSEC-2026-4012virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
  • MEDIUMPYSEC-2026-4387 BIT-virtualenv-2026-113776 CVE-2026-113776 GHSA-8rjx-v5ww-45ppvirtualenv is a tool for creating isolated virtual python environments. From 20.26.6 until 21.14.2, ViaTemplateActivator.instantiate_template() replaces placeholders one key at a time across the complete activation template, so trigger names such as __VIRTUAL_NAME__, __VIRTUAL_ENV__, or __VIRTUAL_PROMPT__ inside an already substituted and quoted environment path or prompt can be replaced during a later pass. The later value's quoting can close the earlier literal and execute the remaining path when a user activates the environment through bash, fish, xonsh, or activate_this.py. The distinct csh prompt-display token __VIRTUAL_PROMPT_DISPLAY_TCSH__ can instead break the generated script without establishing command execution. The attacker must influence the destination path or --prompt, and a value without a relevant placeholder name does not trigger this mechanism. This issue is fixed in version 21.14.2.
  • MEDIUMPYSEC-2026-4381 BIT-virtualenv-2026-113722 CVE-2026-113722 GHSA-c978-59m8-c77vvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. When the path contains a space or produces a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks. An attacker who influences the environment destination can therefore execute commands with the user's privileges when the user later runs a generated launcher; environment creation and activation do not trigger the command. Existing launchers are not repaired by upgrading virtualenv alone and must be regenerated, while a later independent pip installation or upgrade can reintroduce an affected launcher because pip's vendored distlib is unchanged. The virtualenv fix is released in version 21.14.9.
  • MEDIUMGHSA-fc2g-4w5p-6whm BIT-virtualenv-2026-113720 CVE-2026-113720 PYSEC-2026-4379virtualenv: Seeded files retain permissions from an older cache
  • MEDIUMGHSA-558c-9hv2-4prj BIT-virtualenv-2026-113721 CVE-2026-113721 PYSEC-2026-4380virtualenv: Generated files can follow existing destination links
  • MEDIUMPYSEC-2026-4379 BIT-virtualenv-2026-113720 CVE-2026-113720 GHSA-fc2g-4w5p-6whmvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the app-data copy seeder uses shutil.copy() to copy cached package files into later environments, causing cached source modes to override the current run's umask. A cache populated under a permissive umask can therefore produce files writable by another local account in a later traversable environment, allowing package code such as pip/__init__.py to be modified and executed by the environment owner. The attacker cannot force the earlier umask, and a private destination parent prevents access. This issue is fixed in version 21.14.9.
  • MEDIUMPYSEC-2026-4372 BIT-virtualenv-2026-113713 CVE-2026-113713 GHSA-4f8h-vr72-p32cvirtualenv is a tool for creating isolated virtual python environments. From 21.14.8 until 21.14.10, the app-data seeder can leave an environment linked to temporary package files that virtualenv deletes when creation finishes. The environment-variable and configuration-file forms of symlink_app_data can enable this state even though the command-line flag is disabled for temporary app-data. The resulting environment depends on a cache pathname that its owner no longer controls. This issue is fixed in version 21.14.10.
  • MEDIUMPYSEC-2026-4384 BIT-virtualenv-2026-113725 CVE-2026-113725 GHSA-vxj4-q4g9-crj7virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \\$(...) runs as commands in the user's shell each time bash draws the prompt. This issue is fixed in version 21.14.7.
  • MEDIUMPYSEC-2026-4382 BIT-virtualenv-2026-113723 CVE-2026-113723 GHSA-6w3r-xr62-4xcpvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, caller-supplied prompt text can become executable syntax in the bash activation prompt. An attacker must influence the value passed to virtualenv, and a user must subsequently activate the environment and draw the prompt. This vulnerability is fixed in 21.14.9.
  • MEDIUMPYSEC-2026-4385 BIT-virtualenv-2026-113726 CVE-2026-113726 GHSA-5vjq-rrrf-7h2qvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.13.0, the bash activate script that zsh also sources leaves the environment name unescaped; from 21.13.0 until 21.14.4, it escapes backslashes, dollar signs, and backticks only when BASH_VERSION is set, so zsh receives the raw value. The script assigns that value to PS1. In zsh with PROMPT_SUBST, an attacker-influenced environment directory, --prompt, or VIRTUALENV_PROMPT value containing command, parameter, or arithmetic expansion syntax can therefore execute commands in the user's shell each time the prompt is drawn. A percent sign is separately interpreted as a zsh prompt escape but does not by itself execute commands. Plain zsh with PROMPT_SUBST disabled and bash are not affected by this mechanism. This issue is fixed in version 21.14.4.
  • MEDIUMPYSEC-2026-4374 BIT-virtualenv-2026-113715 CVE-2026-113715 GHSA-qmx5-4p3x-wvqfvirtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the stdlib venv creator reads generated pyvenv.cfg with str.splitlines() and merges parsed keys over virtualenv's selected configuration. An untrusted caller who influences the destination pathname can include a line-boundary character such as U+2028 to inject keys including home and include-system-site-packages, causing path data to change configuration structure before final output. Setting include-system-site-packages to true weakens environment isolation, while an altered home can change which standard-library files the interpreter loads if the attacker also controls that location. The builtin creator does not use this readback path. This issue is fixed in version 21.14.9.
  • MEDIUMPYSEC-2026-4012 BIT-virtualenv-2026-102938 CVE-2026-102938 GHSA-9h9j-4vrj-gf7gvirtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
  • MEDIUMGHSA-43mp-35q3-x3fq BIT-virtualenv-2026-113724 CVE-2026-113724 PYSEC-2026-4383virtualenv: Deletion recovery can change a symlink target's mode
  • LOWGHSA-cx28-75q4-x26q BIT-virtualenv-2026-113717 CVE-2026-113717 PYSEC-2026-4376virtualenv: Pip seeding with download omits wheel digest verification
  • LOWGHSA-494p-63j8-28p3 BIT-virtualenv-2026-113714 CVE-2026-113714 PYSEC-2026-4373virtualenv: Downloaded wheel selection and caching precede verification
  • LOWGHSA-qmx5-4p3x-wvqf BIT-virtualenv-2026-113715 CVE-2026-113715 PYSEC-2026-4374virtualenv: Venv configuration readback can reinterpret path boundaries
pytestPyPI 9.0.2 MEDIUM 2 advisories 9.0.3
  • MEDIUMPYSEC-2026-1845 CVE-2025-71176 GHSA-6w46-j5rx-g56gpytest has vulnerable tmpdir handling
  • MEDIUMGHSA-6w46-j5rx-g56g CVE-2025-71176 PYSEC-2026-1845pytest has vulnerable tmpdir handling

Past security advisories

Vulnerabilities published for this server itself, from the GitHub Advisory Database.

No security advisories have been published for this server in the GitHub Advisory Database.

How it runs

Where it runsOn your machine, started by your MCP client from this repository or its package
Transportstdio
Sign-innot checked needs the live server
MCP SDKmcp >=1.0.0
Servers in the code1 (docx-mcp)

The project's own security

Security policynone no SECURITY.md in the repository: report issues privately through GitHub if it is enabled
Past advisoriesnone in the GitHub Advisory Database
Last push2026-08-05
Signed releasesnot checked yet

Where it is published

Listed in4 catalogs (github_search, glama, mcp_toplist, mcpservers_org)
LicenseMIT
Created2026-03-22
Topicsai-tools comments document-editing docx footnotes mcp mcp-server model-context-protocol ooxml track-changes

Attack map

How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.

Request a scan or an audit

Tell us about your server. We reply within 5 working days.

What do you need? *

We use these details only to answer you.