FM

famano/mcp-server-office

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

39 stars 12 forks 质量 53 趋势 12MIT

famano/mcp-server-office 是从 https://github.com/famano/mcp-server-office. 导入的 MCP 服务器候选

概览

famano/mcp-server-office 是从 https://github.com/famano/mcp-server-office. 导入的 MCP 服务器候选

概述(AI 翻译)

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

通过Smithery安装

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

用途

使用PIP安装:

然后,启动MCP服务器:

或者用紫外线,直接:

可用工具

  1. read_docx:读取文档文件的完整内容,包括表格和图片。
  • 输入:path(字符串)- 目标文件的绝对路径
  • 注意:图片已转换为[图片]占位符,且不显示曲目更改
  1. write_docx:创建一个包含给定内容的新docx文件。
  • 输入:
  • path(字符串)- 目标文件的绝对路径
  • content(字符串)- 写入文件的内容
  • 注意:新段落使用双倍换行符,并使用 [Table] 标签 |表格的分隔符
  1. edit_docx_paragraph:在docx文件的指定段落中进行文本替换。
  • 输入:
  • path(字符串)- 文件的绝对路径以编辑
  • edits(数组)- 包含搜索/替换文本和段落索引的词典列表
  • paragraph_index(编号)- 段落的基于0的索引,需编辑
  • search(字符串)- 在指定段落内查找的文本

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Server Office

A Model Context Protocol (MCP) server providing tools to read/write Microsoft Word (docx) files.

Installing via Smithery

To install Server Office for Claude Desktop automatically via Smithery:

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

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

  1. 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
  2. write_docx: Create a new docx file with given content.

    • Input:
      • path (string) - Absolute path to target file
      • content (string) - Content to write to the file
    • Note: Use double line breaks for new paragraphs, and [Table] tag with | separators for tables
  3. edit_docx_paragraph: Make text replacements in specified paragraphs of a docx file.

    • Input:
      • path (string) - Absolute path to 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
    • Note: Each search string must match exactly once within the specified paragraph
  4. edit_docx_insert: Insert new paragraphs into a docx file.

    • Input:
      • path (string) - Absolute path to 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, insert at the end.

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) サーバーです。

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 (文字列) - 対象ファイルの絶対パス
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @famano/mcp-server-office --client claude
新手?先看 mcpskill.org 教程 →