SKILLful MCP Docx Processor

SKILLful MCP Docx Processor

A Word document processing MCP server that exposes a single tool (docx_process) routing to 63 operations covering creation, editing, formatting, and querying, with on-demand skill loading for context efficiency.

Category
访问服务器

README

<div align="center">

SKILLful MCP Docx Processor

English | 中文

A Word document processing service based on FastMCP and python-docx, exposing a single gateway tool (docx_process) that routes to 63 operations, covering the full document lifecycle: creation, editing, formatting, and querying.

Designed for seamless integration with Claude Code via the MCP protocol and Claude's skill system.

</div>


Features

Category Count Description
Document Management 7 Create, open, save, save-as, copy, close, reload
Content Addition 8 Paragraphs, headings, tables, lists, images, page breaks, sections, TOC
Content Editing 9 Search, replace, preview, section replace, keyword edit, delete
Table Operations 8 Rows, columns, merge/split cells, borders, shading
Formatting 20 Page layout, paragraph, text, styles, hyperlinks
Style Management 3 Create, modify, list styles
Annotations & References 8 Bookmarks, comments, footnotes, endnotes, queries
Total 63

Requirements

  • Python >= 3.10
  • uv package manager

Installation

# Clone the repository
git clone https://github.com/Zeke-777/SKILLful-mcp-docx-processor.git
cd SKILLful-mcp-docx-processor

# Install dependencies
uv sync

Configure MCP Server

Claude Code

For Claude Code CLI:

# Project-level (creates .mcp.json in current directory)
claude mcp add -s project docx-processor -- uv run --directory /path/to/SKILLful-mcp-docx-processor python server.py

# Or global (available in all projects)
claude mcp add -s user docx-processor -- uv run --directory /path/to/SKILLful-mcp-docx-processor python server.py

Replace /path/to/SKILLful-mcp-docx-processor with your actual project path.

Manual JSON Configuration

For other MCP clients, or to manually create .mcp.json / mcp_config.json:

{
  "mcpServers": {
    "docx-processor": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/SKILLful-mcp-docx-processor",
        "python",
        "server.py"
      ],
      "env": {}
    }
  }
}

Install Skill

Skill files support both project-level and global installation. Choose one as needed.

Project-level Installation

Takes effect for the current project only. Skill files reside within the project directory:

# Run in your target project's root directory
mkdir -p .claude/skills

# Copy Skill files to the target project
cp -r /path/to/SKILLful-mcp-docx-processor/skills/docx-process .claude/skills/

Global Installation

Takes effect for all projects. Skill files reside in the user's home directory:

# Copy Skill files to the global directory
mkdir -p ~/.claude/skills
cp -r /path/to/SKILLful-mcp-docx-processor/skills/docx-process ~/.claude/skills/

After installation, the directory structure is as follows:

.claude/              # Project-level  or  ~/.claude/  # Global
└── skills/
    └── docx-process/
        ├── SKILL.md                  # Route table
        └── references/
            ├── doc-management.md     # Document management
            ├── content-operations.md # Content operations
            ├── table-operations.md   # Table operations
            ├── formatting.md         # Formatting
            └── annotations-query.md  # Annotations & queries

Claude Code automatically loads SKILL.md before calling docx_process, ensuring every call has the complete route and parameter reference.


Usage

Once configured, the docx_process tool becomes available in Claude Code. The tool uses a single gateway pattern:

docx_process(route="create_document", params={"file_path": "output.docx"})
docx_process(route="add_heading", params={"text": "Hello World", "level": 1})
docx_process(route="save_document", params={})

The built-in docx-process skill automatically loads the route table and parameter specifications before each call, ensuring correct usage.

Architecture

server.py          -- MCP server with all handler logic (2,247 lines)
SKILL.md           -- Route table (loaded on every call)
references/*.md    -- 5 category reference docs (loaded on demand)

The server exposes one tool (docx_process) that dispatches to handler functions via a ROUTE_HANDLERS dictionary.

Context Efficiency

If all 63 routes were written into the tool's docstring or loaded at once, it would consume a large portion of the context window. This project uses on-demand Skill loading to significantly reduce context overhead:

Loading Stage Content Lines
Tool schema Docstring (parameter specs only) 6
Every call SKILL.md route table 116
On demand Single reference file 47-177
Total per call 169-299

Compared to a naive approach (docstring with full route list ~30 lines + full SKILL.md 595 lines = ~625 lines), context usage is reduced by 52-73%.

This means:

  • More room for actual tasks — saved context can be used for document content and business logic
  • Faster responses — fewer tokens means faster inference
  • Lower costs — significantly fewer tokens consumed per call

Robustness

  • File lock detection for all file operations
  • Parameter validation across all routes (levels, rows/cols, colors, spacing, etc.)
  • State management with overwrite warnings and cleanup on close
  • Unified error handling with clear, actionable messages
  • Save retry (3 attempts, 2s intervals) for locked files

Known Limitations

  • Single-document model (opening a new document warns about closing the current one)
  • No per-run rich text within a paragraph (whole-paragraph formatting only)
  • No text box support
  • No concurrent multi-user protection (designed for single-user MCP scenarios)

Acknowledgments

This project is built upon an extension of MCP-Doc, retaining its core DocxProcessor class architecture and 21 foundational document operations. It has been expanded to 63 routes with additional features including file lock detection and on-demand Skill loading. Thanks to the original author for the excellent work.

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选