Word document reading and writing MCP implemented in Node.js
A Model Context Protocol (MCP) server that provides AI-powered Word document manipulation capabilities. This server implements the MCP protocol to enable AI applications to create, edit, and manage Word documents through natural language interactions.
npx @puchunjie/doc-tools-mcp
Or install globally:
npm install -g @puchunjie/doc-tools-mcp
For use as a dependency in your project:
npm install @puchunjie/doc-tools-mcp
npx @puchunjie/doc-tools-mcp
The server will start on port 8765 by default
Configure your AI application (e.g., Cursor, VSCode) to use the MCP server:
http://localhost:8765
The server provides the following MCP functions:
create_document
- Create a new Word document
open_document
- Open an existing Word document
add_paragraph
- Add a paragraph to the document
add_table
- Add a table to the document
search_and_replace
- Find and replace text in the document
set_page_margins
- Set document page margins
get_document_info
- Get document metadata
~/.cursor/mcp.json
{ "mcpServers": { "doc-tools-mcp": { "command": "npx", "args": [ "@puchunjie/doc-tools-mcp" ] } } }
Or for local development version:
{ "mcpServers": { "doc-tools-mcp": { "command": "node", "args": [ "/path/to/your/doc-tools-mcp/dist/mcp-server.js" ] } } }
After configuration, you can use natural language to manipulate Word documents:
"Create a new document named report.docx"
"Add a heading 'Monthly Report' to report.docx"
"Insert a 4x3 table with sales data"
Similar integration steps apply to other tools that support the MCP protocol. Consult your tool's documentation for specific MCP server configuration steps.
To extend or modify this MCP server:
git clone cd doc-tools-mcp
npm install
npm run start
npm run build
src/services/DocumentService.ts
src/mcp-server.ts
MIT
If you encounter any issues or have suggestions for improvements, please submit an issue on our GitHub repository.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!