MCP ExplorerExplorer

Word Mcp Server

@KS-GEN-AIon a year ago
1 MIT
FreeCommunity
AI Systems
TypeScript MCP Server for editing Word files and converting to PDF.

Overview

What is Word Mcp Server

The word-mcp-server is a TypeScript-based MCP server designed for interacting with Microsoft Word (.docx) files. It provides tools for reading, modifying, and converting Word files to PDF while maintaining precise formatting.

Use cases

Use cases include automating the generation of reports in Word format, bulk editing of documents, converting Word files to PDF for distribution, and managing document workflows in organizations.

How to use

To use the word-mcp-server, install the Node.js dependencies with ‘npm install’. Ensure LibreOffice is installed for PDF conversion. Utilize the provided tools to list files, read content, replace words, delete files, and convert Word documents to PDF.

Key features

Key features include: listing files in a folder, reading Word content, replacing words in Word files, deleting Word files, and converting Word documents to PDF with full formatting using LibreOffice.

Where to use

The word-mcp-server can be used in various fields such as document management systems, automated reporting tools, and any application requiring manipulation of Word documents and conversion to PDF.

Content

Word Editing MCP Server

This server provides tools for interacting with Microsoft Word (.docx) files and converting them to PDF with precise formatting.

This is a TypeScript-based MCP server that provides tools to interact with Word files. It demonstrates core MCP concepts by providing:

  • Tools for reading, modifying, and deleting Word files
  • Tools for converting Word files to PDF (with full formatting)
  • All file and folder operations now work directly with absolute or relative paths (relative to the process current working directory). There is no longer any concept of a pre-selected working folder.

Features

Word Tools

list_files_in_folder

  • Purpose: List files in a given folder.
  • Parameters: folderPath (optional, absolute or relative path to the folder; if omitted, uses the current working directory).

read_word_content

  • Purpose: Read the text content of a Word (.docx) file.
  • Parameters: filePath (absolute or relative path to the .docx file).

replace_word_words

  • Purpose: Replace words in a Word (.docx) file and save as a new file.
  • Parameters:
    • filePath (input file, absolute or relative path)
    • outputFilePath (output file, absolute or relative path)
    • replacements (array of {from, to})

delete_word_file

  • Purpose: Delete a Word (.docx) file.
  • Parameters: filePath (absolute or relative path to the .docx file).

word_to_pdf

  • Purpose: Convert a Word (.docx) file to PDF, preserving all formatting and images. Requires LibreOffice installed.
  • Parameters:
    • filePath (input .docx, absolute or relative path)
    • outputFilePath (output .pdf, absolute or relative path)
  • Note: This uses LibreOffice in headless mode for professional-quality conversion. If LibreOffice is not installed, see the installation section below.

Installation complète

Installe les dépendances Node.js :

npm install

Installe LibreOffice (pour la conversion Word → PDF) :

npm run install-libreoffice

Compile le serveur :

npm run build

Pour le développement avec auto-rebuild :

npm run watch

Utilisation avec Claude Desktop

Ajoute la config suivante dans :

Sur MacOS : ~/Library/Application Support/Claude/claude_desktop_config.json
Sur Windows : %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "Word Editing Server": {
      "command": "node",
      "args": [
        "/PATH_TO_THE_PROJECT/build/index.js"
      ],
      "env": {}
    }
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers