Office-Word-MCP

Office-Word-MCP

A Model Context Protocol server for enterprise-grade document automation, enabling AI assistants to create, read, manipulate, and analyze Microsoft Word documents programmatically.

Category
访问服务器

README

Office-Word-MCP

License Python smithery badge

Enterprise-Grade Document Automation Protocol for Amazon Q & Kiro

Overview

Office-Word-MCP is a robust Model Context Protocol (MCP) server designed to enable advanced document processing capabilities for AI assistants like Amazon Q Developer, Kiro, and other MCP-compliant clients.

It provides a standardized interface for AI agents to programmatic create, read, manipulate, and analyze Microsoft Word documents (.docx). By abstracting complex document object models into clean API tools, it empowers AI assistants to generate professional reports, contracts, and documentation workflows autonomously.

Key Benefits

  • Seamless Integration: Optimized for Amazon Q and Kiro environments.
  • Rich Formatting: Support for complex tables, styling, and layout controls.
  • Enterprise Ready: Includes document protection, comment analysis, and structured data handling.
  • Secure: Runs locally with explicit permission controls.

Architecture

Architecture

Features

1. Document Management

  • Lifecycle Control: Create, copy, merge, and convert documents (to PDF).
  • Structure Analysis: Extract outlines, metadata, and statistics.
  • Security: Apply password protection and manage restricted editing.

2. Content Engineering

  • Advanced Tables: Create complex layouts with merges, shading, and custom borders.
  • Rich Text: precision control over fonts, colors, and paragraph styles.
  • Media: Insert images with proportional scaling.
  • Dynamic Lists: XML-compliant bulleted and numbered lists.

3. Review & Collaboration

  • Comment Mining: Extract and filter comments by author or content.
  • Track Changes: (Future roadmap) Support for revision tracking.

Getting Started

Prerequisites

  • Python 3.10 or higher
  • uv (recommended) or pip package manager

Installation

Option 1: Using uvx (Recommended for ephemeral use)

No installation required. You can run the server directly using uvx.

uvx --from office-word-mcp-server word_mcp_server

Option 2: Local Installation

Clone the repository and install dependencies:

git clone https://github.com/GongRzhe/Office-Word-MCP-Server.git
cd Office-Word-MCP-Server
pip install -r requirements.txt

Integration Guide

Amazon Q Developer (VS Code / JetBrains)

To integrate Office-Word-MCP with Amazon Q Developer:

  1. Open your IDE settings and navigate to Amazon Q > MCP Servers.
  2. Add a new server configuration:
    • Name: word-automation
    • Command: uvx
    • Args: --from, office-word-mcp-server, word_mcp_server
  3. Restart your IDE. Amazon Q will now have access to Word tools.

Kiro

Configure the server in your Kiro settings or configuration file:

{
  "mcpServers": {
    "office-word": {
      "command": "uvx",
      "args": ["--from", "office-word-mcp-server", "word_mcp_server"]
    }
  }
}

Other MCP Clients (Claude Desktop, etc.)

Add the following to your MCP configuration file (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "word-server": {
      "command": "uvx",
      "args": ["--from", "office-word-mcp-server", "word_mcp_server"]
    }
  }
}

API Reference

The server exposes the following tools to the AI assistant.

Core Operations

Tool Name Description
create_document Create a new blank or template-based document.
get_document_text Extract all text content from a file.
list_available_documents Scan directory for valid Word files.
convert_to_pdf Export .docx to PDF format.

Content & Formatting

Tool Name Description
add_heading Insert structured headings (Levels 1-9).
add_paragraph Add text blocks with style support.
add_table Create a new table structure.
format_text Apply bold, italic, color, etc., to text ranges.

Table Management

Tool Name Description
format_table Apply styles, borders, and shading to tables.
merge_table_cells Merge cells horizontally or vertically.
set_table_column_width Precise control over column dimensions.

(See full tool list in word_mcp_server.py source)

Troubleshooting

Common Issues

Permission Denied

  • Cause: The server cannot access the file system.
  • Fix: Ensure the running process has R/W access to the target directory. On Windows, ensure the file isn't open in Microsoft Word.

Styling Not Applied

  • Cause: Using a style name that doesn't exist in the base template.
  • Fix: Use create_custom_style to define the style before using it, or use standard Word styles (e.g., "Normal", "Heading 1").

Image Insertion Failures

  • Cause: Relative paths may be ambiguous.
  • Fix: Always use absolute paths for images.

Debugging

Set the MCP_DEBUG environment variable to 1 to enable verbose logging:

# Windows (PowerShell)
$env:MCP_DEBUG = "1"

License

This project is licensed under the MIT License. See LICENSE for details.


Built for the Agentic Era.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选