Skip to content
Back to search

mcp-doc

A 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. 基于FastMCP的强大Word文档处理服务,使AI助手能够创建、编辑和管理docx文件,支持完整的格式设置功能。在编辑内容时能够保留原始样式和格式,实现精确的文档操作。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/meterlong--mcp-doc/badge.svg)](/listings/meterlong--mcp-doc)

HTML

<a href="/listings/meterlong--mcp-doc"><img src="/api/listings/meterlong--mcp-doc/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Ensure Python 3.10+ is installed, then install the following dependencies:

pip3 install python-docx mcp

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 100 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Docx MCP Service
  2. [English](README.md) | [中文](README_ZH.md)
  3. [![smithery badge](https://smithery.ai/badge/@MeterLong/mcp-doc)](https://smithery.ai/server/@MeterLong/mcp-doc)
  4. A Docx document processing service based on the FastMCP library, supporting the creation, editing, and management of Word documents using AI assistants in Cursor.
  5. ## Features
  6. - **Complete Document Operations**: Support for creating, opening, saving documents, as well as adding, editing, and deleting content
  7. - **Formatting**: Support for setting fonts, colors, sizes, alignment, and other formatting options
  8. - **Table Processing**: Support for creating, editing, merging, and splitting table cells
  9. - **Image Insertion**: Support for inserting images and setting their sizes
  10. - **Layout Control**: Support for setting page margins, adding page breaks, and other layout elements
  11. - **Query Functions**: Support for retrieving document information, paragraph content, and table data
  12. - **Convenient Editing**: Support for find and replace functionality
  13. - **Section Editing**: Support for replacing content in specific sections while preserving original formatting and styles
  14. ## Installation Dependencies
  15. Ensure Python 3.10+ is installed, then install the following dependencies:
  16. ```bash
  17. pip3 install python-docx mcp
  18. ```
  19. ## Usage
  20. ### Using as an MCP Service in Cursor
  21. 1. Open Cursor and go to Settings
  22. 2. Find the `Features > MCP Servers` section
  23. 3. Click `Add new MCP server`
  24. 4. Fill in the following information:
  25. - Name: MCP_DOCX
  26. - Type: Command
  27. - Command: `python3 /path/to/MCP_dox/server.py` (replace with the actual path to your `server.py`)
  28. 5. Click `Add` to add the service
  29. After adding, you can use natural language to operate Word documents in Cursor's AI assistant, for example:
  30. - "Create a new Word document and save it to the desktop"
  31. - "Add a level 3 heading"
  32. - "Insert a 3x4 table and fill it with data"
  33. - "Set the second paragraph to bold and center-aligned"
  34. ## Supported Operations
  35. The service supports the following operations:
  36. - **Document Management**: `create_document`, `open_document`, `save_document`
  37. - **Content Addition**: `add_paragraph`, `add_heading`, `add_table`, `add_picture`
  38. - **Content Editing**: `edit_paragraph`, `delete_paragraph`, `delete_text`
  39. - **Table Operations**: `add_table_row`, `delete_table_row`, `edit_table_cell`, `merge_table_cells`, `split_table`
  40. - **Layout Control**: `add_page_break`, `set_page_margins`
  41. - **Query Functions**: `get_document_info`, `get_paragraphs`, `get_tables`, `search_text`
  42. - **File Operations**: `create_document`, `open_document`, `save_document`, `save_as_document`, `create_document_copy`
  43. - **Section Editing**: `replace_section`, `edit_section_by_keyword`
  44. - **Other Functions**: `find_and_replace`, `search_and_replace` (with preview functionality)
  45. ## How It Works
  46. 1. The service uses the Python-docx library to process Word documents
  47. 2. It implements the MCP protocol through the FastMCP library to communicate with AI assistants
  48. 3. It processes requests and returns formatted responses
  49. 4. It supports complete error handling and status reporting
  50. ## Typography Capabilities
  51. The service has good typography understanding capabilities:
  52. - **Text Hierarchy**: Support for heading levels (1-9) and paragraph organization
  53. - **Page Layout**: Support for page margin settings
  54. - **Visual Elements**: Support for font styles (bold, italic, underline, color) and alignment
  55. - **Table Layout**: Support for creating tables, merging cells, splitting tables, and setting table formats
  56. - **Pagination Control**: Support for adding page breaks
  57. ## Development Notes
  58. - `server.py` - Core implementation of the MCP service using the FastMCP library
  59. ## Troubleshooting
  60. If you encounter problems in Cursor, try the following steps:
  61. 1. Ensure Python 3.10+ is correctly installed
  62. 2. Ensure the python-docx and mcp libraries are correctly installed
  63. 3. Check if the server path is correct
  64. 4. Restart the Cursor application
  65. ## Notes
  66. - Ensure the python-docx and mcp libraries are correctly installed
  67. - Ensure Chinese characters in paths can be correctly processed
  68. - Using absolute paths can avoid path parsing issues
  69. ## License
  70. MIT License

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.