MO

mhackermsft/officemcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

6 stars 5 forks 品質 53 トレンド 14

MCP server to create and read Office documents

概要

A Model Context Protocol (MCP) server that enables AI assistants to create, read, write, and manipulate Microsoft Office documents (Word, Excel, PowerPoint) and PDFs directly from natural language instructions. - — unified office_* API works across all supported formats - — granular word_*, excel_*, and pptx_* tools for advanced operations - — write Word/PDF content using plain Markdown - — perform multiple document operations in a single tool call - — create, read, watermark, and extract pages from PDFs - — detection and support for protected Office files - — tiered tool exposure keeps context lean - — embed images in Word, PowerPoint, and Excel documents - — extract all embedded images from Word, PowerPoint, and PDF files as base64 data with MIME type for direct AI vision analysis (OCR, captioning) - — office_read on .docx returns an ordered content list of headings, paragraphs, tables, and inline images in document sequence, preserving section context around every image - .

README

以下は原文 README の抜粋です。原文を見る。

OfficeMCP

A Model Context Protocol (MCP) server that enables AI assistants to create, read, write, and manipulate Microsoft Office documents (Word, Excel, PowerPoint) and PDFs directly from natural language instructions.

Features

  • Format-agnostic tools — unified office_* API works across all supported formats
  • Format-specific tools — granular word_*, excel_*, and pptx_* tools for advanced operations
  • Markdown support — write Word/PDF content using plain Markdown
  • Batch operations — perform multiple document operations in a single tool call
  • PDF support — create, read, watermark, and extract pages from PDFs
  • Encrypted document handling — detection and support for protected Office files
  • Progressive tool disclosure — tiered tool exposure keeps context lean
  • Image creation — embed images in Word, PowerPoint, and Excel documents
  • Image extraction — extract all embedded images from Word, PowerPoint, and PDF files as base64 data with MIME type for direct AI vision analysis (OCR, captioning)
  • Rich document reading — office_read on .docx returns an ordered content list of headings, paragraphs, tables, and inline images in document sequence, preserving section context around every image

Supported Formats

Format Extension Read Write Create Convert
Word .docx ✅ ✅ ✅ ✅
Excel .xlsx ✅ ✅ ✅ —
PowerPoint .pptx ✅ ✅ ✅ —
PDF .pdf ✅ ✅ ✅ ✅
Markdown .md — — — ✅

Prerequisites

  • .NET 10 SDK
  • An MCP-compatible client (e.g., Claude Desktop, VS Code with Copilot)

Building

git clone https://github.com/your-org/OfficeMCP.git
cd OfficeMCP
dotnet build

Running

dotnet run --project OfficeMCP/OfficeMCP.csproj

The server communicates over stdio using the MCP protocol.

MCP Client Configuration

Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "OfficeMCP": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "C:/path/to/OfficeMCP/OfficeMCP/OfficeMCP.csproj"
      ]
    }
  }
}

Or point to the compiled binary directly for faster startup:

{
  "mcpServers": {
    "OfficeMCP": {
      "command": "C:/path/to/OfficeMCP/OfficeMCP/bin/Release/net10.0/OfficeMCP.exe"
    }
  }
}

Available Tools

Consolidated Office Tools (format-agnostic)

These tools work across all supported formats and are organized into three tiers.

Tier 1 — Core (always exposed)

Tool Description
office_create Create a new document in any supported format
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "OfficeMCP": { "command": "dotnet", "args": [ "run", "--project", "C:/path/to/OfficeMCP/OfficeMCP/OfficeMCP.csproj" ] } } }