Skip to main content
Glama
README.md
# docforge-mcp

MCP server for **complete Office document manipulation** — create, read, edit, convert, and template DOCX, XLSX, PPTX, PDF, and EML files.

Built for AI agents that need full document lifecycle control, not just one-shot generation.

## Install

```bash
# Via uvx (no install needed)
uvx docforge-mcp

# Or install globally
uv tool install docforge-mcp

# Or pip
pip install docforge-mcp
```

## Tools (38)

| Category | Tools | Capabilities |
|----------|:-----:|--------------|
| **Word (DOCX)** | 12 | Create from markdown, read, edit paragraphs, insert, delete, search/replace, headers/footers, images, merge, templates |
| **Excel (XLSX)** | 7 | Create from markdown, read sheets, edit cells, insert/delete rows, charts, conditional formatting |
| **PowerPoint (PPTX)** | 9 | Create presentations, read slides, edit text, add shapes/images, reorder, duplicate, delete, merge, templates |
| **PDF** | 3 | Create from markdown, convert DOCX→PDF, read |
| **Email (EML)** | 1 | Create HTML email drafts |
| **XML** | 1 | Create well-formed XML |
| **Templates** | 2 | Render DOCX/PPTX with variables, conditionals (`{{#if}}`), loops (`{{#each}}`) |
| **Metadata** | 1 | Get document info/stats |
| **Merge** | 2 | Merge multiple DOCX or PPTX files |

## Usage

### As MCP server (stdio — default)

```bash
docforge-mcp
```

### As HTTP server

```bash
MCP_TRANSPORT=streamable-http MCP_PORT=8958 docforge-mcp
```

### MCP client configuration

```json
{
  "mcpServers": {
    "office-documents": {
      "command": "docforge-mcp",
      "autoApprove": ["read_document", "get_document_info", "get_docx_paragraphs", "get_pptx_slides", "get_xlsx_sheets"]
    }
  }
}
```

## Origins

This project was born from [ForLegalAI/mcp-ms-office-documents](https://github.com/ForLegalAI/mcp-ms-office-documents) (MIT license). It diverged in scope and philosophy:

| | ForLegalAI (upstream) | docforge-mcp |
|---|---|---|
| **Goal** | One-shot document generation | Full document lifecycle |
| **Read** | ❌ | ✅ Read any DOCX/XLSX/PPTX |
| **Edit** | ❌ | ✅ Edit paragraphs, cells, slides |
| **Convert** | ❌ | ✅ DOCX→PDF |
| **Templates** | Simple `{{var}}` | Conditionals + loops |
| **Transport** | Docker + HTTP only | stdio + HTTP |
| **Install** | Docker | `uvx docforge-mcp` |

We continue to contribute compatible features upstream (PRs #57, #58, #59) while developing the full toolkit independently.

## Development

```bash
git clone https://github.com/filhocf/docforge-mcp.git
cd docforge-mcp
uv sync --group dev
uv run pytest tests/ -v
uv run ruff check .
```

## License

MIT — see [LICENSE](LICENSE) for details. Original work © ForLegalAI, extensions © Claudio Ferreira Filho.

TDQS

B3.1/5.0

Scored across 40 tools

Disambiguation3/5

Tools are largely grouped by file type, but several overlap in purpose: render_docx_template, create_word_from_markdown, and add_bullet_list/add_numbered_list all generate DOCX content, and apply_pptx_template vs edit_pptx_slide_text vs render_pptx_template all modify presentation text. The distinctions require careful reading of each description.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern (read_document, get_docx_paragraphs, merge_docx_files, delete_pptx_slide). Minor deviations exist: formal_letter is a content-type verb instead of a file operation, and create_excel_from_markdown uses 'create' with a format suffix, but overall the pattern is predictable.

Tool Count2/5

40 tools is excessive for a document manipulation server. Many are micro-operations (set_page_margins, merge_table_cells, add_shape_to_slide) that could be consolidated into broader editing commands. The count creates a heavy, hard-to-navigate surface.

Completeness4/5

The server covers a broad range of document operations: read, create, edit, merge, convert, and format across DOCX, XLSX, PPTX, and PDF. Minor gaps exist (no PDF editing/merging, no XLSX delete/rename sheet, no document deletion), but the core lifecycle for the main formats is well covered.

Maintenance

ActivityMaintained
ResponsivenessResponsive