freshcrate
Home > MCP Servers > mcp-ms-office-documents

mcp-ms-office-documents

MCP server providing tools to create Ms Office documents like presentations, emails, spreadsheets and word docs (pptx, docx, eml, xlsx)

Description

MCP server providing tools to create Ms Office documents like presentations, emails, spreadsheets and word docs (pptx, docx, eml, xlsx)

README

๐Ÿ“„ MCP Office Documents Server

Let your AI assistant create professional Office documents โ€” PowerPoint, Word, Excel, emails & XML โ€” with a single prompt.

Docker MCP License


๐Ÿ“‹ Table of Contents


๐Ÿ’ก What is this?

This is an MCP (Model Context Protocol) server that runs in Docker and gives AI assistants (like Claude, Cursor, or any MCP-compatible client) the ability to generate real Office files on demand.

Just ask your AI to "create a sales presentation" or "draft a welcome email" โ€” and it will produce a ready-to-use file for you.

No coding required. Install, connect, and start creating.


โœจ Features at a Glance

Document Type Tool Highlights
๐Ÿ“Š PowerPoint create_powerpoint_presentation Title, section & content slides ยท 4:3 or 16:9 format ยท Custom templates
๐Ÿ“ Word create_word_from_markdown Write in Markdown, get a .docx ยท Headers, lists, tables, links, formatting
๐Ÿ“ˆ Excel create_excel_from_markdown Markdown tables โ†’ .xlsx ยท Formulas & cell references supported
๐Ÿ“ง Email create_email_draft HTML email drafts (.eml) ยท Subject, recipients, priority, language
๐Ÿ—‚๏ธ XML create_xml_file Well-formed XML files ยท Auto-validates & adds XML declaration if missing

All tools accept an optional file_name parameter. When provided, the output file will use that name (without extension) instead of a randomly generated identifier.

Bonus โ€” Dynamic Templates:

  • ๐Ÿ“ง Reusable Email Templates โ€” Define parameterized email layouts in YAML. Each becomes its own tool with typed arguments (e.g., first_name, promo_code).
  • ๐Ÿ“ Reusable Word Templates โ€” Create .docx files with {{placeholders}}. Each template becomes an AI tool. Placeholders support full Markdown.

Output options:

  • Local โ€” Files saved to the output/ folder
  • Cloud โ€” Upload to S3, Google Cloud Storage, Azure Blob, or MinIO and get a time-limited download link

๐Ÿš€ Quick Start

Get up and running in 3 steps:

1. Download the compose file

curl -L -o docker-compose.yml https://raw.githubusercontent.com/dvejsada/mcp-ms-office-docs/main/docker-compose.yml

Already cloned the repo? Skip this step โ€” docker-compose.yml is already there.

2. Set up your environment

cp .env.example .env

The defaults work out of the box โ€” files will be saved locally to output/.

3. Start the server

docker-compose up -d

โœ… Done! Your MCP endpoint is ready at: http://localhost:8958/mcp


โš™๏ธ Configuration

The server is configured through environment variables in your .env file.

Basic Settings

Variable Description Default
DEBUG Enable debug logging (1, true, yes) (off)
API_KEY Protect the server with an API key (see Authentication below) (disabled)
UPLOAD_STRATEGY Where to save files: LOCAL, S3, GCS, AZURE, MINIO LOCAL
SIGNED_URL_EXPIRES_IN How long cloud download links stay valid (seconds) 3600
๐Ÿ” Authentication

Set API_KEY in your .env to require an API key for all requests:

API_KEY=your-secret-key

Clients can send the key in any of these headers:

Header Format
Authorization Bearer your-secret-key
Authorization your-secret-key
x-api-key your-secret-key

Leave API_KEY empty or unset to allow all requests without authentication.

โ˜๏ธ AWS S3 Storage

Set UPLOAD_STRATEGY=S3 and provide:

Variable Description Required
S3_BUCKET S3 bucket name โœ… Always
AWS_ACCESS_KEY AWS access key ID โš ๏ธ See below
AWS_SECRET_ACCESS_KEY AWS secret access key โš ๏ธ See below
AWS_REGION AWS region (e.g., us-east-1) โš ๏ธ See below

Credential modes:

  • Explicit credentials โ€” Set all three of AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, and AWS_REGION. Recommended for simple setups.

  • AWS default credential chain โ€” Leave the credential variables unset and boto3 will automatically discover credentials from the standard chain:

    • AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY environment variables
    • Shared credential / config files (~/.aws/credentials)
    • AWS SSO sessions (aws sso login) โ€” useful for local development
    • IRSA (IAM Roles for Service Accounts) โ€” for AWS EKS deployments
    • ECS container credentials / EC2 instance metadata (IMDSv2)

    In this mode only S3_BUCKET is required; region is resolved automatically.

โ˜๏ธ Google Cloud Storage

Set UPLOAD_STRATEGY=GCS and provide:

Variable Description
GCS_BUCKET GCS bucket name
GCS_CREDENTIALS_PATH Path to service account JSON (default: /app/config/gcs-credentials.json)

Mount the credentials file via docker-compose.yml volumes.

โ˜๏ธ Azure Blob Storage

Set UPLOAD_STRATEGY=AZURE and provide:

Variable Description
AZURE_STORAGE_ACCOUNT_NAME Storage account name
AZURE_STORAGE_ACCOUNT_KEY Storage account key
AZURE_CONTAINER Blob container name
AZURE_BLOB_ENDPOINT (Optional) Custom endpoint for sovereign clouds
โ˜๏ธ MinIO / S3-Compatible Storage

Set UPLOAD_STRATEGY=MINIO and provide:

Variable Description Default
MINIO_ENDPOINT MinIO server URL (e.g., https://minio.example.com) (required)
MINIO_ACCESS_KEY Access key (required)
MINIO_SECRET_KEY Secret key (required)
MINIO_BUCKET Bucket name (required)
MINIO_REGION Region us-east-1
MINIO_VERIFY_SSL Verify SSL certificates true
MINIO_PATH_STYLE Use path-style URLs (recommended for MinIO) true

Make sure the bucket exists and your credentials have PutObject/GetObject permissions.


๐ŸŽจ Custom Templates

You can customize the look of generated documents by providing your own templates.

Static Templates

Place files in the custom_templates/ folder:

Document Filename Notes
PowerPoint 4:3 custom_pptx_template_4_3.pptx
PowerPoint 16:9 custom_pptx_template_16_9.pptx
Word custom_docx_template.docx
Email wrapper custom_email_template.html Base it on default_templates/default_email_template.html

Dynamic Email Templates

Create reusable, parameterized email layouts that your AI can fill in automatically.

๐Ÿ“ง How to set up dynamic email templates

1. Create config/email_templates.yaml:

templates:
  - name: welcome_email
    description: Welcome email with optional promo code
    html_path: welcome_email.html  # must be in custom_templates/ or default_templates/
    annotations:
      title: Welcome Email
    args:
      - name: first_name
        type: string
        description: Recipient's first name
        required: true
      - name: promo_code
        type: string
        description: Optional promotional code (HTML formatted)
        required: false

2. Create the HTML file in custom_templates/welcome_email.html:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8" /></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>

How it works:

  • Each template becomes a separate AI tool at startup
  • Standard email fields (subject, to, cc, bcc, priority, language) are added automatically
  • Use {{variable}} for escaped text, {{{variable}}} for raw HTML

Dynamic Word (DOCX) Templates

Create reusable Word documents with {{placeholders}} that support full Markdown formatting.

๐Ÿ“ How to set up dynamic DOCX templates

1. Create config/docx_templates.yaml:

templates:
  - name: formal_letter
    description: Generate a formal business letter
    docx_path: letter_template.docx  # must be in custom_templates/ or default_templates/
    annotations:
      title: Formal Letter Generator
    args:
      - name: recipient_name
        type: string
        description: Full name of the recipient
        required: true
      - name: recipient_address
        type: string
        description: Recipient's address
        required: true
      - name: subject
        type: string
        description: Letter subject
        required: true
      - name: body
        type: string
        description: Main body of the letter (supports markdown)
        required: true
      - name: sender_name
        type: string
        description: Sender's name
        required: true
      - name: date
        type: string
        description: Letter date
        required: false
        default: ""

2. Create a Word document with placeholders and save as custom_templates/letter_template.docx:

{{date}}

{{recipient_name}}
{{recipient_address}}

Subject: {{subject}}

{{body}}

{{sender_name}}

How it works:

  • Each template becomes a separate AI tool at startup
  • Placeholders can be in the document body, tables, headers, and footers
  • Placeholder values support full Markdown (bold, italic, lists, headingsโ€ฆ)
  • The original font from the placeholder location is preserved
๐ŸŽฏ Word style requirements for custom templates

For proper formatting, make sure these styles exist in your .docx template:

Category Styles
Headings Heading 1 โ€“ Heading 6
Bullet lists List Bullet, List Bullet 2, List Bullet 3
Numbered lists List Number, List Number 2, List Number 3
Other Normal, Quote, Table Grid

Tip: Customize these styles (font, size, color, spacing) in your template โ€” the server will use your styling.


๐Ÿ”Œ Connecting Your AI Client

Point your MCP-compatible client to the server endpoint:

http://localhost:8958/mcp

Examples for popular clients:

Claude Desktop

Add to your Claude Desktop MCP config:

{
  "mcpServers": {
    "office-documents": {
      "url": "http://localhost:8958/mcp"
    }
  }
}
LibreChat

Add the server to your librechat.yaml configuration under mcpServers:

mcpServers:
  office-documents:
    type: streamableHttp
    url: http://mcp-office-docs:8958/mcp

Note: If LibreChat and this server run in the same Docker network, use the container name (mcp-office-docs) as the hostname. If they run separately, use http://localhost:8958/mcp instead.

To place both services on the same network, add a shared network in your docker-compose.yml:

services:
  mcp-office-docs:
    # ...existing config...
    networks:
      - shared

  librechat:
    # ...existing config...
    networks:
      - shared

networks:
  shared:
    driver: bridge
Cursor / Other MCP Clients

Use the SSE/streamable HTTP transport and set the endpoint URL to:

http://localhost:8958/mcp

If you have authentication enabled, add the API key header as required by your client.


๐Ÿค Contributing

Contributions are welcome! If you'd like to help improve this project:

  1. Fork the repository
  2. Create a branch for your feature or fix (git checkout -b my-feature)
  3. Commit your changes (git commit -m "Add my feature")
  4. Push to your branch (git push origin my-feature)
  5. Open a Pull Request

Whether it's a bug report, a new feature idea, documentation improvement, or a code contribution โ€” all input is appreciated. Feel free to open an issue to start a discussion.

Release History

VersionChangesUrgencyDate
v3.5### โœจ New Features #### Custom Output Filenames All document tools (`create_word_from_markdown`, `create_excel_from_markdown`, `create_powerpoint_presentation`, `create_email_draft`, `create_xml_file`) now accept an optional **`file_name`** parameter. When provided, the generated file will use that name (without extension) instead of a randomly generated UUID. #### AWS S3 โ€” Default Credential Chain Support The S3 backend no longer requires explicit credentials to be set. In addition to tHigh4/11/2026
v3.4## What's Changed ### โ˜๏ธ GCS Signed URL โ€” Workload Identity Federation Support Signed URL generation for Google Cloud Storage now supports **Workload Identity Federation (WIF)** and federated credentials. When no local service account key file is available, signing is automatically delegated to the **IAM `signBlob` API**, ensuring compatibility with ADC and federated auth flows. ### ๐Ÿ“Š XLSX Table Rendering โ€” Percent Auto-Formatting Removed The heuristic that automatically formatted floatLow3/18/2026
v3.3## ๐Ÿ˜Ž New Features ๐Ÿ“‘ New features for docx generation: - underlined and strikethrough text - text alignment (right, center, left, justified) - add picture from URL - add automatic table of contents - add text to header and footer - add page break ๐Ÿงฎ New features for excel sheet: - excel sheet generation now allows for creating multiple sheets in 1 workbook with possible references across sheets. โš ๏ธ New security features - set API key verification for MCP server (very simple basLow2/20/2026
v3.2Fixed a bug with missing file type for XML upload.Low2/15/2026
v3.1## New tool - XML file creation Although not an MS office file, based our internal need for LLM to create XMLs, I have added the tool to this MCP server. Maybe somebody else will also have some use for it. ## What's Changed * Add XML file creation tool with validation by @dvejsada in https://github.com/dvejsada/mcp-ms-office-documents/pull/33 **Full Changelog**: https://github.com/dvejsada/mcp-ms-office-documents/compare/v3.0...v3.1Low2/8/2026
v3.0## ๐ŸŽ‰ New Feature: Dynamic Word Template tools Create professional Word documents from reusable templates with full markdown support! ### โœจ Highlights - **Template-based generation** - Define DOCX templates with `{{placeholder}}` syntax and register them as separate tools via YAML configuration - **Full markdown support** - All placeholder values support rich formatting including bold, italic, code, links, headings, and lists - **Flexible placement** - Placeholders work in document boLow1/8/2026
v2.0## New features This release add **new possibilities for presentation creation**. It allows to create **slides with tables, images, graphs, two-columns slides** etc. (see the presentation example in the release). These new possibilities however brought some breaking changes for the custom presentation templates (see below). In addition, new MinIO storage option has been added. ## โš ๏ธ BREAKING CHANGE - Slide Layout Indices Overview This release brings breaking change for custom presenLow1/4/2026
v1.3# BREAKING CHANGES This release brings breaking changes to server setup. See readme for current setup instructions. The breaking changes namely include the following: 1. Env variables moved from docker-compose to .env file (see example in the repo). 2. Custom templates folder must be mounted to app/custom_templates and the required naming of the custom template files have changed. ## What's Changed Complete refactoring of the MCP servers to allow for better maintenance and future exteLow10/23/2025
v1.2## What's Changed * Add Google Cloud Storage support as an upload strategy option * Add Azure Blob Storage support as an upload strategy option * Add configurable URL validity * Fix remaining text in docx default template **Full Changelog**: https://github.com/dvejsada/mcp-ms-office-documents/compare/v1.1...v1.2Low10/22/2025
v1.1๐Ÿš€**Major refactoring of email tool** Refactored the email tool. You may now mount your default email template that will be used for general email tool (thus having only a general content must) or you may even define you specific email tools by providing the html file and placeholder description in yaml (see Readme), **fastmcp will dynamically create these as separate tools** upon server startup. Perfect in cases where you want to ensure the e-mail formatting, structure and only need certain Low9/27/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

pipulateLocal First AI SEO Software on Nix, FastHTML & HTMXvoice-synthesis-breakthrough
OmnispindleA comprehensive MCP-based todo management system, that serves as a central nervous system for Madness Interactive, a multi-project task coordination workshop.v0.0.9
nmap-mcp๐Ÿ” Enable AI-driven network security scanning with a production-ready Nmap MCP server supporting diverse tools, scan types, and timing templates.main@2026-04-21
noapi-google-search-mcp๐Ÿ” Enable local LLMs with real-time Google search, live feeds, OCR, and video insights using noapi-google-search-mcp server tools.main@2026-04-21
zotero-mcp-lite๐Ÿš€ Run a high-performance MCP server for Zotero, enabling customizable workflows without cloud dependency or API keys.main@2026-04-21