一个基于 FastMCP 库的 Docx 文档处理服务,支持在 Cursor 中使用 AI 助手创建、编辑和管理 Word 文档。
确保已安装 Python 3.10+,然后安装以下依赖:
pip3 install python-docx mcp
Features > MCP Servers
部分Add new MCP server
python3 /path/to/MCP_dox/server.py
(请替换为实际的 server.py
路径)Add
添加服务添加后,您可以在 Cursor 的 AI 助手中使用自然语言来操作 Word 文档,例如:
该服务支持以下操作:
create_document
, open_document
, save_document
add_paragraph
, add_heading
, add_table
, add_picture
edit_paragraph
, delete_paragraph
, delete_text
add_table_row
, delete_table_row
, edit_table_cell
, merge_table_cells
, split_table
add_page_break
, set_page_margins
get_document_info
, get_paragraphs
, get_tables
, search_text
create_document
, open_document
, save_document
, save_as_document
, create_document_copy
replace_section
, edit_section_by_keyword
find_and_replace
, search_and_replace
(带预览功能)该服务具有良好的排版理解能力:
server.py
- 使用 FastMCP 库实现的 MCP 服务的核心代码如果在 Cursor 中遇到问题,请尝试以下步骤:
MIT 许可证