FM

forlegalai/mcp-ms-office-documents

Developer tools
35 stars 0 forks 품질 90 트렌드 90

This is an 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.

개요

This is an 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.

README


📋 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 · Author metadata, footer text & slide numbers · Inline markdown (bold, italic, strikethrough, code) · Table column alignment
📝 Word create_word_from_markdown Write in Markdown, get a .docx · Headings, lists (with auto-restart), tables, links, images, block quotes, page breaks & text alignment · Superscript, subscript, underline & highlighted text · Table column alignment, borderless tables, proportional widths & multi-paragraph cells · Headers/footers with page numbers · Table of Contents · Custom style mapping & per-block style tags
📈 Excel create_excel_from_markdown Markdown tables → .xlsx · Multiple sheets · Formulas with table-relative & cross-sheet references · Column data types · Freeze panes & auto-filter · Column alignment
📧 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.

All tools also accept an optional add_unique_prefix parameter. Left unset, it follows the storage backend: true for LOCAL/S3/GCS/AZURE/MINIO, where an 8-character UUID prefix prevents collisions in shared storage (e.g., ff8ae81d_My_Report.docx), and false for LibreChat, which adds its own UUID prefix during file storage. Set it explicitly to override — false gives clean filenames (e.g., My_Report.docx).

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
RUN_BLOCKING_BY_ASYNCIO_THREAD_ENABLED Offload blocking tool work to a thread pool, keeping the event loop free for health probes & concurrent requests true
RUN_BLOCKING_MAX_WORKERS Maximum concurrent worker threads for blocking tool calls 4

📝 Markdown Reference

Both the Word and Excel tools accept Markdown. These references cover everything the parsers understand — including features that are easy to miss.

Golden rule: separate every block element (heading, list, table, quote…) with a blank line.


🎨 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.

Dynamic Word (DOCX) Templates

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


🖥️ Template Admin UI (optional)

Prefer clicking over editing YAML? Enable the built-in template-admin UI to create and manage dynamic Word and email templates from your browser — no YAML, no restart.


🔌 Connecting Your AI Client

Point your MCP-compatible client to the server endpoint:

http://localhost:8958/mcp

Examples for popular clients:


🤝 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.

View this README on GitHub

설치

This server does not publish a one-line install command.

Open the repository installation guide

설정

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