A Model Context Protocol server providing tools to read/write docx files
Project description
MCP Server Office
A Model Context Protocol (MCP) server providing tools to read/write Microsoft Word (docx) files.
Usage
Install with pip:
pip install mcp-server-office
Then, start the MCP server:
mcp-server-office
Or using uv, just:
uvx mcp-server-office
Available Tools
-
read_docx: Read complete contents of a docx file including tables and images.- Input:
path(string) - Absolute path to the target file - Note: Images are converted to [Image] placeholders, and track changes are not shown
- Input:
-
write_docx: Create a new docx file with given content.- Input:
path(string) - Absolute path to target filecontent(string) - Content to write to the file
- Note: Use double line breaks for new paragraphs, and [Table] tag with | separators for tables
- Input:
-
edit_docx_paragraph: Make text replacements in specified paragraphs of a docx file.- Input:
path(string) - Absolute path to file to editedits(array) - List of dictionaries containing search/replace text and paragraph indexparagraph_index(number) - 0-based index of the paragraph to editsearch(string) - Text to find within the specified paragraphreplace(string) - Text to replace with
- Note: Each search string must match exactly once within the specified paragraph
- Input:
-
edit_docx_insert: Insert new paragraphs into a docx file.- Input:
path(string) - Absolute path to file to editinserts(array) - List of dictionaries containing text and optional paragraph indextext(string) - Text to insert as a new paragraphparagraph_index(number, optional) - 0-based index of the paragraph before which to insert. If not specified, insert at the end.
- Input:
Requirements
- Python >= 3.12
- Dependencies:
- mcp[cli] >= 1.2.0
- python-docx >= 1.1.2
MCP Server Office (日本語)
Microsoft Word (docx) ファイルの読み書きを提供するModel Context Protocol (MCP) サーバーです。
使用方法
pipを使用してインストール:
pip install mcp-server-office
MCPサーバーの起動:
mcp-server-office
または、uvを使う場合:
uvx mcp-server-office
利用可能なツール
-
read_docx: docxファイルの内容を表やイメージを含めて完全に読み取ります。- 入力:
path(文字列) - 対象ファイルの絶対パス - 注意: 画像は[Image]というプレースホルダーに変換され、変更履歴は表示されません
- 入力:
-
write_docx: 新しいdocxファイルを指定された内容で作成します。- 入力:
path(文字列) - 作成するファイルの絶対パスcontent(文字列) - ファイルに書き込む内容
- 注意: 段落は2つの改行で区切り、表は[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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_office-0.2.0.tar.gz.
File metadata
- Download URL: mcp_server_office-0.2.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e74b08900e45bc9161e334b0a242b1a46e8ec41c9447ee8a3edc540059ff4846
|
|
| MD5 |
1f72b474071069f3a5a2d2550da3ba76
|
|
| BLAKE2b-256 |
8f03d01ca8b93eefda41781b7a9a063560c80409599cfd15eb3e7162feea8eb1
|
File details
Details for the file mcp_server_office-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_server_office-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bc91f79761f4988941bdcd0e498ff8986258d79ff2334138eec8c2109b743bc
|
|
| MD5 |
cc2957d415f62532586a5db8d585330a
|
|
| BLAKE2b-256 |
16f83ae7e742839c7cdd6b26c6bb02ff3727e2c36764865f896767b58f203292
|