famano_mcp_server_office

famano_mcp_server_office

by famano
An MCP server for reading, writing, and editing Microsoft Word (docx) files with Python.

Microsoft Word Document Processing MCP Server

Overview

The Microsoft Word Document Processing MCP Server is a Model Context Protocol (MCP) server designed to provide tools for reading and writing Microsoft Word (docx) files. This server is particularly useful for developers who need to automate document processing tasks, such as extracting content, creating new documents, or editing existing ones programmatically.

Installation

To install the server, use pip:

pip install mcp-server-office

Alternatively, you can use uv for installation:

uvx mcp-server-office

Usage

Start the MCP server by running the following command:

mcp-server-office

Available Tools

The server provides the following tools for working with docx files:

  1. read_docx
    Reads the complete contents of a docx file, including tables and images.
  2. Input: path (string) - Absolute path to the target file.
  3. Note: Images are converted to [Image] placeholders, and track changes are not shown.

  4. write_docx
    Creates a new docx file with the given content.

  5. Input:
    • path (string) - Absolute path to the target file.
    • content (string) - Content to write to the file.
  6. Note: Use double line breaks for new paragraphs and [Table] tags with | separators for tables.

  7. edit_docx_paragraph
    Makes text replacements in specified paragraphs of a docx file.

  8. Input:
    • path (string) - Absolute path to the file to edit.
    • edits (array) - List of dictionaries containing search/replace text and paragraph index.
    • paragraph_index (number) - 0-based index of the paragraph to edit.
    • search (string) - Text to find within the specified paragraph.
    • replace (string) - Text to replace with.
  9. Note: Each search string must match exactly once within the specified paragraph.

  10. edit_docx_insert
    Inserts new paragraphs into a docx file.

  11. Input:
    • path (string) - Absolute path to the file to edit.
    • inserts (array) - List of dictionaries containing text and optional paragraph index.
    • text (string) - Text to insert as a new paragraph.
    • paragraph_index (number, optional) - 0-based index of the paragraph before which to insert. If not specified, the text is inserted at the end.

Requirements

  • Python: >= 3.12
  • Dependencies:
  • mcp[cli] >= 1.2.0
  • python-docx >= 1.1.2

License

This project is licensed under the MIT License. For more details, see the LICENSE file.

Resources

Contributors

Languages

  • Python: 100.0%

For more information, visit the GitHub repository.

Features & Capabilities

Categories
mcp_server model_context_protocol python docx document_processing api_integration

Implementation Details

Stats

0 Views
3 GitHub Stars

Repository Info

famano Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300