Skip to main content
Glama

MCP 服务器办公室

锻造徽章

模型上下文协议 (MCP) 服务器提供读取/写入 Microsoft Word (docx) 文件的工具。

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Server Office:

npx -y @smithery/cli install @famano/mcp-server-office --client claude

用法

使用 pip 安装:

pip install mcp-server-office

然后,启动 MCP 服务器:

mcp-server-office

或者使用 uv,只需:

uvx mcp-server-office

可用工具

  1. read_docx :读取 docx 文件的完整内容,包括表格和图像。

    • 输入: path (字符串)-目标文件的绝对路径

    • 注意:图像将转换为 [图像] 占位符,并且不会显示修订记录

  2. write_docx :创建一个具有给定内容的新 docx 文件。

    • 输入:

      • path (字符串)- 目标文件的绝对路径

      • content (字符串)- 写入文件的内容

    • 注意:新段落使用双行换行,[Table] 标签使用 |表格分隔符

  3. edit_docx_paragraph :在 docx 文件的指定段落中进行文本替换。

    • 输入:

      • path (字符串) - 要编辑的文件的绝对路径

      • edits (数组) - 包含搜索/替换文本和段落索引的字典列表

        • paragraph_index (数字) - 要编辑的段落的从 0 开始的索引

        • search (字符串) - 在指定段落中查找的文本

        • replace (字符串)-要替换的文本

    • 注意:每个搜索字符串必须在指定段落内匹配一次

  4. edit_docx_insert :将新段落插入 docx 文件。

    • 输入:

      • path (字符串) - 要编辑的文件的绝对路径

      • inserts (数组) - 包含文本和可选段落索引的字典列表

        • text (字符串) - 作为新段落插入的文本

        • paragraph_index (数字,可选) - 插入段落的基于 0 的索引。如果没有指定,则插入到末尾。

Related MCP server: DOCX MCP Server

要求

  • Python >= 3.12

  • 依赖项:

    • mcp[cli] >= 1.2.0

    • python-docx >= 1.1.2


MCP 服务器办公室(日语)

锻造徽章

提供读取和写入 Microsoft Word (docx) 文件的模型上下文协议 (MCP) 服务器。

Smithery 安装

要通过Smithery在 Claude Desktop 上自动安装 Server Office:

npx -y @smithery/cli install @famano/mcp-server-office --client claude

如何使用

使用 pip 安装:

pip install mcp-server-office

启动 MCP 服务器:

mcp-server-office

或者,使用 uv:

uvx mcp-server-office

可用工具

  1. read_docx :读取 docx 文件的完整内容,包括表格和图像。

    • 输入: path (字符串)-目标文件的绝对路径

    • 注意:图像将转换为名为 [图像] 的占位符,并且不会显示修订历史记录。

  2. write_docx :创建具有指定内容的新 docx 文件。

    • 输入:

      • path (字符串) - 要创建的文件的绝对路径。

      • content (字符串) - 要写入文件的内容

    • 注意:段落之间用两个换行符分隔,表格使用[Table]标签和|分隔符

  3. edit_docx_paragraph :替换 docx 文件中指定段落的文本。

    • 输入:

      • path (字符串) - 要编辑的文件的绝对路径。

      • edits (数组) - 包含搜索/替换文本和段落索引的字典列表

        • paragraph_index (数字)——要编辑的段落的从 0 开始的索引。

        • search (字符串)– 在指定段落中搜索的文本。

        • replace (字符串)——替换文本。

    • 注意:每个搜索字符串在给定的段落中必须匹配一次。

  4. edit_docx_insert :在 docx 文件中插入新段落。

    • 输入:

      • path (字符串) - 要编辑的文件的绝对路径。

      • inserts (数组) - 包含文本和可选段落索引的字典列表。

        • text (字符串) – 作为新段落插入的文本

        • paragraph_index (数字,可选) - 要插入的段落的从 0 开始的索引。如果没有指定,它将被插入到最后。

要求

  • Python >= 3.12

  • 依赖包:

    • mcp[cli] >= 1.2.0

    • python-docx >= 1.1.2

Available Tools

4 tools
edit_docx_insertA

Insert new paragraphs into a docx file. Accepts a list of inserts with text and optional paragraph index. Each insert creates a new paragraph at the specified position. If paragraph_index is not specified, the paragraph is added at the end. When multiple inserts target the same paragraph_index, they are inserted in order. Returns a git-style diff showing the changes made.

NameRequiredDescriptionDefault
pathYesAbsolute path to file to edit. It should be under your current working directory.
insertsYesSequence of paragraphs to insert.
edit_docx_paragraphA

Make text replacements in specified paragraphs of a docx file. Accepts a list of edits with paragraph index and search/replace pairs. Each edit operates on a single paragraph and preserves the formatting of the first run. Returns a git-style diff showing the changes made. Only works within allowed directories.

NameRequiredDescriptionDefault
pathYesAbsolute path to file to edit. It should be under your current working directory.
editsYesSequence of edits to apply to specific paragraphs.
read_docxA

Read complete contents of a docx file including tables and images.Use this tool when you want to read file endswith '.docx'.Paragraphs are separated with two line breaks.This tool convert images into placeholder [Image].'--- Paragraph [number] ---' is indicator of each paragraph.

NameRequiredDescriptionDefault
pathYesAbsolute path to target file
write_docxA

Create a new docx file with given content.Editing exisiting docx file with this tool is not recomended.

NameRequiredDescriptionDefault
pathYesAbsolute path to target file. It should be under your current working directory.
contentYesContent to write to the file. Two line breaks in content represent new paragraph.Table should starts with [Table], and separated with '|'.Escape line break when you input multiple lines.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • Addededit_docx_insert
    • Addededit_docx_paragraph
    • Addedread_docx
    • Addedwrite_docx

TDQS

A4.2/5.0

Scored across 4 tools

Disambiguation4/5

The tools are mostly distinct: read_docx for reading, write_docx for creation, and two edit tools for modifications. However, edit_docx_insert and edit_docx_paragraph could be confused as both handle docx editing with paragraph indices, though their specific purposes (inserting vs. replacing text) are clarified in descriptions.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores, using clear verbs like read, write, and edit. The naming is predictable and uniform across all four tools, making them easy to distinguish and use.

Tool Count5/5

With 4 tools, this server is well-scoped for basic docx file operations, covering reading, writing, and editing. Each tool has a clear purpose, and the count is appropriate for the domain without being too sparse or bloated.

Completeness4/5

The tool set provides good coverage for docx file handling, including read, write, and edit functions. A minor gap exists in editing tables or images, as the tools focus on text paragraphs, but core workflows are adequately supported for typical document tasks.

Maintenance

ActivityNo data
ResponsivenessOutdated data

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    A comprehensive Model Context Protocol server that processes Microsoft Word documents with full formatting support, enabling text extraction, HTML/Markdown conversion, structure analysis, and image extraction.
    5
    2
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A Python server implementing Model Context Protocol for advanced Microsoft Word document manipulation, enabling programmatic automation of complex document processing tasks.
    -
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server for reading, editing, and validating Microsoft Word documents with specialized support for track changes, comments, and footnotes. It enables structural auditing, heading extraction, and precise OOXML-level document manipulation through natural language tools.
    10
    100
    1,113 PyPI
    67
    MIT