mcp-ms-office-documents

dvejsada/mcp-ms-office-documents

3.4

If you are the rightful owner of mcp-ms-office-documents and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol Server running over SSE, offering tools for LLM to create MS Office documents.

MCP Office Documents Server

This server lets AI assistants generate professional PowerPoint, Word, Excel, and EML email drafts through the Model Context Protocol (MCP).

1) Installation

  • Requirements: Docker and Docker Compose
  • Prepare folders (create if missing):
    • output/ – where files are saved for LOCAL strategy
    • custom_templates/ – optional custom Office/email templates
    • config/ – configuration (e.g., email_templates.yaml, credentials)
  • Get docker-compose.yml (copy or download into this folder):
curl -L -o docker-compose.yml https://raw.githubusercontent.com/dvejsada/mcp-ms-office-docs/main/docker-compose.yml

(If you already cloned this repository, you can just copy the existing docker-compose.yml.)

  • Configure environment:
    • Copy .env.example to .env
    • Edit .env:
      • LOG_LEVEL=INFO|DEBUG
      • UPLOAD_STRATEGY=LOCAL|S3|GCS|AZURE
      • For S3/GCS/AZURE, fill the required credentials
  • Start the server:
docker-compose up -d
  • MCP endpoint: http://localhost:8958/mcp

2) Tool overview

The server exposes these MCP tools:

  • create_powerpoint_presentation

    • Creates a .pptx from structured slides (title, section, content) with optional templates
    • Required input: slides array with slide_type and slide_title; optional author and slide_text for content slides
    • Format: 4:3 (default) or 16:9
  • create_word_from_markdown

    • Converts Markdown to .docx, supporting headers, lists, tables, inline formatting, links, block quotes
  • create_excel_from_markdown

    • Converts Markdown tables and headers to .xlsx
    • Supports formulas and relative/table references (e.g., =B[0], T1.SUM(B[0]:E[0]))
  • create_email_draft

    • Creates an EML draft with an HTML body using a preset wrapper template
    • Accepts subject, to/cc/bcc, priority, language, and raw content (no //

Dynamic email tools (optional):

  • If config/email_templates.yaml exists, each entry is registered as its own email-draft tool at startup. See below for details.

  • Short explanation: Dynamic email templates are reusable, parameterized HTML email layouts defined in config/email_templates.yaml. At startup the server registers each template as an individual MCP tool and automatically adds standard fields (subject, to, cc, bcc, priority, language). Template-specific arguments (for example first_name or promo_code) are exposed as tool parameters so AI assistants can call a single, strongly-typed tool to produce consistent, production-ready emails without composing full HTML bodies.

Outputs:

  • LOCAL: files saved to output/ and reported back
  • S3/GCS/AZURE: a time-limited download link is returned (TTL via SIGNED_URL_EXPIRES_IN)

3) Custom templates

You can provide custom templates for PowerPoint, Word, and email.

Place files in custom_templates/.

  • PowerPoint: custom_pptx_template_4_3.pptx, custom_pptx_template_16_9.pptx

  • Word: custom_docx_template.docx

  • Email wrapper : custom_email_template.html - base your template on default_templates/default_email_template.html

Dynamic email templates (optional):

  • Create config/email_templates.yaml and reference HTML files by filename only (no paths).
  • Example entry:
templates:
  - name: welcome_email
    description: Welcome email with optional promo code
    html_path: welcome_email.html  # file must exist in custom_templates/ or default_templates/
    annotations:
      title: Welcome Email
    args:
      - name: subject
        type: string
        required: true
      - name: first_name
        type: string
        required: true
      - name: promo_code
        type: string
        required: false
  • Minimal example HTML (place in custom_templates/welcome_email.html):
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>{{subject}}</title>
</head>
<body>
  <h2>Welcome {{first_name}}!</h2>
  <p>We’re excited to have you on board.</p>
  {{{promo_code_block}}}
  <p>Regards,<br/>Support Team</p>
</body>
</html>
  • Subject, to, cc, bcc, priority, and language are handled automatically and added to each template tool.
  • Tip: use {{variable}} for escaped text; {{{variable}}} for raw HTML