docx.sh exposes the same engine over MCP and REST. Authenticate with a Bearer token — generate one in Agents after signing up.

Authentication

Header
Authorization: Bearer <token>
REST base URL
https://docx.sh/api/v1
MCP endpoint
https://docx.sh/mcp

Reference

MCP tools map 1:1 to REST endpoints. Pick the transport that fits your agent or backend.

Connect via Agents setup (Cursor, Claude Code, Codex). Each tool call counts toward your monthly MCP/API limit except HTML/DOCX downloads.

Example MCP config

Project-level config — treat tokens like secrets.

{
  "mcpServers": {
    "docxtohtml": {
      "url": "https://docx.sh/mcp",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

upload_docx

Upload a DOCX file for conversion or modification.

Params: filename (string), content_base64 (string)

Returns: Document metadata with id and status.

convert_docx

Convert an uploaded document to HTML preview and full HTML.

Params: document_id (string)

Returns: Updated document with preview_path and html_download_path.

modify_docx

Apply structured element operations and return a new derived document as DOCX or HTML.

Params: document_id (string), output_format (docx|html), operations (array of replace, insert_paragraph, replace_paragraph, delete_paragraph, set_cell_text, add_comment, …)

Returns: New child document; source document stays unchanged.

get_docx_content

Inspect elements for editing: paragraph or run anchors, table coordinates, optional comments and tracked changes.

Params: document_id (string), at? (string), limit? (integer), offset? (integer), mode? (paragraphs|runs), include? (comments, revisions)

Returns: Paginated lines with path, wt:N, kind, table coords; optional comments/revisions.

list_documents

List your active (non-expired) documents.

Params:

Returns: Array of document metadata.

get_document

Get document metadata and authorized download paths.

Params: document_id (string), include_preview? (boolean)

Returns: Full document object.

get_html

Get HTML metadata for a document (use API paths to download bodies).

Params: document_id (string), format? (preview|html|both)

Returns: Paths and sizes for preview and/or full HTML.

delete_document

Delete a document and its generated files.

Params: document_id (string)

Returns: Confirmation with deleted id.