Skip to main content
Glama

خادم خبير وورد العربي — MCP Arabic Microsoft Word Server

License: MIT npm version Node Version MCP Protocol Author mcp-arabic-ms-word MCP server

خادم بروتوكول MCP المتقدم (WordMasterAgent) المتخصص في إنشاء وتنسيق وحقن وفحص وإصلاح نصوص وتفكيك شفرات XML لمستندات Microsoft Word بدعم كامل ودقيق للغة العربية والاتجاه من اليمين إلى اليسار (RTL)، مزود بنظام RAG للتفكير المنطقي، وجراحة OpenXML وضبط BiDi، وفحص الصفحات الصوري (Pages/)، وبروتوكول نظافة مساحة العمل.


🌟 المحتويات | Table of Contents


Related MCP server: docx-mcp

🇸🇦 العربية

🚀 المميزات الرئيسية

  1. نظام التفكير المنطقي واسترجاع المعرفة التوليدي (RAG Knowledge & Intent Engine):

    • استرجاع دلالي لأنماط المستندات (خطاب رسمي، بحث أكاديمي، تقرير تنفيذي، عقد قانوني، دليل سياسات، محضر اجتماع).

    • استنتاج الهيكل المناسب، تدرج العناوين، توزيع الجداول، وحساب معامل الثقة وخطوات التفكير المنطقي.

  2. جراحة OpenXML وإصلاح انحراف العناوين والنصوص (BiDi OpenXML Surgery):

    • القضاء التام على انحراف العناوين نحو اليسار بفضل ضبط خصائص الفقرة <w:jc w:val="right"/> ومنع تضارب <w:bidi/>.

    • منع انفصال العناوين المعلقة عن متونها في نهايات الصفحات (w:keepNext).

    • حماية الآيات القرآنية والأحاديث الشريفة من الانشطار عبر فواصل الصفحات (w:keepLines).

    • ضبط محاذاة المتون العربية بهوامش متطابقة (w:bidi + w:jc="both").

  3. نظام المعاينة الصورية للصفحات (Pages/ Directory):

    • تحويل المستند إلى PDF وتوليد صور عالية الدقة (150/300 DPI) لكل صفحة داخل مجلد فرعي نظيف ومستقل باسم Pages/.

    • فحص وكشف العيوب البصرية (العناوين المعلقة، الفراغات الزائدة، توازن الأسطر).

  4. بروتوكول نظافة مساحة العمل (Clean Workspace Protocol):

    • عدم إنشاء أي ملفات بايثون أو سكربتات مبعثرة في مجلد المستخدم الأساسي، وحصر مخرجات العمل في المستند الأصلي وملف PDF ومجلد Pages/.

  5. دعم كامل للتيبوغرافيا وإصلاح النصوص العربية:

    • تصحيح الأقواس المقلوبة، توحيد الأرقام (شرقية/غربية)، وتنسيق همزات الألف والياء.

  6. أتمتة ذكية دون الحاجة لأوامر نصية (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)

اسم الأداة

الوصف والتطبيق

resolve_and_execute_document_intent

توليد مستند كامل مبني على نظام RAG للتفكير المنطقي من خلال الوصف العادي.

enforce_arabic_bidi_and_typography

جراحة OpenXML وضبط محاذاة العناوين لليمين ومنع انشطار الآيات وحماية المتون وتوليد الترقيم.

audit_and_render_document_pages

تحويل المستند لصور عالية الدقة داخل مجلد Pages/ وفحص العيوب البصرية والهيكلية.

repair_arabic_text_formatting

فحص وإصلاح عيوب التيبوغرافيا العربية للأقواس المقلوبة والأرقام والألف والياء والمسافات.

decompress_and_modify_word_xml

تفكيك أرشيف docx والتعديل الجراحي بالـ Regex على أي ملف XML داخلي (document, styles, numbering).

create_word_document

إنشاء مستند .docx جديد بتحديد المقاس والبهامش والخط والاتجاه الافتراضي.

add_paragraph_to_document

إدراج فقرة نصية منسقة (الخط، الحجم، اللون، الاتجاه، الكشيدة، المسافات).

add_heading_to_document

إدراج عناوين رئيسية أو فرعية (H1-H6) بلون وتنسيق مخصص.

add_table_to_document

إدراج جدول بيانات متوافق مع الاتجاه العربي مع ألوان الهيدر والصفوف.

add_image_to_document

تضمين صور (PNG/JPEG) داخل المستند بأبعاد ومحاذاة محددة.

add_header_footer_to_document

ضبط رأس وتذييل المستند وترقيم الصفحات العربي (صفحة X من Y).

inspect_word_document

فحص مستند وورد واستخراج عدد الفقرات والعناوين والجداول والخطوط المكتشفة.

convert_word_to_markdown

استخراج محتوى مستند الوورد وتحويله إلى صيغة Markdown منظمة.

inject_template_data

دمج بيانات JSON في قالب وورد يحتوي على متغيرات {placeholder}.

modify_word_xml_element

استبدال نصوص أو عناصر شفرة 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 isolated Pages/ directory with automated layout defect diagnostics.

  • Clean Workspace Protocol: Prevents file pollution by keeping all scratch files internal and delivering pristine .docx, .pdf, and Pages/ 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.md orchestrating 15 specialized MCP tools across 7 master skills.


📜 الترخيص والملكية | License & Author

Available Tools

10 tools
add_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

    A4/5.0

    Scored across 10 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enterprise-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.
      3
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      An 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.
      10
      100
      1,057 PyPI
      70
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      3
      MIT