npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mammoth-mcp

v1.1.1

Published

MCP for mammoth - Convert DOCX files to HTML

Readme

mammoth-mcp

NPM version NPM downloads

A Model Context Protocol (MCP) server for converting DOCX files to HTML using mammoth.js.

Features

  • convert_docx_to_html: Convert DOCX files to clean HTML with advanced styling options
  • convert_docx_to_html_with_images: Convert DOCX files to HTML with embedded base64 images
  • extract_raw_text: Extract plain text content from DOCX files
  • convert_docx_to_markdown: Convert DOCX files to Markdown format

Installation

$ pnpm install

Development

$ npm run dev
$ npm run build

Usage

Configure MCP Client

Add the server to your MCP client configuration (e.g., Claude Desktop).

The configuration file is located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Option 1: Using npx (Recommended)

This will automatically install and run the latest version:

{
  "mcpServers": {
    "mammoth": {
      "command": "npx",
      "args": ["-y", "mammoth-mcp"]
    }
  }
}

Option 2: Using local installation

If you've cloned the repository locally:

{
  "mcpServers": {
    "mammoth": {
      "command": "node",
      "args": ["/absolute/path/to/mammoth-mcp/dist/esm/index.js"]
    }
  }
}

After updating the configuration, restart Claude Desktop for the changes to take effect.

Available Tools

convert_docx_to_html

Convert a DOCX file to HTML.

Parameters:

  • filePath (string, required): Absolute path to the DOCX file
  • styleMap (string, optional): Custom style map to control Word styles to HTML conversion
  • ignoreEmptyParagraphs (boolean, optional): Whether to ignore empty paragraphs (default: true)
  • idPrefix (string, optional): Prefix for generated IDs (bookmarks, footnotes, endnotes)
  • includeDefaultStyleMap (boolean, optional): Whether to include default style map (default: true)
  • includeEmbeddedStyleMap (boolean, optional): Whether to include embedded style map from document (default: true)

Example:

{
  "filePath": "/path/to/document.docx",
  "styleMap": "p[style-name='Section Title'] => h1:fresh\nb[style-name='Emphasis'] => em",
  "ignoreEmptyParagraphs": false,
  "idPrefix": "doc-"
}

convert_docx_to_html_with_images

Convert a DOCX file to HTML with images embedded as base64 data URIs.

Parameters:

  • filePath (string, required): Absolute path to the DOCX file
  • styleMap (string, optional): Custom style map to control Word styles to HTML conversion
  • ignoreEmptyParagraphs (boolean, optional): Whether to ignore empty paragraphs (default: true)
  • idPrefix (string, optional): Prefix for generated IDs (bookmarks, footnotes, endnotes)
  • includeDefaultStyleMap (boolean, optional): Whether to include default style map (default: true)
  • includeEmbeddedStyleMap (boolean, optional): Whether to include embedded style map from document (default: true)

Example:

{
  "filePath": "/path/to/document-with-images.docx",
  "styleMap": "p[style-name='Code'] => pre:separator('\\n')"
}

extract_raw_text

Extract raw text from a DOCX file, ignoring all formatting. Useful for indexing, search, or text analysis.

Parameters:

  • filePath (string, required): Absolute path to the DOCX file

Example:

{
  "filePath": "/path/to/document.docx"
}

convert_docx_to_markdown

Convert a DOCX file to Markdown format. Note: This feature is deprecated by mammoth.js but remains functional.

Parameters:

  • filePath (string, required): Absolute path to the DOCX file
  • styleMap (string, optional): Custom style map to control Word styles to Markdown conversion
  • ignoreEmptyParagraphs (boolean, optional): Whether to ignore empty paragraphs (default: true)
  • idPrefix (string, optional): Prefix for generated IDs (bookmarks, footnotes, endnotes)
  • includeDefaultStyleMap (boolean, optional): Whether to include default style map (default: true)
  • includeEmbeddedStyleMap (boolean, optional): Whether to include embedded style map from document (default: true)

Example:

{
  "filePath": "/path/to/document.docx",
  "styleMap": "p[style-name='Heading 1'] => # "
}

How It Works

This MCP server uses mammoth.js to convert DOCX documents to clean, semantic HTML or Markdown. The conversion preserves:

  • Headings
  • Paragraphs
  • Lists
  • Tables
  • Bold/italic/underline formatting
  • Images (when using the with_images variant)
  • Custom style mappings (via styleMap parameter)

Style Maps

Style maps allow you to control how Word styles are converted to HTML/Markdown. Each line in a style map represents a mapping from a Word style to an HTML/Markdown element.

Example style map:

p[style-name='Section Title'] => h1:fresh
p[style-name='Subsection Title'] => h2:fresh
p[style-name='Code'] => pre:separator('\n')

For more information on style maps, see the mammoth.js documentation.

LICENSE

MIT