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