mcp-arabic-ms-word
This MCP server (WordMasterAgent) provides tools to create, modify, inspect, and convert Microsoft Word documents with full Arabic RTL support. Key capabilities include:
Create Word documents with custom page setup, margins, orientation, metadata, and Arabic fonts.
Add content such as styled paragraphs, headings (H1–H6), RTL tables, embedded images, and headers/footers with Arabic page numbers.
Inspect documents to extract structural analysis like paragraph/heading counts, fonts, RTL flags, and metadata.
Convert Word to Markdown for easy reading or further processing.
Modify Word XML directly (e.g., replace text or elements in document.xml) or decompress and modify internal XML files with regex for surgical changes.
Repair Arabic text formatting by fixing issues like inverted brackets, digit normalization, excessive kashidas, and Alef/Yeh normalization.
Inject template data by merging JSON key-value placeholders into .docx templates.
Generate documents from intent by describing the document in plain text and having the server automatically produce a fully formatted Word document.
The server is optimized for Arabic users with RTL layout support and common Arabic fonts.
Embeds JPEG (and PNG) images into Word documents with customizable dimensions and alignment.
Converts Word documents to structured Markdown format, enabling easy extraction and reuse of content.
Decompresses .docx archives and performs surgical modification of internal XML files such as word/document.xml, word/styles.xml, and word/numbering.xml.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-arabic-ms-word Create a formal Arabic meeting minutes document"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
خادم خبير وورد العربي — MCP Arabic Microsoft Word Server
خادم بروتوكول MCP المتقدم (WordMasterAgent) المتخصص في إنشاء وتنسيق وحقن وفحص وإصلاح نصوص وتفكيك شفرات XML لمستندات Microsoft Word بدعم كامل ودقيق للغة العربية والاتجاه من اليمين إلى اليسار (RTL)، مزود بنظام RAG للتفكير المنطقي، وجراحة OpenXML وضبط BiDi، وفحص الصفحات الصوري (Pages/)، وبروتوكول نظافة مساحة العمل.
🌟 المحتويات | Table of Contents
Related MCP server: docx-mcp
🇸🇦 العربية
🚀 المميزات الرئيسية
نظام التفكير المنطقي واسترجاع المعرفة التوليدي (
RAG Knowledge & Intent Engine):استرجاع دلالي لأنماط المستندات (خطاب رسمي، بحث أكاديمي، تقرير تنفيذي، عقد قانوني، دليل سياسات، محضر اجتماع).
استنتاج الهيكل المناسب، تدرج العناوين، توزيع الجداول، وحساب معامل الثقة وخطوات التفكير المنطقي.
جراحة OpenXML وإصلاح انحراف العناوين والنصوص (
BiDi OpenXML Surgery):القضاء التام على انحراف العناوين نحو اليسار بفضل ضبط خصائص الفقرة
<w:jc w:val="right"/>ومنع تضارب<w:bidi/>.منع انفصال العناوين المعلقة عن متونها في نهايات الصفحات (
w:keepNext).حماية الآيات القرآنية والأحاديث الشريفة من الانشطار عبر فواصل الصفحات (
w:keepLines).ضبط محاذاة المتون العربية بهوامش متطابقة (
w:bidi+w:jc="both").
نظام المعاينة الصورية للصفحات (
Pages/Directory):تحويل المستند إلى PDF وتوليد صور عالية الدقة (150/300 DPI) لكل صفحة داخل مجلد فرعي نظيف ومستقل باسم
Pages/.فحص وكشف العيوب البصرية (العناوين المعلقة، الفراغات الزائدة، توازن الأسطر).
بروتوكول نظافة مساحة العمل (Clean Workspace Protocol):
عدم إنشاء أي ملفات بايثون أو سكربتات مبعثرة في مجلد المستخدم الأساسي، وحصر مخرجات العمل في المستند الأصلي وملف PDF ومجلد
Pages/.
دعم كامل للتيبوغرافيا وإصلاح النصوص العربية:
تصحيح الأقواس المقلوبة، توحيد الأرقام (شرقية/غربية)، وتنسيق همزات الألف والياء.
أتمتة ذكية دون الحاجة لأوامر نصية (
Zero Slash-Commands):محرك تحليل المقاصد (
resolve_and_execute_document_intent) يفهم طلباتك النصية العادية ويقوم بتوليد وتصحيح المستند تلقائياً استناداً للـ RAG.
🧠 نظام التفكير المنطقي RAG واستدعاء المقاصد الذكية
يحتوي السيرفر على محرك معرفي RAG داخلي يقوم بتفسير وصف المستخدم وتحويله إلى خطة توليد هندسية دقيقة:
تحديد النمط المعماري (Archetype): مطابقة الطلب مع أنماط الوثائق المعتمدة.
اختيار الخط والألوان: ضبط الخطوط العربية (
Amiriللخطابات،Traditional Arabicللأبحاث،Cairoللتقارير) ودرجات الألوان الرسمية (#003366,#1F4E78).بناء الأقسام والجداول والترقيم: إنشاء الهيكل الكامل تلقائياً مع تذييل الصفحات الديناميكي.
جراحة BiDi التلقائية: تطبيق مسار الجراحة فوراً لضمان خلو المستند من أي انحراف.
🔬 حل معضلة انحراف العناوين (BiDi OpenXML Surgery)
في بنية OpenXML، يؤدي وضع <w:bidi/> داخل خصائص الفقرة مع <w:jc w:val="right"/> إلى تفسيره كجهة يمنى منطقية لقارئ LTR، مما يجعله يعرض فيزيائياً في أقصى يسار الصفحة!
المعادلة المعتمدة في السيرفر:
العناوين:
<w:jc w:val="right"/>+<w:keepNext/>+<w:widowControl/>مع وسم<w:rtl/>في مسارات النصوص.متون الفقرات:
<w:bidi/>+<w:jc w:val="both"/>مع وسم<w:rtl/>.الآيات والأحاديث:
<w:keepLines/>+<w:bidi/>+ تمييز لوني.المقاطع الإنجليزية:
<w:jc w:val="left"/>خالية تماماً من وسومbidiوrtl.
🛠️ فهرس الأدوات المتاحة (15 Tools)
اسم الأداة | الوصف والتطبيق |
| توليد مستند كامل مبني على نظام RAG للتفكير المنطقي من خلال الوصف العادي. |
| جراحة OpenXML وضبط محاذاة العناوين لليمين ومنع انشطار الآيات وحماية المتون وتوليد الترقيم. |
| تحويل المستند لصور عالية الدقة داخل مجلد |
| فحص وإصلاح عيوب التيبوغرافيا العربية للأقواس المقلوبة والأرقام والألف والياء والمسافات. |
| تفكيك أرشيف docx والتعديل الجراحي بالـ Regex على أي ملف XML داخلي (document, styles, numbering). |
| إنشاء مستند |
| إدراج فقرة نصية منسقة (الخط، الحجم، اللون، الاتجاه، الكشيدة، المسافات). |
| إدراج عناوين رئيسية أو فرعية (H1-H6) بلون وتنسيق مخصص. |
| إدراج جدول بيانات متوافق مع الاتجاه العربي مع ألوان الهيدر والصفوف. |
| تضمين صور (PNG/JPEG) داخل المستند بأبعاد ومحاذاة محددة. |
| ضبط رأس وتذييل المستند وترقيم الصفحات العربي ( |
| فحص مستند وورد واستخراج عدد الفقرات والعناوين والجداول والخطوط المكتشفة. |
| استخراج محتوى مستند الوورد وتحويله إلى صيغة Markdown منظمة. |
| دمج بيانات JSON في قالب وورد يحتوي على متغيرات |
| استبدال نصوص أو عناصر شفرة WordprocessingML XML مباشرة. |
📦 طريقة التركيب والتشغيل عبر npx
npx -y mcp-arabic-ms-word@latest⚙️ إعدادات العميل القياسية (mcp_config.json)
{
"mcpServers": {
"mcp-arabic-ms-word": {
"command": "npx",
"args": [
"-y",
"mcp-arabic-ms-word@latest"
]
}
}
}🇬🇧 English Version
Key Features
RAG Knowledge & Cognitive Intent Engine: Semantic archetype retrieval for instant high-precision document synthesis with structured reasoning plans.
BiDi OpenXML Surgery Engine: Deep OpenXML surgery preventing heading drift, orphan headings (
keepNext), split verses (keepLines), and ensuring clean margin-to-margin body justification.Visual Page Audit &
Pages/Workflow: Automatically renders Word documents to high-resolution page images into an isolatedPages/directory with automated layout defect diagnostics.Clean Workspace Protocol: Prevents file pollution by keeping all scratch files internal and delivering pristine
.docx,.pdf, andPages/artifacts.Arabic Text Repair Engine: Automatic correction of inverted brackets in RTL text, digit standardization (Eastern/Western), whitespace trimming, and Alef/Yeh normalization.
Universal WordMasterAgent Architecture: Governed by
AGENTS.mdorchestrating 15 specialized MCP tools across 7 master skills.
📜 الترخيص والملكية | License & Author
المؤلف والحقوق | Author: MarwanDevSpace
الترخيص | License: MIT License
Available Tools
10 toolsadd_heading_to_documentAdd Heading to DocumentA
Appends a styled Heading (H1-H6) to a Word document with custom font size, color, alignment, and RTL support.
Inputs: text (required), filePath (required), level, colorHex, +4 more.
add_image_to_documentAdd Image to DocumentA
Embeds a PNG/JPEG image into a Word document with specified width, height, and alignment.
Inputs: filePath (required), imagePath (required), align, widthPx, +1 more.
add_paragraph_to_documentAdd Styled Paragraph to DocumentA
Appends a styled Arabic or English paragraph to a Word document with font, size, RTL, kashida justification, and line spacing.
Inputs: text (required), filePath (required), bold, italic, +9 more.
add_table_to_documentAdd RTL Table to DocumentA
Appends a structured table with RTL layout (w:bidiVisual), header styling, custom cell shading, and borders to a Word document.
Inputs: rows (required), columns (required), filePath (required), isRtl.
convert_word_to_markdownConvert Docx to MarkdownA
Extracts formatted headings and paragraph text from a Word document into structured Markdown for easy reading and analysis.
Inputs: filePath (required).
create_word_documentCreate Arabic MS Word DocumentA
Creates a new Microsoft Word (.docx) document with custom page setup, margins, metadata, and default Arabic font and RTL settings.
Inputs: filePath (required), title, author, subject, +7 more.
inject_template_dataInject Data into Docx TemplateA
Merges JSON key-value data into a .docx template containing tags (e.g., {name}, {#items}).
Inputs: data (required), outputPath (required), templatePath (required).
inspect_word_documentInspect Word Document ArchitectureA
Parses an existing .docx file and returns structural analysis (paragraph counts, headings, tables, detected fonts, RTL flags, metadata).
Inputs: filePath (required).
modify_word_xml_elementModify WordprocessingML XML ElementB
Performs low-level XML text node or tag modification in document.xml for deep customization.
Inputs: filePath (required), targetText (required), replacementText (required), outputPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct document operation: creation, inspection, adding specific content types (paragraph, heading, table, image, header/footer), low-level XML editing, template injection, and conversion. There is no overlap between any two tools.
All tool names follow a consistent verb_noun snake_case pattern, with a clear family of 'add_X_to_document' tools. The verbs accurately describe the action and the nouns specify the target, making the set predictable.
With 10 tools, the server covers create, inspect, content addition, templating, low-level customization, and conversion. The count is well-scoped for a document manipulation server, with each tool serving a distinct purpose.
The server covers the core document lifecycle: create, inspect, add content, template injection, and conversion. Missing operations like deleting or updating existing elements are compensable via low-level XML modification, but there is no high-level remove/update tool, which is a minor gap.
Maintenance
Related MCP Connectors
Generate, edit, merge, translate and PDF-convert PowerPoint (.pptx) over MCP. 8 tools.
Document conversion MCP server: PDF to Markdown, image OCR, spreadsheet parsing.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnterprise-grade document editing and management server that enables AI-powered operations on Microsoft Word DOCX files, including creating, editing, formatting, and exporting documents through both MCP protocol and RESTful API.3MIT
- AlicenseBqualityDmaintenanceAn MCP server for reading, editing, and validating Microsoft Word documents with specialized support for track changes, comments, and footnotes. It enables structural auditing, heading extraction, and precise OOXML-level document manipulation through natural language tools.101001,057 PyPI70MIT
- AlicenseNot gradedqualityDmaintenanceA powerful Word document editing MCP server that provides complete document manipulation capabilities, including creation, editing, formatting, tables, images, and advanced features like footnotes and interface document generation.3MIT
- AlicenseAqualityDmaintenanceMCP server for Word document (.docx) creation and manipulation — the production-grade document automation tool for AI agents.955 npmMIT