Word MCP Server
Word MCP Server là một ứng dụng Python cho phép tạo và chỉnh sửa tài liệu Microsoft Word (.docx) thông qua API. Dự án này sử dụng FastMCP để xây dựng các công cụ tương tác với tài liệu Word.
Cài đặt
Yêu cầu
- Python 3.12+
- Các thư viện phụ thuộc:
- python-docx
- opencv-python (cv2)
- numpy
- FastMCP
Cài đặt thư viện
Tính năng
Word MCP Server cung cấp các công cụ để:
- Tạo và mở tài liệu Word
- Thêm và định dạng văn bản
- Thêm hình ảnh
- Tạo bảng
- Quản lý tài nguyên và prompt
Hướng dẫn sử dụng
Cấu hình và khởi chạy với LLM
Để sử dụng Word MCP Server với các mô hình ngôn ngữ lớn (LLM), bạn cần cấu hình thông qua file JSON:
Giải thích cấu hình:
mcpServers
: Object chứa cấu hình cho các MCP serverword-mcp-server
: Tên định danh của servercommand
: Đường dẫn đến Python interpreter (thường nằm trong môi trường ảo)args
: Các tham số dòng lệnh, trong đó tham số đầu tiên là đường dẫn đến file server.py
Server sẽ khởi động và sẵn sàng nhận lệnh từ LLM
Tương tác với LLM:
Khi đã cấu hình và khởi chạy thành công, bạn có thể sử dụng LLM để:
- Tạo và chỉnh sửa tài liệu Word thông qua lệnh tự nhiên
- Tự động tạo nội dung dựa trên prompt
- Định dạng văn bản, thêm hình ảnh và bảng một cách thông minh
Tạo tài liệu mới
Mở tài liệu có sẵn
Thêm tiêu đề và đoạn văn
Thêm định dạng cho một phần văn bản
Thêm hình ảnh
Tạo bảng
Các màu hỗ trợ
Khi sử dụng các tham số color
và highlight
, bạn có thể sử dụng các giá trị sau:
- black
- blue
- green
- dark blue
- dark red
- dark yellow
- dark green
- pink
- red
- white
- teal
- yellow
- violet
- gray25
- gray50
Lưu ý
- Dự án này sử dụng thư viện
python-docx
để tương tác với tài liệu Word - Các tài nguyên và prompt được lưu trữ trong thư mục
resources
vàprompts
- Đảm bảo bạn đã cài đặt đầy đủ các thư viện phụ thuộc trước khi chạy server
Ví dụ hoàn chỉnh
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A Python application that allows creating and editing Microsoft Word (.docx) documents through an API, built with FastMCP for interacting with Word documents.
Related MCP Servers
- AsecurityAlicenseAqualityA server providing tools to read, write, and edit Microsoft Word (docx) files through the Model Context Protocol, allowing operations like complete document reading, content creation, targeted paragraph editing, and text insertion.Last updated -410PythonMIT License
- -securityFlicense-qualityA powerful Word document processing service based on FastMCP, enabling AI assistants to create, edit, and manage docx files with full formatting support. Preserves original styles when editing content.Last updated -12Python
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to create, read, edit, and format Microsoft Word documents through standardized tools and resources.Last updated -16139PythonMIT License
- -securityAlicense-qualityAn MCP server that enables programmatic interaction with Microsoft Word documents on Windows via COM Interop, allowing operations like document creation, text manipulation, formatting, and table management.Last updated -8TypeScriptMIT License