docforge-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. docforge_mcp-0.1.0/.github/dependabot.yml +10 -0
  2. docforge_mcp-0.1.0/.github/workflows/ci.yml +58 -0
  3. docforge_mcp-0.1.0/.github/workflows/codeql.yml +23 -0
  4. docforge_mcp-0.1.0/.gitignore +51 -0
  5. docforge_mcp-0.1.0/AGENTS.md +88 -0
  6. docforge_mcp-0.1.0/CHANGELOG.md +28 -0
  7. docforge_mcp-0.1.0/LICENSE +22 -0
  8. docforge_mcp-0.1.0/MEMORY.md +24 -0
  9. docforge_mcp-0.1.0/PKG-INFO +134 -0
  10. docforge_mcp-0.1.0/Readme.md +89 -0
  11. docforge_mcp-0.1.0/config.py +389 -0
  12. docforge_mcp-0.1.0/default_templates/default_docx_template.docx +0 -0
  13. docforge_mcp-0.1.0/default_templates/default_email_template.html +20 -0
  14. docforge_mcp-0.1.0/default_templates/default_pptx_template_16_9.pptx +0 -0
  15. docforge_mcp-0.1.0/default_templates/default_pptx_template_4_3.pptx +0 -0
  16. docforge_mcp-0.1.0/docx_tools/__init__.py +5 -0
  17. docforge_mcp-0.1.0/docx_tools/advanced/__init__.py +19 -0
  18. docforge_mcp-0.1.0/docx_tools/advanced/features.py +101 -0
  19. docforge_mcp-0.1.0/docx_tools/base_docx_tool.py +226 -0
  20. docforge_mcp-0.1.0/docx_tools/conditional_templates.py +112 -0
  21. docforge_mcp-0.1.0/docx_tools/dynamic_docx_tools.py +539 -0
  22. docforge_mcp-0.1.0/docx_tools/helpers.py +703 -0
  23. docforge_mcp-0.1.0/edit_tools/__init__.py +16 -0
  24. docforge_mcp-0.1.0/edit_tools/docx_editor.py +94 -0
  25. docforge_mcp-0.1.0/edit_tools/pptx_editor.py +60 -0
  26. docforge_mcp-0.1.0/edit_tools/xlsx_editor.py +53 -0
  27. docforge_mcp-0.1.0/email_tools/__init__.py +10 -0
  28. docforge_mcp-0.1.0/email_tools/base_email_tool.py +114 -0
  29. docforge_mcp-0.1.0/email_tools/dynamic_email_tools.py +177 -0
  30. docforge_mcp-0.1.0/mcp_office_documents/__init__.py +3 -0
  31. docforge_mcp-0.1.0/mcp_office_documents/app.py +826 -0
  32. docforge_mcp-0.1.0/mcp_office_documents/server.py +40 -0
  33. docforge_mcp-0.1.0/merge_tools/__init__.py +5 -0
  34. docforge_mcp-0.1.0/merge_tools/merger.py +45 -0
  35. docforge_mcp-0.1.0/middleware.py +110 -0
  36. docforge_mcp-0.1.0/pdf_tools/__init__.py +5 -0
  37. docforge_mcp-0.1.0/pdf_tools/base_pdf_tool.py +131 -0
  38. docforge_mcp-0.1.0/pptx_tools/__init__.py +15 -0
  39. docforge_mcp-0.1.0/pptx_tools/advanced/__init__.py +10 -0
  40. docforge_mcp-0.1.0/pptx_tools/advanced/features.py +97 -0
  41. docforge_mcp-0.1.0/pptx_tools/base_pptx_tool.py +44 -0
  42. docforge_mcp-0.1.0/pptx_tools/chart_utils.py +177 -0
  43. docforge_mcp-0.1.0/pptx_tools/constants.py +52 -0
  44. docforge_mcp-0.1.0/pptx_tools/helpers.py +459 -0
  45. docforge_mcp-0.1.0/pptx_tools/image_utils.py +227 -0
  46. docforge_mcp-0.1.0/pptx_tools/slide_builder.py +398 -0
  47. docforge_mcp-0.1.0/pyproject.toml +84 -0
  48. docforge_mcp-0.1.0/read_tools/__init__.py +11 -0
  49. docforge_mcp-0.1.0/read_tools/docx_reader.py +63 -0
  50. docforge_mcp-0.1.0/read_tools/pptx_reader.py +62 -0
  51. docforge_mcp-0.1.0/read_tools/xlsx_reader.py +65 -0
  52. docforge_mcp-0.1.0/template_utils.py +133 -0
  53. docforge_mcp-0.1.0/tests/__init__.py +2 -0
  54. docforge_mcp-0.1.0/tests/test_auth_middleware.py +334 -0
  55. docforge_mcp-0.1.0/tests/test_conditional_templates.py +86 -0
  56. docforge_mcp-0.1.0/tests/test_docx_advanced.py +128 -0
  57. docforge_mcp-0.1.0/tests/test_docx_base.py +1700 -0
  58. docforge_mcp-0.1.0/tests/test_docx_templates.py +1988 -0
  59. docforge_mcp-0.1.0/tests/test_edit_tools.py +162 -0
  60. docforge_mcp-0.1.0/tests/test_merge_tools.py +75 -0
  61. docforge_mcp-0.1.0/tests/test_pdf_tools.py +108 -0
  62. docforge_mcp-0.1.0/tests/test_pptx_advanced.py +74 -0
  63. docforge_mcp-0.1.0/tests/test_pptx_creation.py +961 -0
  64. docforge_mcp-0.1.0/tests/test_read_tools.py +169 -0
  65. docforge_mcp-0.1.0/tests/test_s3_upload.py +320 -0
  66. docforge_mcp-0.1.0/tests/test_xlsx_charts.py +94 -0
  67. docforge_mcp-0.1.0/tests/test_xlsx_creation.py +425 -0
  68. docforge_mcp-0.1.0/tests/test_xlsx_formatting.py +78 -0
  69. docforge_mcp-0.1.0/tests/test_xml_creation.py +318 -0
  70. docforge_mcp-0.1.0/upload_tools/__init__.py +4 -0
  71. docforge_mcp-0.1.0/upload_tools/backends/__init__.py +13 -0
  72. docforge_mcp-0.1.0/upload_tools/backends/azure.py +66 -0
  73. docforge_mcp-0.1.0/upload_tools/backends/gcs.py +75 -0
  74. docforge_mcp-0.1.0/upload_tools/backends/local.py +28 -0
  75. docforge_mcp-0.1.0/upload_tools/backends/minio.py +59 -0
  76. docforge_mcp-0.1.0/upload_tools/backends/s3.py +139 -0
  77. docforge_mcp-0.1.0/upload_tools/main.py +79 -0
  78. docforge_mcp-0.1.0/upload_tools/utils.py +60 -0
  79. docforge_mcp-0.1.0/xlsx_tools/__init__.py +3 -0
  80. docforge_mcp-0.1.0/xlsx_tools/base_xlsx_tool.py +212 -0
  81. docforge_mcp-0.1.0/xlsx_tools/charts/__init__.py +5 -0
  82. docforge_mcp-0.1.0/xlsx_tools/charts/chart_builder.py +113 -0
  83. docforge_mcp-0.1.0/xlsx_tools/formatting.py +86 -0
  84. docforge_mcp-0.1.0/xlsx_tools/helpers.py +383 -0
  85. docforge_mcp-0.1.0/xml_tools/__init__.py +4 -0
  86. docforge_mcp-0.1.0/xml_tools/base_xml_tool.py +116 -0
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: "/"
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,58 @@
1
+ name: Lint & Test
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ lint-and-test:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Set up Python 3.12
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+ cache: "pip"
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ pip install -e ".[dev]"
27
+
28
+ - name: Run ruff linter
29
+ run: ruff check .
30
+
31
+ - name: Run tests with coverage
32
+ run: pytest --tb=short -q --ignore=tests/test_s3_upload.py
33
+
34
+ publish:
35
+ runs-on: ubuntu-latest
36
+ needs: lint-and-test
37
+ if: startsWith(github.ref, 'refs/tags/v')
38
+
39
+ permissions:
40
+ id-token: write
41
+
42
+ steps:
43
+ - name: Checkout code
44
+ uses: actions/checkout@v4
45
+
46
+ - name: Set up Python 3.12
47
+ uses: actions/setup-python@v5
48
+ with:
49
+ python-version: "3.12"
50
+
51
+ - name: Install build tools
52
+ run: pip install build
53
+
54
+ - name: Build package
55
+ run: python -m build
56
+
57
+ - name: Publish to PyPI
58
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,23 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+ schedule:
9
+ - cron: '0 6 * * 1'
10
+
11
+ permissions:
12
+ security-events: write
13
+ contents: read
14
+
15
+ jobs:
16
+ analyze:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: github/codeql-action/init@v3
21
+ with:
22
+ languages: python
23
+ - uses: github/codeql-action/analyze@v3
@@ -0,0 +1,51 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ pip-wheel-metadata/
20
+ share/python-wheels/
21
+ *.egg-info/
22
+ .installed.cfg
23
+ *.egg
24
+ MANIFEST
25
+
26
+ # Virtual environments
27
+ .env
28
+ .venv
29
+ env/
30
+ venv/
31
+ ENV/
32
+ env.bak/
33
+ venv.bak/
34
+
35
+ # IDEs
36
+ .vscode/
37
+ .idea/
38
+ *.swp
39
+ *.swo
40
+
41
+ # OS
42
+ .DS_Store
43
+ Thumbs.db
44
+
45
+ # Output directory
46
+ output/
47
+ custom_templates/
48
+ config/
49
+
50
+ # Temporary files
51
+ *.tmp
@@ -0,0 +1,88 @@
1
+ # AGENTS.md — docforge-mcp
2
+
3
+ ## Project Overview
4
+
5
+ MCP server providing 38 tools for complete Office document manipulation — create, read, edit, convert, merge, and template DOCX, XLSX, PPTX, PDF, and EML files. Designed for AI agents that need full document lifecycle control.
6
+
7
+ ## Architecture
8
+
9
+ ```
10
+ mcp_office_documents/
11
+ ├── app.py # FastMCP server — all 38 tools registered here
12
+ ├── server.py # Entry point (stdio/HTTP transport selection)
13
+ └── __init__.py
14
+
15
+ docx_tools/ # Word: create, markdown→docx, templates
16
+ ├── base_docx_tool.py # create_word_from_markdown
17
+ ├── conditional_templates.py # render_docx_template (if/unless/each)
18
+ ├── dynamic_docx_tools.py # Dynamic tools from YAML templates
19
+ └── helpers.py
20
+
21
+ xlsx_tools/ # Excel: create, charts, formatting
22
+ ├── base_xlsx_tool.py # create_excel_from_markdown
23
+ ├── formatting.py # apply_excel_formatting (color scale, highlight, data bar)
24
+ └── helpers.py
25
+
26
+ pptx_tools/ # PowerPoint: create, slides, shapes, images
27
+ ├── base_pptx_tool.py # create_powerpoint_presentation
28
+ ├── slide_builder.py # Slide construction logic
29
+ ├── chart_utils.py # Charts in slides
30
+ └── helpers.py
31
+
32
+ pdf_tools/ # PDF: create from markdown, convert DOCX→PDF
33
+ ├── base_pdf_tool.py
34
+
35
+ email_tools/ # Email: HTML drafts (.eml)
36
+ ├── base_email_tool.py
37
+ ├── dynamic_email_tools.py
38
+
39
+ edit_tools/ # Edit existing documents
40
+ ├── docx_editor.py # edit/insert/delete paragraphs, search/replace
41
+ ├── pptx_editor.py # edit slides, reorder, duplicate, delete
42
+ ├── xlsx_editor.py # edit cells, insert/delete rows
43
+
44
+ read_tools/ # Read existing documents
45
+ ├── docx_reader.py # get_docx_paragraphs, get_docx_tables
46
+ ├── pptx_reader.py # get_pptx_slides
47
+ ├── xlsx_reader.py # get_xlsx_sheets
48
+
49
+ merge_tools/ # Merge multiple files
50
+ ├── merger.py # merge_docx_files, merge_pptx_files
51
+
52
+ xml_tools/ # XML creation
53
+ ├── base_xml_tool.py
54
+
55
+ upload_tools/ # S3/GCS/Azure/MinIO upload
56
+ ├── main.py
57
+
58
+ tests/ # 16 test files, pytest
59
+ ```
60
+
61
+ ## Data Flow
62
+
63
+ ```
64
+ AI Agent → FastMCP (stdio/HTTP) → app.py → {docx,xlsx,pptx,pdf,email,edit,read,merge}_tools → output file
65
+ ```
66
+
67
+ ## Key Conventions
68
+
69
+ - **Transport**: stdio (default) or streamable-http (env `MCP_TRANSPORT=streamable-http`, `MCP_PORT=8958`)
70
+ - **Output**: files saved to `output/` directory (configurable via `OUTPUT_DIR` env)
71
+ - **Templates**: DOCX/PPTX with `{{var}}`, `{{#if cond}}`, `{{#each items}}`
72
+ - **Naming**: snake_case functions, tools named descriptively (`create_word_from_markdown`, `edit_docx_paragraph`)
73
+ - **Errors**: raise ValueError for user errors, let exceptions propagate for bugs
74
+
75
+ ## Adding a New Tool
76
+
77
+ 1. Create function in the appropriate `*_tools/` module
78
+ 2. Register in `mcp_office_documents/app.py` with `@mcp.tool()` decorator
79
+ 3. Add test in `tests/test_{category}.py`
80
+ 4. Run: `pytest --tb=short -q && ruff check .`
81
+
82
+ ## Tests
83
+
84
+ ```bash
85
+ pip install -e ".[dev]"
86
+ pytest --tb=short -q --cov=. --cov-report=term-missing
87
+ ruff check .
88
+ ```
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org/).
5
+
6
+ ## [0.1.0] - 2026-05-19
7
+
8
+ ### Added
9
+
10
+ - 38 MCP tools for Office document manipulation
11
+ - **Create**: Word (from markdown), Excel (from markdown), PowerPoint, PDF, Email, XML
12
+ - **Read**: DOCX paragraphs/tables, XLSX sheets, PPTX slides, document metadata
13
+ - **Edit**: DOCX paragraphs (edit/insert/delete/search-replace), XLSX cells/rows, PPTX slides (edit/reorder/duplicate/delete)
14
+ - **Convert**: DOCX → PDF
15
+ - **Merge**: Multiple DOCX or PPTX into one
16
+ - **Templates**: DOCX/PPTX with conditionals (`{{#if}}`), loops (`{{#each}}`), variables
17
+ - **Charts**: Excel charts (bar, line, pie, column)
18
+ - **Formatting**: Excel conditional formatting (highlight, color scale, data bar)
19
+ - stdio + streamable-http transport support
20
+ - CLI entry point: `docforge-mcp`
21
+ - CI: lint + test + publish on tag
22
+ - CodeQL security scanning
23
+ - Dependabot for dependencies
24
+
25
+ ### Changed
26
+
27
+ - Rebranded from mcp-ms-office-documents to docforge-mcp
28
+ - Independent project (diverged from ForLegalAI upstream in scope)
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ForLegalAI
4
+ Copyright (c) 2026 Claudio Ferreira Filho
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,24 @@
1
+ # MEMORY.md — docforge-mcp
2
+
3
+ ## Estado Atual (19/mai/2026)
4
+
5
+ - **Versão**: 0.1.0 (pre-release, não publicado no PyPI ainda)
6
+ - **Repo**: https://github.com/filhocf/docforge-mcp
7
+ - **Origem**: Fork de ForLegalAI/mcp-ms-office-documents (MIT), divergiu em escopo
8
+ - **Status**: Funcional, 38 tools, 16 arquivos de teste, CI ativo
9
+
10
+ ## Pendente
11
+
12
+ - [ ] Tag v0.1.0 + publish PyPI (trusted publisher)
13
+ - [ ] Configurar PyPI trusted publisher no GitHub
14
+ - [ ] Atualizar mcp.json local (substituir mcp-ms-office-documents)
15
+ - [ ] Atualizar systemd service (porta 8958)
16
+ - [ ] Gemini Code Assist ativar no repo
17
+
18
+ ## Decisões
19
+
20
+ - Nome: docforge-mcp (PyPI livre, domínio claro)
21
+ - Filosofia: ecossistema completo (criar+ler+editar+converter) vs upstream one-shot
22
+ - Manter PRs #57/#58/#59 no upstream como contribuição pontual
23
+ - Backward compat: CLI `mcp-ms-office-documents` ainda funciona
24
+ - Licença: MIT dual copyright (ForLegalAI + filhocf)
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: docforge-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for complete Office document manipulation — create, read, edit, convert DOCX/XLSX/PPTX/PDF/EML
5
+ Project-URL: Homepage, https://github.com/filhocf/docforge-mcp
6
+ Project-URL: Repository, https://github.com/filhocf/docforge-mcp
7
+ Project-URL: Issues, https://github.com/filhocf/docforge-mcp/issues
8
+ Author-email: Claudio Ferreira Filho <filhocf@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: docforge,documents,docx,mcp,office,pdf,pptx,xlsx
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: beautifulsoup4>=4.13.4
22
+ Requires-Dist: defusedxml>=0.7.1
23
+ Requires-Dist: fastmcp>=3.2.0
24
+ Requires-Dist: fpdf2>=2.8.0
25
+ Requires-Dist: markdown>=3.5
26
+ Requires-Dist: openpyxl>=3.1.2
27
+ Requires-Dist: pydantic>=2.11.5
28
+ Requires-Dist: pystache>=0.6.5
29
+ Requires-Dist: python-docx==1.2.0
30
+ Requires-Dist: python-dotenv>=1.2.1
31
+ Requires-Dist: python-pptx==1.0.2
32
+ Requires-Dist: pyyaml
33
+ Requires-Dist: requests>=2.31.0
34
+ Provides-Extra: cloud
35
+ Requires-Dist: azure-storage-blob>=12.23.1; extra == 'cloud'
36
+ Requires-Dist: boto3>=1.40.1; extra == 'cloud'
37
+ Requires-Dist: botocore>=1.40.1; extra == 'cloud'
38
+ Requires-Dist: google-cloud-storage>=2.18.2; extra == 'cloud'
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest-asyncio>=1.0; extra == 'dev'
41
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
42
+ Requires-Dist: pytest>=8.0; extra == 'dev'
43
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
44
+ Description-Content-Type: text/markdown
45
+
46
+ # docforge-mcp
47
+
48
+ MCP server for **complete Office document manipulation** — create, read, edit, convert, and template DOCX, XLSX, PPTX, PDF, and EML files.
49
+
50
+ Built for AI agents that need full document lifecycle control, not just one-shot generation.
51
+
52
+ ## Install
53
+
54
+ ```bash
55
+ # Via uvx (no install needed)
56
+ uvx docforge-mcp
57
+
58
+ # Or install globally
59
+ uv tool install docforge-mcp
60
+
61
+ # Or pip
62
+ pip install docforge-mcp
63
+ ```
64
+
65
+ ## Tools (38)
66
+
67
+ | Category | Tools | Capabilities |
68
+ |----------|:-----:|--------------|
69
+ | **Word (DOCX)** | 12 | Create from markdown, read, edit paragraphs, insert, delete, search/replace, headers/footers, images, merge, templates |
70
+ | **Excel (XLSX)** | 7 | Create from markdown, read sheets, edit cells, insert/delete rows, charts, conditional formatting |
71
+ | **PowerPoint (PPTX)** | 9 | Create presentations, read slides, edit text, add shapes/images, reorder, duplicate, delete, merge, templates |
72
+ | **PDF** | 3 | Create from markdown, convert DOCX→PDF, read |
73
+ | **Email (EML)** | 1 | Create HTML email drafts |
74
+ | **XML** | 1 | Create well-formed XML |
75
+ | **Templates** | 2 | Render DOCX/PPTX with variables, conditionals (`{{#if}}`), loops (`{{#each}}`) |
76
+ | **Metadata** | 1 | Get document info/stats |
77
+ | **Merge** | 2 | Merge multiple DOCX or PPTX files |
78
+
79
+ ## Usage
80
+
81
+ ### As MCP server (stdio — default)
82
+
83
+ ```bash
84
+ docforge-mcp
85
+ ```
86
+
87
+ ### As HTTP server
88
+
89
+ ```bash
90
+ MCP_TRANSPORT=streamable-http MCP_PORT=8958 docforge-mcp
91
+ ```
92
+
93
+ ### MCP client configuration
94
+
95
+ ```json
96
+ {
97
+ "mcpServers": {
98
+ "office-documents": {
99
+ "command": "docforge-mcp",
100
+ "autoApprove": ["read_document", "get_document_info", "get_docx_paragraphs", "get_pptx_slides", "get_xlsx_sheets"]
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ ## Origins
107
+
108
+ 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:
109
+
110
+ | | ForLegalAI (upstream) | docforge-mcp |
111
+ |---|---|---|
112
+ | **Goal** | One-shot document generation | Full document lifecycle |
113
+ | **Read** | ❌ | ✅ Read any DOCX/XLSX/PPTX |
114
+ | **Edit** | ❌ | ✅ Edit paragraphs, cells, slides |
115
+ | **Convert** | ❌ | ✅ DOCX→PDF |
116
+ | **Templates** | Simple `{{var}}` | Conditionals + loops |
117
+ | **Transport** | Docker + HTTP only | stdio + HTTP |
118
+ | **Install** | Docker | `uvx docforge-mcp` |
119
+
120
+ We continue to contribute compatible features upstream (PRs #57, #58, #59) while developing the full toolkit independently.
121
+
122
+ ## Development
123
+
124
+ ```bash
125
+ git clone https://github.com/filhocf/docforge-mcp.git
126
+ cd docforge-mcp
127
+ uv sync --group dev
128
+ uv run pytest tests/ -v
129
+ uv run ruff check .
130
+ ```
131
+
132
+ ## License
133
+
134
+ MIT — see [LICENSE](LICENSE) for details. Original work © ForLegalAI, extensions © Claudio Ferreira Filho.
@@ -0,0 +1,89 @@
1
+ # docforge-mcp
2
+
3
+ MCP server for **complete Office document manipulation** — create, read, edit, convert, and template DOCX, XLSX, PPTX, PDF, and EML files.
4
+
5
+ Built for AI agents that need full document lifecycle control, not just one-shot generation.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ # Via uvx (no install needed)
11
+ uvx docforge-mcp
12
+
13
+ # Or install globally
14
+ uv tool install docforge-mcp
15
+
16
+ # Or pip
17
+ pip install docforge-mcp
18
+ ```
19
+
20
+ ## Tools (38)
21
+
22
+ | Category | Tools | Capabilities |
23
+ |----------|:-----:|--------------|
24
+ | **Word (DOCX)** | 12 | Create from markdown, read, edit paragraphs, insert, delete, search/replace, headers/footers, images, merge, templates |
25
+ | **Excel (XLSX)** | 7 | Create from markdown, read sheets, edit cells, insert/delete rows, charts, conditional formatting |
26
+ | **PowerPoint (PPTX)** | 9 | Create presentations, read slides, edit text, add shapes/images, reorder, duplicate, delete, merge, templates |
27
+ | **PDF** | 3 | Create from markdown, convert DOCX→PDF, read |
28
+ | **Email (EML)** | 1 | Create HTML email drafts |
29
+ | **XML** | 1 | Create well-formed XML |
30
+ | **Templates** | 2 | Render DOCX/PPTX with variables, conditionals (`{{#if}}`), loops (`{{#each}}`) |
31
+ | **Metadata** | 1 | Get document info/stats |
32
+ | **Merge** | 2 | Merge multiple DOCX or PPTX files |
33
+
34
+ ## Usage
35
+
36
+ ### As MCP server (stdio — default)
37
+
38
+ ```bash
39
+ docforge-mcp
40
+ ```
41
+
42
+ ### As HTTP server
43
+
44
+ ```bash
45
+ MCP_TRANSPORT=streamable-http MCP_PORT=8958 docforge-mcp
46
+ ```
47
+
48
+ ### MCP client configuration
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "office-documents": {
54
+ "command": "docforge-mcp",
55
+ "autoApprove": ["read_document", "get_document_info", "get_docx_paragraphs", "get_pptx_slides", "get_xlsx_sheets"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## Origins
62
+
63
+ 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:
64
+
65
+ | | ForLegalAI (upstream) | docforge-mcp |
66
+ |---|---|---|
67
+ | **Goal** | One-shot document generation | Full document lifecycle |
68
+ | **Read** | ❌ | ✅ Read any DOCX/XLSX/PPTX |
69
+ | **Edit** | ❌ | ✅ Edit paragraphs, cells, slides |
70
+ | **Convert** | ❌ | ✅ DOCX→PDF |
71
+ | **Templates** | Simple `{{var}}` | Conditionals + loops |
72
+ | **Transport** | Docker + HTTP only | stdio + HTTP |
73
+ | **Install** | Docker | `uvx docforge-mcp` |
74
+
75
+ We continue to contribute compatible features upstream (PRs #57, #58, #59) while developing the full toolkit independently.
76
+
77
+ ## Development
78
+
79
+ ```bash
80
+ git clone https://github.com/filhocf/docforge-mcp.git
81
+ cd docforge-mcp
82
+ uv sync --group dev
83
+ uv run pytest tests/ -v
84
+ uv run ruff check .
85
+ ```
86
+
87
+ ## License
88
+
89
+ MIT — see [LICENSE](LICENSE) for details. Original work © ForLegalAI, extensions © Claudio Ferreira Filho.