{"id":9152,"library":"office-word-mcp-server","title":"Office Word MCP Server","description":"The Office Word Model Context Protocol (MCP) Server is a Python library designed to enable AI assistants to create, read, and manipulate Microsoft Word documents through a standardized interface. It exposes a rich set of document operations as tools and resources, facilitating seamless integration of Word document manipulation into AI-powered workflows. The current version is 1.1.11, requiring Python 3.11 or newer, and appears to be actively maintained with recent updates.","status":"active","version":"1.1.11","language":"en","source_language":"en","source_url":"https://github.com/GongRzhe/Office-Word-MCP-Server.git","tags":["word","office","mcp","ai-integration","document automation","microsoft word","server"],"install":[{"cmd":"pip install office-word-mcp-server","lang":"bash","label":"Install the library"}],"dependencies":[{"reason":"Core library for Word document manipulation.","package":"python-docx"},{"reason":"Likely provides the Model Context Protocol server framework.","package":"fastmcp"},{"reason":"Possibly for handling encrypted Word documents.","package":"msoffcrypto-tool"},{"reason":"For converting Word documents to PDF format.","package":"docx2pdf"},{"reason":"Required Python runtime environment.","package":"Python","min_version":"3.11"}],"imports":[],"quickstart":{"code":"# 1. Install the server (if not already installed)\n# pip install office-word-mcp-server\n\n# 2. Run the MCP server. This makes its capabilities available via a local API.\n#    The `uvx` command is often used for running CLI entry points from installed packages.\n#    Ensure `uv` is installed (pip install uv) if `uvx` is not available.\nimport subprocess\nimport os\n\n# This command typically runs in a separate terminal or as a background service.\n# For a quick demo, we can run it via subprocess (though not ideal for production).\n# In a real scenario, you'd configure your AI agent/IDE to start and connect to it.\n\nprint(\"Starting Office Word MCP Server...\")\n# Use a placeholder for a real AI agent configuration or an actual API call\n# The server logs its activity, and AI agents communicate via its exposed API.\n# Example command from GitHub README [2]\n# For demonstration, we'll just print the command. Actual execution would block or run in background.\nserver_command = \"uvx --from office-word-mcp-server word_mcp_server\"\nprint(f\"Execute this in your terminal: {server_command}\")\n\n# To simulate interaction, an AI agent would make API calls like:\n# create_document(filename=\"report.docx\", title=\"Quarterly Report\")\n# add_heading(filename=\"report.docx\", text=\"Introduction\", level=1)\n# add_paragraph(filename=\"report.docx\", text=\"This is the first paragraph of the report.\")\n\nprint(\"\\nServer started. An AI agent can now interact with it, e.g., to create or edit Word documents.\")\nprint(\"Refer to your AI agent's documentation for connecting to a local MCP server.\")","lang":"python","description":"To use the `office-word-mcp-server`, you typically run it as a standalone server process. AI agents or integrated development environments (IDEs) then connect to this server using the Model Context Protocol (MCP) to perform operations on Word documents. The quickstart demonstrates how to initiate the server process, after which an AI agent can issue commands like creating new documents, adding content, or applying formatting via API calls."},"warnings":[{"fix":"Ensure your AI assistant or client environment (e.g., Claude Desktop, Cursor, Microsoft Agent 365) is correctly configured to discover and communicate with local MCP servers. Interaction occurs via API calls, not direct Python imports.","message":"The `office-word-mcp-server` operates as a standalone service designed for AI agent integration, not as a library for direct Python function calls within a script. Your AI client or IDE must be configured to connect to the running MCP server.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For optimal results and maintainability, always use document templates with clearly defined, standard Microsoft Word styles. This ensures the server can apply formatting consistently and reliably.","message":"Documents lacking standard Word styles may lead to the server applying direct formatting instead of style-based formatting, which can result in inconsistent document appearance or difficulty in future edits.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify that the user account running the `office-word-mcp-server` has appropriate read and write permissions for the directories and files it needs to access. For image insertions, ensure absolute paths are used.","message":"File system permission issues can prevent the server from reading or writing Word documents to specified paths, leading to errors or failed operations.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the `office-word-mcp-server` process is running correctly. Check for firewall blocks, verify network connectivity, and ensure the server isn't overloaded. If running locally, confirm no other process is blocking the port.","cause":"The client (AI agent/IDE) could not establish a connection with the MCP server within the allowed time. This can be due to the server not running, network issues, or server overload.","error":"Failed to connect to MCP server: Connection timed out"},{"fix":"Verify that your AI client or IDE is configured with the correct API key. Ensure the API key is not expired and is provided with the correct prefix (e.g., 'Bearer ' or 'Key ') and no leading/trailing whitespace.","cause":"The client attempted to connect to the MCP server without proper authentication credentials, or with an incorrect/expired API key.","error":"401 Unauthorized: Invalid API key"},{"fix":"Modify the Word document to include standard heading styles (e.g., 'Heading 1', 'Heading 2'). For new documents, start with a template that defines these styles.","cause":"The target Word document does not contain the expected styles for operations like adding headings, forcing the server to use direct formatting as a fallback.","error":"Error: Document lacks required styles for heading operations."}]}