MCP 服务器办公室
模型上下文协议 (MCP) 服务器提供读取/写入 Microsoft Word (docx) 文件的工具。
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Server Office:
用法
使用 pip 安装:
然后,启动 MCP 服务器:
或者使用 uv,只需:
可用工具
read_docx:读取 docx 文件的完整内容,包括表格和图像。输入:
path(字符串)-目标文件的绝对路径注意:图像将转换为 [图像] 占位符,并且不会显示修订记录
write_docx:创建一个具有给定内容的新 docx 文件。输入:
path(字符串)- 目标文件的绝对路径content(字符串)- 写入文件的内容
注意:新段落使用双行换行,[Table] 标签使用 |表格分隔符
edit_docx_paragraph:在 docx 文件的指定段落中进行文本替换。输入:
path(字符串) - 要编辑的文件的绝对路径edits(数组) - 包含搜索/替换文本和段落索引的字典列表paragraph_index(数字) - 要编辑的段落的从 0 开始的索引search(字符串) - 在指定段落中查找的文本replace(字符串)-要替换的文本
注意:每个搜索字符串必须在指定段落内匹配一次
edit_docx_insert:将新段落插入 docx 文件。输入:
path(字符串) - 要编辑的文件的绝对路径inserts(数组) - 包含文本和可选段落索引的字典列表text(字符串) - 作为新段落插入的文本paragraph_index(数字,可选) - 插入段落的基于 0 的索引。如果没有指定,则插入到末尾。
要求
Python >= 3.12
依赖项:
mcp[cli] >= 1.2.0
python-docx >= 1.1.2
MCP 服务器办公室(日语)
提供读取和写入 Microsoft Word (docx) 文件的模型上下文协议 (MCP) 服务器。
Smithery 安装
要通过Smithery在 Claude Desktop 上自动安装 Server Office:
如何使用
使用 pip 安装:
启动 MCP 服务器:
或者,使用 uv:
可用工具
read_docx:读取 docx 文件的完整内容,包括表格和图像。输入:
path(字符串)-目标文件的绝对路径注意:图像将转换为名为 [图像] 的占位符,并且不会显示修订历史记录。
write_docx:创建具有指定内容的新 docx 文件。输入:
path(字符串) - 要创建的文件的绝对路径。content(字符串) - 要写入文件的内容
注意:段落之间用两个换行符分隔,表格使用[Table]标签和|分隔符
edit_docx_paragraph:替换 docx 文件中指定段落的文本。输入:
path(字符串) - 要编辑的文件的绝对路径。edits(数组) - 包含搜索/替换文本和段落索引的字典列表paragraph_index(数字)——要编辑的段落的从 0 开始的索引。search(字符串)– 在指定段落中搜索的文本。replace(字符串)——替换文本。
注意:每个搜索字符串在给定的段落中必须匹配一次。
edit_docx_insert:在 docx 文件中插入新段落。输入:
path(字符串) - 要编辑的文件的绝对路径。inserts(数组) - 包含文本和可选段落索引的字典列表。text(字符串) – 作为新段落插入的文本paragraph_index(数字,可选) - 要插入的段落的从 0 开始的索引。如果没有指定,它将被插入到最后。
要求
Python >= 3.12
依赖包:
mcp[cli] >= 1.2.0
python-docx >= 1.1.2
local-only server
The server can only run on the client's local machine because it depends on local resources.
通过模型上下文协议提供读取、写入和编辑 Microsoft Word(docx)文件的工具的服务器,允许执行完整文档读取、内容创建、段落目标编辑和文本插入等操作。
Related Resources
Related MCP Servers
- -security-license-qualityA server that provides document processing capabilities using the Model Context Protocol, allowing conversion of documents to markdown, extraction of tables, and processing of document images.Last updated -18MIT License
- Asecurity-licenseAqualityA Model Context Protocol server that enables AI assistants to create, read, edit, and format Microsoft Word documents through standardized tools and resources.Last updated -54862MIT License
- -security-license-qualityA TypeScript-based document processing server that supports various document formats (.docx, .pdf, .xlsx) and integrates with Model Context Protocol SDK for efficient document context management.Last updated -9941MIT License
- Asecurity-licenseAqualityA Model Context Protocol server that integrates with Microsoft's Edit tool, allowing AI systems to perform file operations from simple reads/writes to complex code editing and refactoring.Last updated -93MIT License