├── LLM_Export ├── tools │ ├── __init__.py │ └── file_export_server.py ├── docker │ ├── mcpo │ │ ├── tools │ │ │ └── __init__.py │ │ ├── templates │ │ │ ├── Default_Template.docx │ │ │ ├── Default_Template.pptx │ │ │ └── Default_Template.xlsx │ │ ├── requirements.txt │ │ ├── config.json │ │ ├── dockerfile │ │ └── functions │ │ │ └── files_metadata_injector.py │ ├── sse_http │ │ ├── tools │ │ │ └── __init__.py │ │ ├── templates │ │ │ ├── Default_Template.docx │ │ │ ├── Default_Template.pptx │ │ │ └── Default_Template.xlsx │ │ ├── requirements.txt │ │ ├── config.json │ │ ├── dockerfile │ │ └── functions │ │ │ └── files_metadata_injector.py │ └── file_server │ │ ├── dockerfile.server │ │ └── file_export_server.py ├── templates │ ├── Default_Template.docx │ ├── Default_Template.pptx │ └── Default_Template.xlsx ├── requirements.txt ├── Example_docker-compose.yaml └── functions │ └── files_metadata_injector.py ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug_report.yml ├── FUNDING.yml └── workflows │ └── containers.yaml ├── Documentation ├── img │ ├── image.png │ ├── image-1.png │ ├── image-2.png │ ├── image-3.png │ ├── image-4.png │ └── image-5.png ├── HowToUse.md ├── Best_Practices.md ├── HowToConfigure.md └── Prompt_Examples.md ├── LICENSE.txt ├── config.json ├── .gitattributes ├── .gitignore └── README.md /LLM_Export/tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: GlissemanTV 2 | buy_me_a_coffee: Glisseman 3 | -------------------------------------------------------------------------------- /Documentation/img/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/Documentation/img/image.png -------------------------------------------------------------------------------- /Documentation/img/image-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/Documentation/img/image-1.png -------------------------------------------------------------------------------- /Documentation/img/image-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/Documentation/img/image-2.png -------------------------------------------------------------------------------- /Documentation/img/image-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/Documentation/img/image-3.png -------------------------------------------------------------------------------- /Documentation/img/image-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/Documentation/img/image-4.png -------------------------------------------------------------------------------- /Documentation/img/image-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/Documentation/img/image-5.png -------------------------------------------------------------------------------- /LLM_Export/templates/Default_Template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/templates/Default_Template.docx -------------------------------------------------------------------------------- /LLM_Export/templates/Default_Template.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/templates/Default_Template.pptx -------------------------------------------------------------------------------- /LLM_Export/templates/Default_Template.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/templates/Default_Template.xlsx -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/templates/Default_Template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/docker/mcpo/templates/Default_Template.docx -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/templates/Default_Template.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/docker/mcpo/templates/Default_Template.pptx -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/templates/Default_Template.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/docker/mcpo/templates/Default_Template.xlsx -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/templates/Default_Template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/docker/sse_http/templates/Default_Template.docx -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/templates/Default_Template.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/docker/sse_http/templates/Default_Template.pptx -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/templates/Default_Template.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GlisseManTV/MCPO-File-Generation-Tool/HEAD/LLM_Export/docker/sse_http/templates/Default_Template.xlsx -------------------------------------------------------------------------------- /LLM_Export/requirements.txt: -------------------------------------------------------------------------------- 1 | openpyxl 2 | reportlab 3 | mcp 4 | py7zr 5 | fastapi 6 | uvicorn 7 | python-multipart 8 | markdown2 9 | beautifulsoup4 10 | emoji 11 | python-pptx 12 | python-docx 13 | requests 14 | -------------------------------------------------------------------------------- /Documentation/HowToUse.md: -------------------------------------------------------------------------------- 1 | # Hey you're looking at the HowToUse file for this project. 2 | Unfortunately, it's currently empty. 3 | I'll fill it with useful information soon. 4 | If you want to help, feel free to open a PR. 5 | -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/requirements.txt: -------------------------------------------------------------------------------- 1 | openpyxl 2 | reportlab 3 | mcp 4 | py7zr 5 | fastapi 6 | uvicorn 7 | python-multipart 8 | markdown2 9 | beautifulsoup4 10 | emoji 11 | python-pptx 12 | python-docx 13 | requests -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/requirements.txt: -------------------------------------------------------------------------------- 1 | openpyxl 2 | reportlab 3 | mcp 4 | py7zr 5 | fastapi 6 | uvicorn 7 | python-multipart 8 | markdown2 9 | beautifulsoup4 10 | emoji 11 | python-pptx 12 | python-docx 13 | requests -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": { 3 | "file_export": { 4 | "command": "python3.12", 5 | "args": ["-m", "tools.file_export_mcp"], 6 | "env": { 7 | "PYTHONPATH": "/rootPath" 8 | }, 9 | "disabled": false, 10 | "autoApprove": [] 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": { 3 | "file_export": { 4 | "command": "python3.12", 5 | "args": ["-m", "tools.file_export_mcp"], 6 | "env": { 7 | "PYTHONPATH": "/rootPath" 8 | }, 9 | "client_header_forwarding": { 10 | "enabled": true, 11 | "whitelist": ["authorization"], 12 | "debug_headers": true 13 | }, 14 | "disabled": false, 15 | "autoApprove": [] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /LLM_Export/docker/file_server/dockerfile.server: -------------------------------------------------------------------------------- 1 | FROM python:3.12-slim 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends \ 4 | curl \ 5 | && rm -rf /var/lib/apt/lists/* 6 | 7 | WORKDIR /app 8 | 9 | COPY file_export_server.py /app/ 10 | 11 | RUN pip install --no-cache-dir fastapi uvicorn 12 | 13 | ENV EXPORT_DIR=/data/output 14 | 15 | VOLUME ["/data"] 16 | 17 | EXPOSE 9003 18 | 19 | CMD ["sh", "-c", "uvicorn file_export_server:app --host 0.0.0.0 --port 9003"] -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/glissemantv/mcpo:main 2 | 3 | COPY requirements.txt /tmp/requirements.txt 4 | 5 | RUN /app/.venv/bin/python -m ensurepip --upgrade && \ 6 | /app/.venv/bin/python -m pip install --upgrade pip && \ 7 | /app/.venv/bin/python -m pip install --no-cache-dir -r /tmp/requirements.txt 8 | 9 | RUN mkdir -p /rootPath 10 | COPY config.json /rootPath 11 | COPY tools /rootPath/tools 12 | COPY templates /rootPath/templates 13 | COPY functions /rootPath/functions 14 | 15 | ENTRYPOINT [] 16 | CMD mcpo --type http --host 0.0.0.0 --port 8000 --config /rootPath/config.json -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | WORKDIR /rootPath 4 | 5 | RUN apt-get update && apt-get install -y \ 6 | build-essential \ 7 | libjpeg-dev \ 8 | zlib1g-dev \ 9 | libpng-dev \ 10 | libxml2-dev \ 11 | libxslt1-dev \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN pip install --no-cache-dir \ 15 | requests \ 16 | python-docx \ 17 | python-pptx \ 18 | openpyxl \ 19 | reportlab \ 20 | beautifulsoup4 \ 21 | markdown2 \ 22 | emoji \ 23 | py7zr \ 24 | uvicorn \ 25 | starlette \ 26 | pillow \ 27 | mcp[fastmcp] 28 | 29 | COPY config.json /rootPath 30 | COPY tools /rootPath/tools 31 | COPY templates /rootPath/templates 32 | COPY functions /rootPath/functions 33 | 34 | RUN mkdir -p /rootPath/output 35 | 36 | EXPOSE 9004 37 | 38 | CMD ["python", "/rootPath/tools/file_export_mcp.py", "--no-color"] 39 | -------------------------------------------------------------------------------- /LLM_Export/docker/file_server/file_export_server.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, HTTPException 2 | from fastapi.staticfiles import StaticFiles 3 | from fastapi.responses import FileResponse 4 | import uvicorn 5 | import os 6 | import pathlib 7 | 8 | EXPORT_DIR_ENV = os.getenv("FILE_EXPORT_DIR") 9 | EXPORT_DIR = (EXPORT_DIR_ENV or r"/output").rstrip("/") 10 | os.makedirs(EXPORT_DIR, exist_ok=True) 11 | 12 | app = FastAPI() 13 | 14 | @app.get("/files/{folder_name}/{filename}") 15 | async def serve_file(folder_name: str, filename: str): 16 | file_path = os.path.join(EXPORT_DIR, folder_name, filename) 17 | if not os.path.isfile(file_path): 18 | raise HTTPException(status_code=404, detail="File not found") 19 | return FileResponse( 20 | path=file_path, 21 | media_type='application/octet-stream', 22 | filename=filename, 23 | headers={"Content-Disposition": f"attachment; filename={filename}"} 24 | ) 25 | 26 | app.mount("/files", StaticFiles(directory=EXPORT_DIR), name="files") 27 | 28 | if __name__ == "__main__": 29 | uvicorn.run(app, host="0.0.0.0", port=9003) -------------------------------------------------------------------------------- /LLM_Export/tools/file_export_server.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI, HTTPException 2 | from fastapi.staticfiles import StaticFiles 3 | from fastapi.responses import FileResponse 4 | import uvicorn 5 | import os 6 | import pathlib 7 | 8 | EXPORT_DIR_ENV = os.getenv("FILE_EXPORT_DIR") 9 | EXPORT_DIR = (EXPORT_DIR_ENV or r"C:\temp\output").rstrip("/") 10 | 11 | os.makedirs(EXPORT_DIR, exist_ok=True) 12 | 13 | app = FastAPI() 14 | 15 | @app.get("/files/{folder_name}/{filename}") 16 | async def serve_file(folder_name: str, filename: str): 17 | file_path = os.path.join(EXPORT_DIR, folder_name, filename) 18 | if not os.path.isfile(file_path): 19 | raise HTTPException(status_code=404, detail="File not found") 20 | return FileResponse( 21 | path=file_path, 22 | media_type='application/octet-stream', 23 | filename=filename, 24 | headers={"Content-Disposition": f"attachment; filename={filename}"} 25 | ) 26 | 27 | app.mount("/files", StaticFiles(directory=EXPORT_DIR), name="files") 28 | 29 | if __name__ == "__main__": 30 | uvicorn.run(app, host="0.0.0.0", port=9003) -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": { 3 | "file_export": { 4 | "command": "python", 5 | "args": [ 6 | "-m", 7 | "tools.file_export_mcp" 8 | ], 9 | "env": { 10 | "PYTHONPATH": "C:\\temp\\LLM_Export", 11 | "FILE_EXPORT_BASE_URL": "http://localhost:9003/files", 12 | "FILE_EXPORT_DIR": "C:\\temp\\LLM_Export\\output", 13 | "MCPO_API_KEY": "top-secret", 14 | "PERSISTENT_FILES": "true", 15 | "FILES_DELAY": "1", 16 | "LOG_LEVEL": "DEBUG", 17 | "UNSPLASH_ACCESS_KEY": "top-secret", 18 | "IMAGE_SOURCE": "local_sd", 19 | "LOCAL_SD_URL": "http://localhost:7860", 20 | "LOCAL_SD_USERNAME": "user", 21 | "LOCAL_SD_PASSWORD": "password", 22 | "LOCAL_SD_MODEL": "sd_xl_base_1.0.safetensors", 23 | "LOCAL_SD_STEPS": "20", 24 | "LOCAL_SD_WIDTH": "512", 25 | "LOCAL_SD_HEIGHT": "512", 26 | "LOCAL_SD_CFG_SCALE": "1.5", 27 | "LOCAL_SD_SCHEDULER": "Karras", 28 | "LOCAL_SD_SAMPLER": "Euler a", 29 | "OWUI_URL": "http://localhost:3000", 30 | "JWT_TOKEN": "top-secret", 31 | "MODE": "sse" or "http" or empty 32 | }, 33 | "disabled": false, 34 | "autoApprove": [] 35 | } 36 | }, 37 | "logLevel": "DEBUG" 38 | } -------------------------------------------------------------------------------- /LLM_Export/Example_docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | file-export-server: 4 | image: ghcr.io/glissemantv/owui-file-export-server:latest 5 | container_name: file-export-server 6 | environment: 7 | - FILE_EXPORT_DIR=/output 8 | ports: 9 | - "9003:9003" 10 | volumes: 11 | - /your/export-data:/output 12 | 13 | owui-mcpo: 14 | image: ghcr.io/glissemantv/owui-mcpo:latest 15 | container_name: owui-mcpo 16 | environment: 17 | - FILE_EXPORT_BASE_URL=http://file-export-server:9003/files 18 | - FILE_EXPORT_DIR=/output 19 | - MCPO_API_KEY=top-secret 20 | - PERSISTENT_FILES=true 21 | - FILES_DELAY=1 22 | - LOG_LEVEL=DEBUG 23 | - UNSPLASH_ACCESS_KEY=your-unsplash-access-key 24 | - IMAGE_SOURCE=local_sd 25 | - LOCAL_SD_URL=http://localhost:7860 26 | - LOCAL_SD_USERNAME=local_user 27 | - LOCAL_SD_PASSWORD=local_password 28 | - LOCAL_SD_DEFAULT_MODEL=sd_xl_base_1.0.safetensors 29 | - LOCAL_SD_STEPS=20 30 | - LOCAL_SD_WIDTH=512 31 | - LOCAL_SD_HEIGHT=512 32 | - LOCAL_SD_CFG_SCALE=1.5 33 | - LOCAL_SD_SCHEDULER=Karras 34 | - LOCAL_SD_SAMPLE=Euler a 35 | - DOCS_TEMPLATE_DIR=/docs_templates 36 | - PEXELS_ACCESS_KEY="" 37 | - OWUI_URL=http://localhost:3000 38 | - JWT_TOKEN=top-secret 39 | ports: 40 | - "8000:8000" #<= builtin MCPO 41 | - "9004:9004" #<= SSE server 42 | restart: unless-stopped 43 | volumes: 44 | - /your/export-data:/output 45 | depends_on: 46 | - file-export-server -------------------------------------------------------------------------------- /LLM_Export/functions/files_metadata_injector.py: -------------------------------------------------------------------------------- 1 | """ 2 | title: Files Metadata Injector 3 | author: GlissemanTV 4 | version: 1.0.0 5 | description: Automatically injects file metadata so that tools can use them 6 | """ 7 | 8 | from typing import Optional 9 | from pydantic import BaseModel, Field 10 | 11 | 12 | class Filter: 13 | class Valves(BaseModel): 14 | priority: int = Field( 15 | default=0, 16 | description="Filter priority (the lower the number, the sooner it runs)", 17 | ) 18 | enabled: bool = Field( 19 | default=True, description="Activates or deactivates the filter" 20 | ) 21 | 22 | def __init__(self): 23 | self.valves = self.Valves() 24 | 25 | def inlet( 26 | self, body: dict, __user__: Optional[dict] = None, __event_emitter__=None 27 | ) -> dict: 28 | """ 29 | Injects file metadata into the context so that tools can use it 30 | """ 31 | 32 | if not self.valves.enabled: 33 | return body 34 | 35 | files = body.get("files", []) 36 | 37 | if not files: 38 | return body 39 | 40 | files_metadata = { 41 | "files": [{"id": f.get("id"), "name": f.get("name")} for f in files] 42 | } 43 | 44 | metadata_message = ( 45 | f"[SYSTEM CONTEXT - Files Available]\n" 46 | f"The following files are available in this conversation:\n" 47 | f"Files count: {len(files_metadata['files'])}\n" 48 | f"Files list: {', '.join([f['name'] for f in files_metadata['files']])}\n\n" 49 | f"File metadata for tools:\n{files_metadata}\n" 50 | f"[END SYSTEM CONTEXT]\n\n" 51 | f"You can now call the appropriate tools to process these files." 52 | ) 53 | 54 | messages = body.get("messages", []) 55 | 56 | if messages and not any( 57 | "[SYSTEM CONTEXT - Files Available]" in msg.get("content", "") 58 | for msg in messages 59 | ): 60 | 61 | messages.insert(0, {"role": "system", "content": metadata_message}) 62 | 63 | body["messages"] = messages 64 | 65 | return body -------------------------------------------------------------------------------- /LLM_Export/docker/mcpo/functions/files_metadata_injector.py: -------------------------------------------------------------------------------- 1 | """ 2 | title: Files Metadata Injector 3 | author: GlissemanTV 4 | version: 1.0.0 5 | description: Automatically injects file metadata so that tools can use them 6 | """ 7 | 8 | from typing import Optional 9 | from pydantic import BaseModel, Field 10 | 11 | 12 | class Filter: 13 | class Valves(BaseModel): 14 | priority: int = Field( 15 | default=0, 16 | description="Filter priority (the lower the number, the sooner it runs)", 17 | ) 18 | enabled: bool = Field( 19 | default=True, description="Activates or deactivates the filter" 20 | ) 21 | 22 | def __init__(self): 23 | self.valves = self.Valves() 24 | 25 | def inlet( 26 | self, body: dict, __user__: Optional[dict] = None, __event_emitter__=None 27 | ) -> dict: 28 | """ 29 | Injects file metadata into the context so that tools can use it 30 | """ 31 | 32 | if not self.valves.enabled: 33 | return body 34 | 35 | files = body.get("files", []) 36 | 37 | if not files: 38 | return body 39 | 40 | files_metadata = { 41 | "files": [{"id": f.get("id"), "name": f.get("name")} for f in files] 42 | } 43 | 44 | metadata_message = ( 45 | f"[SYSTEM CONTEXT - Files Available]\n" 46 | f"The following files are available in this conversation:\n" 47 | f"Files count: {len(files_metadata['files'])}\n" 48 | f"Files list: {', '.join([f['name'] for f in files_metadata['files']])}\n\n" 49 | f"File metadata for tools:\n{files_metadata}\n" 50 | f"[END SYSTEM CONTEXT]\n\n" 51 | f"You can now call the appropriate tools to process these files." 52 | ) 53 | 54 | messages = body.get("messages", []) 55 | 56 | if messages and not any( 57 | "[SYSTEM CONTEXT - Files Available]" in msg.get("content", "") 58 | for msg in messages 59 | ): 60 | 61 | messages.insert(0, {"role": "system", "content": metadata_message}) 62 | 63 | body["messages"] = messages 64 | 65 | return body -------------------------------------------------------------------------------- /LLM_Export/docker/sse_http/functions/files_metadata_injector.py: -------------------------------------------------------------------------------- 1 | """ 2 | title: Files Metadata Injector 3 | author: GlissemanTV 4 | version: 1.0.0 5 | description: Automatically injects file metadata so that tools can use them 6 | """ 7 | 8 | from typing import Optional 9 | from pydantic import BaseModel, Field 10 | 11 | 12 | class Filter: 13 | class Valves(BaseModel): 14 | priority: int = Field( 15 | default=0, 16 | description="Filter priority (the lower the number, the sooner it runs)", 17 | ) 18 | enabled: bool = Field( 19 | default=True, description="Activates or deactivates the filter" 20 | ) 21 | 22 | def __init__(self): 23 | self.valves = self.Valves() 24 | 25 | def inlet( 26 | self, body: dict, __user__: Optional[dict] = None, __event_emitter__=None 27 | ) -> dict: 28 | """ 29 | Injects file metadata into the context so that tools can use it 30 | """ 31 | 32 | if not self.valves.enabled: 33 | return body 34 | 35 | files = body.get("files", []) 36 | 37 | if not files: 38 | return body 39 | 40 | files_metadata = { 41 | "files": [{"id": f.get("id"), "name": f.get("name")} for f in files] 42 | } 43 | 44 | metadata_message = ( 45 | f"[SYSTEM CONTEXT - Files Available]\n" 46 | f"The following files are available in this conversation:\n" 47 | f"Files count: {len(files_metadata['files'])}\n" 48 | f"Files list: {', '.join([f['name'] for f in files_metadata['files']])}\n\n" 49 | f"File metadata for tools:\n{files_metadata}\n" 50 | f"[END SYSTEM CONTEXT]\n\n" 51 | f"You can now call the appropriate tools to process these files." 52 | ) 53 | 54 | messages = body.get("messages", []) 55 | 56 | if messages and not any( 57 | "[SYSTEM CONTEXT - Files Available]" in msg.get("content", "") 58 | for msg in messages 59 | ): 60 | 61 | messages.insert(0, {"role": "system", "content": metadata_message}) 62 | 63 | body["messages"] = messages 64 | 65 | return body -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/workflows/containers.yaml: -------------------------------------------------------------------------------- 1 | name: Build & Push GHCR images 2 | 3 | on: 4 | push: 5 | branches: [ master, main, dev, alpha, beta, release-candidate ] 6 | tags: [ 'v*' ] 7 | workflow_dispatch: 8 | 9 | permissions: 10 | contents: read 11 | packages: write 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | strategy: 17 | matrix: 18 | include: 19 | - name: file-export-server 20 | context: LLM_Export/docker/file_server 21 | dockerfile: LLM_Export/docker/file_server/dockerfile.server 22 | image: ghcr.io/${{ github.repository_owner }}/owui-file-export-server 23 | - name: mcpo 24 | context: LLM_Export/docker/mcpo 25 | dockerfile: LLM_Export/docker/mcpo/dockerfile 26 | image: ghcr.io/${{ github.repository_owner }}/owui-mcpo 27 | - name: sse_http 28 | context: LLM_Export/docker/sse_http 29 | dockerfile: LLM_Export/docker/sse_http/dockerfile 30 | image: ghcr.io/${{ github.repository_owner }}/file-gen-sse-http 31 | steps: 32 | - uses: actions/checkout@v4 33 | with: 34 | fetch-depth: 0 35 | submodules: true 36 | 37 | - name: Sanity check paths 38 | run: | 39 | pwd 40 | ls -la 41 | echo "---- LLM_Export ----" 42 | ls -la LLM_Export || true 43 | ls -la LLM_Export/docker || true 44 | ls -la LLM_Export/docker/file_server || true 45 | ls -la LLM_Export/docker/mcpo || true 46 | ls -la LLM_Export/docker/sse_http || true 47 | 48 | - uses: docker/setup-qemu-action@v3 49 | - uses: docker/setup-buildx-action@v3 50 | 51 | - name: Login to GHCR 52 | uses: docker/login-action@v3 53 | with: 54 | registry: ghcr.io 55 | username: ${{ github.actor }} 56 | password: ${{ secrets.GITHUB_TOKEN }} 57 | 58 | - id: meta 59 | uses: docker/metadata-action@v5 60 | with: 61 | images: ${{ matrix.image }} 62 | tags: | 63 | type=raw,value=latest,enable={{is_default_branch}} 64 | type=sha,format=short 65 | type=ref,event=tag 66 | type=raw,value=alpha-latest,enable=${{github.ref == 'refs/heads/alpha'}} 67 | type=raw,value=beta-latest,enable=${{github.ref == 'refs/heads/beta'}} 68 | type=raw,value=dev-latest,enable=${{github.ref == 'refs/heads/dev'}} 69 | type=raw,value=rc-latest,enable=${{github.ref == 'refs/heads/release-candidate'}} 70 | 71 | 72 | - name: Build & Push (${{ matrix.name }}) 73 | uses: docker/build-push-action@v6 74 | with: 75 | context: ${{ matrix.context }} 76 | file: ${{ matrix.dockerfile }} 77 | push: true 78 | platforms: linux/amd64,linux/arm64 79 | tags: ${{ steps.meta.outputs.tags }} 80 | labels: ${{ steps.meta.outputs.labels }} 81 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report for the project. 3 | title: "[BUG] " 4 | labels: ["bug", "triage"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out this bug report! 10 | Please provide as much detail as possible to help us resolve the issue. 11 | 12 | - type: dropdown 13 | id: runner 14 | attributes: 15 | label: Runner 16 | description: How are you using the service? 17 | options: 18 | - Docker 19 | - Python 20 | validations: 21 | required: true 22 | 23 | - type: dropdown 24 | id: used-way 25 | attributes: 26 | label: Protocol 27 | description: What protocol are you using? 28 | options: 29 | - SSE 30 | - Python 31 | - Built in MCPO 32 | validations: 33 | required: true 34 | 35 | - type: dropdown 36 | id: sse-call-type 37 | attributes: 38 | label: SSE Call Type 39 | description: If you selected SSE above, what type of call are you using? 40 | options: 41 | - Direct in Open WebUI (0.6.33+) 42 | - External MCP server 43 | 44 | - type: input 45 | id: external-server 46 | attributes: 47 | label: External MCP Server 48 | description: If you selected "External MCP server" above, please specify which server you are using. 49 | placeholder: ex. server-type 50 | 51 | - type: dropdown 52 | id: image-provider 53 | attributes: 54 | label: Image Provider 55 | description: Which image provider are you using? 56 | options: 57 | - Pexels 58 | - SDUI 59 | - Unsplash 60 | - No Image provider 61 | validations: 62 | required: true 63 | 64 | - type: dropdown 65 | id: branch 66 | attributes: 67 | label: Branch 68 | description: Which branch are you using? 69 | options: 70 | - latest 71 | - dev-latest 72 | - alpha-latest 73 | - beta-latest 74 | - rc-latest 75 | default: 0 76 | validations: 77 | required: true 78 | 79 | - type: input 80 | id: version 81 | attributes: 82 | label: Version 83 | description: Which version are you using? 84 | placeholder: ex. v0.7.0 (You'll find this information in docker starting logs) 85 | validations: 86 | required: true 87 | 88 | - type: checkboxes 89 | id: pre-submission-checks 90 | attributes: 91 | label: Pre-submission Checklist 92 | description: Please confirm the following before submitting your bug report. 93 | options: 94 | - label: I have used the example prompt 95 | required: false 96 | - label: I have read the recommendations 97 | required: false 98 | - label: I have searched existing open issues 99 | required: false 100 | 101 | - type: textarea 102 | id: what-happened 103 | attributes: 104 | label: What happened? 105 | description: Describe the bug you encountered. 106 | placeholder: Tell us what you see! 107 | validations: 108 | required: true 109 | 110 | - type: textarea 111 | id: reproduction-steps 112 | attributes: 113 | label: How to reproduce? 114 | description: Provide step-by-step instructions to reproduce the issue. 115 | placeholder: | 116 | 1. Go to '...' 117 | 2. Click on '...' 118 | 3. Scroll down to '...' 119 | 4. See error 120 | validations: 121 | required: true 122 | 123 | - type: textarea 124 | id: expected-behavior 125 | attributes: 126 | label: What should happen? 127 | description: Describe what you expected to happen instead. 128 | placeholder: Tell us what the expected behavior is. 129 | validations: 130 | required: true 131 | 132 | - type: textarea 133 | id: logs-screenshots 134 | attributes: 135 | label: Logs & Screenshots 136 | description: Please provide any relevant log output or screenshots. Logs will be automatically formatted into code. 137 | placeholder: Paste logs or drag and drop screenshots here. 138 | render: shell 139 | -------------------------------------------------------------------------------- /Documentation/Best_Practices.md: -------------------------------------------------------------------------------- 1 | # 📂 File Generation & Archive Management System 2 | 3 | 🚀 A powerful, automated system to create, organize, and package files — from simple documents to full project archives — all in one go. 4 | 5 | Whether you're building a project, generating reports, or archiving assets, this tool handles everything with precision, consistency, and elegance. Perfect for developers, content creators, and teams who value clean, reusable workflows. 6 | 7 | --- 8 | 9 | ## 🛠️ Available Tools 10 | 11 | | Tool | Purpose | Format | 12 | |------|--------|--------| 13 | | `create_excel` | **Generate Excel files from arrays** | `.xlsx` | 14 | | `create_csv` | **Create CSV files from structured data** | `.csv` | 15 | | `create_pdf` | **Turn content into polished PDFs** | `.pdf` | 16 | | `create_word` | **Build Word documents with rich formatting** | `.docx` | 17 | | `create_file` | **Output any text-based file** (`.py`, `.html`, `.json`, `.xml`, `.md`, etc.) | Any | 18 | | `create_presentation` | **Build dynamic presentations** | `.pptx` | 19 | | `generate_and_archive` | **Pack multiple files into a single `.zip`, `.tar.gz`, or `.7z` archive** | `.zip`, `.tar.gz`, `.7z` | 20 | | `edit_document` | **Edit existing files in-place** | `.docx`, `.xlsx`, `.pptx` | 21 | | `review_document` | **Review and suggest improvements to existing files** | `.docx`, `.xlsx`, `.pptx`| 22 | 23 | > 🔥 **Pro Tip**: Always use `generate_and_archive` when bundling multiple files — never mix individual creators! 24 | 25 | --- 26 | 27 | ## 📁 Example: .NET Console Project Structure 28 | 29 | ```bash 30 | FactorialConsoleApp/ 31 | ├── FactorialConsoleApp.sln 32 | └── FactorialConsoleApp/ 33 | ├── FactorialConsoleApp.csproj 34 | ├── Program.cs 35 | └── Properties/ 36 | └── launchSettings.json 37 | ``` 38 | 39 | Clean, scalable, and ready for deployment. 🚀 40 | 41 | --- 42 | 43 | ## 🎨 Create a Presentation with Images 44 | 45 | > 🎯 *"Generate me a PPTX presentation, with an image inside, on the theme of food."* 46 | 47 | ✅ Automatically: 48 | - Creates 3+ slides with titles and content 49 | - Inserts relevant images from Unsplash 50 | - Applies a cohesive design theme 51 | - Delivers a polished `.pptx` file — ready to present! 🍽️✨ 52 | 53 | --- 54 | 55 | ## 📄 Create a PDF with Visuals & Structure 56 | 57 | > 📝 *"Generate me a PDF file, with images inside, on the theme of food."* 58 | 59 | ✅ Automatically: 60 | - Uses Markdown formatting (headings, lists, sections) 61 | - Embeds high-quality images from Unsplash 62 | - Outputs a professional, readable document — ideal for reports or portfolios 📊🖼️ 63 | 64 | --- 65 | 66 | ## 📦 Create a `tar.gz` Archive with Multiple Files 67 | 68 | > 📌 *"Hi, create 2 files (1 PDF and 1 PPTX) in a tar.gz archive on the theme of modern food."* 69 | 70 | ### ✅ PDF Requirements: 71 | - Markdown with titles, subtitles, and bullet points 72 | - Images (e.g., `image_query: modern food innovation`) 73 | 74 | ### ✅ PPTX Requirements: 75 | - At least 3 slides 76 | - Each with a title and descriptive content 77 | - An image on each slide 78 | - Title: **"Modern Food: Innovation and Sustainability"** 79 | 80 | 📦 The result? A single, compressed `.tar.gz` file — perfect for sharing or deployment. 🔗 81 | 82 | --- 83 | 84 | ## 📚 Summarise a Topic in a PDF 85 | 86 | > 📝 *"Summarise the subject in a PDF file."* 87 | > 📝 *"Summarise the topic for me in a PDF file with images."* 88 | 89 | ✅ Automatically: 90 | - Extracts key points 91 | - Structures content clearly 92 | - Adds visuals where relevant 93 | - Delivers a professional, ready-to-use document in minutes 📄✨ 94 | 95 | --- 96 | 97 | ## ✅ Key Rules & Best Practices 98 | 99 | - 🚫 **Never use** `create_file`, `create_csv`, etc. **before** `generate_and_archive` — it’s strictly forbidden. 100 | - ✅ Always use `generate_and_archive` for **any** multi-file packaging. 101 | - 🖼️ Image queries like `![Search](image_query: nature landscape)` are fetched automatically from Unsplash. 102 | - 🔐 File persistence: `persistent=True` (keeps files forever) or `persistent=False` (auto-delete). 103 | - 🔗 The **only** valid download link is provided by the tool — no fake paths! 104 | 105 | --- 106 | 107 | ## 🌟 Why This Tool? 108 | 109 | - ✅ **Automated & Reliable** – No manual file handling. 110 | - ✅ **Consistent & Scalable** – Works the same for 1 file or 100. 111 | - ✅ **Visual & Professional** – Outputs polished, presentation-ready files. 112 | 113 | --- 114 | 115 | ## 📌 Get Started 116 | 117 | Just define your files, choose the right tool, and let the system do the rest. 118 | Your project, your rules — all in one powerful workflow. 🚀 119 | 120 | ## Prompt examples here: [Prompt_Examples.md](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Prompt_Examples.md) 121 | 122 | --- 123 | 124 | 📌 **Made with ❤️ for developers, creators, and teams who want to work smarter — not harder.** -------------------------------------------------------------------------------- /Documentation/HowToConfigure.md: -------------------------------------------------------------------------------- 1 | # Docker (recommended) 2 | ## builtin MCPO server 3 | ### Configure the tool 4 | - Pull image with wanted tag 5 | - configure with env variables 6 | ```yaml 7 | services: 8 | file-export-server: 9 | image: ghcr.io/glissemantv/owui-file-export-server:latest 10 | container_name: file-export-server 11 | environment: 12 | - FILE_EXPORT_DIR=/output 13 | ports: 14 | - "yourport:9003" 15 | volumes: 16 | - /your/export-data:/output # <==must match with the folder where the gen-server will build files 17 | 18 | owui-mcpo: 19 | image: ghcr.io/glissemantv/owui-mcpo:latest 20 | container_name: owui-mcpo 21 | environment: 22 | - FILE_EXPORT_BASE_URL=http://file-export-server:9003/files # <== this url must point to file-export-server:yourport/files above 23 | - FILE_EXPORT_DIR=/output 24 | - PERSISTENT_FILES=true 25 | - FILES_DELAY=1 26 | - LOG_LEVEL=INFO 27 | - UNSPLASH_ACCESS_KEY=top-secret 28 | - IMAGE_SOURCE=local_sd 29 | - LOCAL_SD_URL=http://localhost:7860 30 | - LOCAL_SD_USERNAME=local_user 31 | - LOCAL_SD_PASSWORD=local_password 32 | - LOCAL_SD_DEFAULT_MODEL=sd_xl_base_1.0.safetensors 33 | - LOCAL_SD_STEPS=20 34 | - LOCAL_SD_WIDTH=512 35 | - LOCAL_SD_HEIGHT=512 36 | - LOCAL_SD_CFG_SCALE=1.5 37 | - LOCAL_SD_SCHEDULER=Karras 38 | - LOCAL_SD_SAMPLE=Euler a 39 | - OWUI_URL=http://localhost:8000 40 | ports: 41 | - "yourport:8000" 42 | restart: unless-stopped 43 | volumes: 44 | - /your/export-data:/output # <==must match with the folder where the file-server will host files 45 | depends_on: 46 | - file-export-server 47 | ``` 48 | ### Configure Open WebUI 49 | 1. Go to Admin settings \ Settings 50 | 1. General 51 | 1. Check "Enable API Key" 52 | 2. External tools 53 | 1. Add new tool 54 | 2. Follow the insctruction below 55 | 56 | **Auth must be "Session"** 57 | 58 | ![alt text](img/image.png) 59 | 60 | 2. Go to Admin settings \ Functions 61 | 1. Create a new function 62 | 1. Copy the whole content of this [file](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/LLM_Export/functions/files_metadata_injector.py) and replace the default function content 63 | 2. Name the function "Get_files_metadata" (or another one but must match your model prompt) 64 | 3. Click Save 65 | 2. Enable the function 66 | 1. You can enable it globally because the token count is not very high, even if the tool is not used. 67 | 68 | 3. User settings 69 | 1. Account 70 | 1. Generate new API key if not already done so 71 | 72 | ![alt text](img/image-4.png) 73 | 74 | 75 | 76 | ## SSE / HTTP transport server 77 | ### Configure the tool 78 | - Pull image with wanted tag 79 | - configure with env variables 80 | ```yaml 81 | services: 82 | file-export-server: 83 | image: ghcr.io/glissemantv/owui-file-export-server:latest 84 | container_name: file-export-server 85 | environment: 86 | - FILE_EXPORT_DIR=/output 87 | ports: 88 | - "yourport:9003" 89 | volumes: 90 | - /your/export-data:/output # <==must match with the folder where the gen-server will build files 91 | 92 | owui-mcpo: 93 | image: ghcr.io/glissemantv/file-gen-sse-http:latest 94 | container_name: owui-mcpo 95 | environment: 96 | - FILE_EXPORT_BASE_URL=http://file-export-server:9003/files # <== this url must point to file-export-server:yourport/files above 97 | - FILE_EXPORT_DIR=/output 98 | - PERSISTENT_FILES=true 99 | - FILES_DELAY=1 100 | - LOG_LEVEL=INFO 101 | - UNSPLASH_ACCESS_KEY=top-secret 102 | - IMAGE_SOURCE=local_sd 103 | - LOCAL_SD_URL=http://localhost:7860 104 | - LOCAL_SD_USERNAME=local_user 105 | - LOCAL_SD_PASSWORD=local_password 106 | - LOCAL_SD_DEFAULT_MODEL=sd_xl_base_1.0.safetensors 107 | - LOCAL_SD_STEPS=20 108 | - LOCAL_SD_WIDTH=512 109 | - LOCAL_SD_HEIGHT=512 110 | - LOCAL_SD_CFG_SCALE=1.5 111 | - LOCAL_SD_SCHEDULER=Karras 112 | - LOCAL_SD_SAMPLE=Euler a 113 | - OWUI_URL=http://localhost:8000 114 | - OWUI_JWT_TOKEN=jwt-token-h # (only for edit/review used behind an external mcpo server / no longer used if you are using SSE/HTTP direct in OWUI) 115 | ports: 116 | - "yourport:9004" 117 | restart: unless-stopped 118 | volumes: 119 | - /your/export-data:/output # <==must match with the folder where the file-server will host files 120 | depends_on: 121 | - file-export-server 122 | ``` 123 | ### Configure Open WebUI 124 | 1. Go to Admin settings \ Settings 125 | 1. General 126 | 1. Check "Enable API Key" 127 | 2. External tools 128 | 1. Add new tool 129 | 2. Follow the insctruction below 130 | - For SSE, use /sse endpoint 131 | - for http, use /mcp endpoint 132 | 133 | **Auth must be "Session"** 134 | ![alt text](img/image-3.png)![alt text](img/image-2.png) 135 | 136 | 2. Go to Admin settings \ Functions 137 | 1. Create a new function 138 | 1. Copy the whole content of this [file](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/LLM_Export/functions/files_metadata_injector.py) and replace the default function content 139 | 2. Name the function "Get_files_metadata" (or another one but must match your model prompt) 140 | 3. Click Save 141 | 2. Enable the function 142 | 1. You can enable it globally because the token count is not very high, even if the tool is not used. 143 | 144 | 3. User settings 145 | 1. Account 146 | 1. Generate new API key if not already done so 147 | 148 | ![alt text](img/image-5.png) 149 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd 364 | /LLM_Export/docker/File_Server.txt 365 | /LLM_Export/docker/mcp_Server.txt 366 | /ion = ($versionInfo  ConvertFrom-Json).MajorMinorPatch 367 | /ion = v 368 | /_oldGitVersion.yml 369 | 370 | /LLM_Export/Documentation/image.png 371 | /LLM_Export/Documentation/image-1.png 372 | /LLM_Export/Documentation/image-2.png 373 | /LLM_Export/Documentation/image-3.png 374 | /LLM_Export/Documentation/image-4.png 375 | /LLM_Export/Documentation/image-5.png -------------------------------------------------------------------------------- /Documentation/Prompt_Examples.md: -------------------------------------------------------------------------------- 1 | # In this section, you'll find various prompt examples for different tasks. 2 | 3 | ## Best practices here: [Best_Practices.md](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Best_Practices.md) 4 | 5 | ## Model Prompt 6 | 7 | I got good results with the following prompt: 8 | ``` 9 | 📂 File generation (tool `file_export`) 10 | - Available tools: 11 | - `create_file(data, persistent=True)` → generates a single file from a `data` object. 12 | - `generate_and_archive(files_data, archive_format="zip", archive_name=None, persistent=True)` → generates multiple files of various types and archives them into a single `.zip`, `.tar.gz`, or `.7z` file. 13 | - Absolute fundamental rules: 14 | 1. **Strict prohibition of any archive generation, except for explicit and clear user request.** 15 | - If the user does not explicitly mention the words "archive", "zip", "tar", "7z", **never use `generate_and_archive`.** 16 | - Even if multiple files are requested, **never automatically create an archive.** 17 | 2. **If a single output is requested → use `create_file(data, persistent=...)`.** 18 | - Never use `generate_and_archive` without explicit request. 19 | 3. **If multiple files are requested without mention of an archive → create each file individually with `create_file`, without grouping them.** 20 | - Never create an archive by default, even for "project", "report", "document", "presentation", etc. 21 | 4. **Golden rule:** 22 | - **Archives are only allowed if the user explicitly says:** 23 | - "Generate an archive", 24 | - "Create a compressed folder", 25 | - "Pack all files", 26 | - "Send everything in a zip", 27 | - or any equivalent phrasing clearly indicating an intent to group into an archive. 28 | - Otherwise, **any attempt to use `generate_and_archive` is forbidden.** 29 | 5. **Structure of `data` for `create_file`:** 30 | - `format` (str, required): file extension (e.g., `"pdf"`, `"docx"`, `"pptx"`, `"xlsx"`, `"csv"`, `"txt"`, `"xml"`, `"py"`, `"json"`, etc.) 31 | - `filename` (str, optional): file name with extension. If omitted, a generated name will be used. 32 | - `content` (any): file content, depending on format: 33 | - For `pdf`, `docx`, `pptx`: list of dictionaries or text strings. 34 | - For `xlsx`, `csv`: list of lists (tables). 35 | - For `txt`, `py`, `cs`, `xml`, `json`, `md`: text string. 36 | - For `xml`: if content does not start with ``, this declaration will be added automatically. 37 | - `title` (str, optional): used for presentations or structured documents. 38 | - `slides_data` (list[dict], optional): for `.pptx`, contains slides (see below). 39 | 6. **Structure of `files_data` for `generate_and_archive`:** 40 | - List of objects, each containing: 41 | - `filename` (str, required): file name with extension (e.g., `"report.pdf"`, `"slides.pptx"`, `"data.csv"`). 42 | - `format` (str, required): file type (must match extension). 43 | - `content` (any): file content (see below for type-specific details). 44 | - `title` (str, optional): for files like `pdf`, `pptx`, `docx`. 45 | - `slides_data` (list[dict], optional): for `.pptx` (see below). 46 | ⚠️ Special rule for `pptx`, `docx`, `pdf`: 47 | - Even if multiple slides, paragraphs, sections, or elements are defined, 48 | this always constitutes **a single file**. 49 | - Therefore, use **exclusively `create_file`** to generate a `.pptx`, `.docx`, or `.pdf`. 50 | - Never use `generate_and_archive` for these formats, unless the user explicitly requests 51 | an **archive containing multiple distinct documents**. 52 | 7. **For presentations `.pptx` (`slides_data`):** 53 | - Each slide is a dictionary with: 54 | - `title` (str): slide title. 55 | - `content` (list[str]): content (always a list, even with a single item). 56 | - `image_query` (str, optional): keyword to search for an image via Unsplash. 57 | - `image_position` (str, optional): `"left"`, `"right"`, `"top"`, `"bottom"`. 58 | - `image_size` (str, optional): `"small"`, `"medium"`, `"large"`. 59 | - If `image_query` is provided, an image is automatically searched and inserted. 60 | - The system automatically adjusts the text area to avoid overlap. 61 | 8. **For documents `.docx` (`content`):** 62 | - Each element is a dictionary with: 63 | - `type`: `"title"`, `"subtitle"`, `"paragraph"`, `"list"`, `"image"`, `"table"`. 64 | - `text` (str, optional): content for `"title"`, `"subtitle"`, `"paragraph"`. 65 | - `items` (list[str], optional): items for `"list"`. 66 | - `query` (str, optional): keyword for `"image"`. 67 | - `data` (list[list], optional): data for `"table"`. 68 | - If `type == "image"` or `type == "image_query"`, an image is automatically searched via Unsplash. 69 | 9. **For PDF (`content`):** 70 | - Content can include images generated via syntax: 71 | - `![Search](image_query: nature landscape)` 72 | - `![Search](image_query: technology innovation)` 73 | - Images are automatically retrieved from Unsplash and embedded. 74 | 10. **For archives:** 75 | - `archive_format`: `"zip"`, `"tar.gz"`, or `"7z"`. 76 | - `archive_name`: archive name (e.g., `"final_project"`). If omitted, an automatic name is generated. 77 | - **All files are generated within `generate_and_archive`**, directly from the provided data. 78 | - **No file should be created outside this function.** 79 | 11. **Persistence management:** 80 | - `persistent=True`: file is kept indefinitely. 81 | - `persistent=False`: file is automatically deleted after a delay. 82 | 12. **Absolute rule:** 83 | - **Never use `generate_and_archive` without explicit user request.** 84 | - **Any archive generation is strictly prohibited by default.** 85 | - **If multiple files are requested, create each one separately with `create_file`.** 86 | - **Never assume the user wants a pack, archive, or compressed folder.** 87 | 13. **Result:** 88 | - Always return **only** the link provided by the tool (`url`). 89 | - Never invent local paths. 90 | - Respect file uniqueness (suffixes added automatically if necessary). 91 | 92 | 🧠 Review & Editing of Office Documents (.docx / .xlsx / .pptx) 93 | 🪶 General Rule 94 | Always retrieve the complete document content before any action using: 95 | tool_full_context_document_post(file_id) 96 | This context provides an indexed list of elements (paragraphs, cells, or slides). 97 | 💬 Review (adding comments) 98 | If the user requests a proofreading, correction, or suggestion: 99 | - Call tool_full_context_document_post to obtain the indexes. 100 | - Prepare a list of tuples (index, comment). 101 | • DOCX/PPTX → index = integer 102 | • XLSX → index = cell reference ("B3", etc.) 103 | - Call tool_review_document_post(comments=[(index, comment)]). 104 | ➡️ Never modify the content here, only add comments. 105 | ✏️ Editing (modifying content) 106 | If the user requests a modification, rephrasing, or update of the content: 107 | - Call `tool_full_context_document_post` to get the full document context (slide indexes, shapes, text ranges). 108 | - Build a list of editing operations in a format strictly compatible with `tool_edit_document`: 109 | - Each change must be a tuple: `["sid:/shid:", text_or_list]` 110 | (e.g., `["sid:256/shid:4", ["Call 0123456789", "If patient Dr X → press 1"]]`) 111 | - For a new slide: `["nK:slot:title|body", text_or_list]` 112 | (e.g., `["n1:slot:body", ["Line 1", "Line 2"]]`) 113 | - Insertion/removal operations must be defined in `ops`: 114 | `["insert_after", , "nK"]` or `["insert_before", , "nK"]` 115 | - Create the `edits` dictionary with keys `edits` (list of tuples) and `ops` (list of operations). 116 | - Call `tool_edit_document_post` with the `edits` parameter structured as follows: 117 | ```json 118 | { 119 | edits{ 120 | "edits": [ 121 | ["sid:256/shid:4", ["Call 0123456789", "If patient Dr X → press 1"]], 122 | ["n1:slot:body", ["Line 1", "Line 2"]] 123 | ], 124 | "ops": [ 125 | ["insert_after", 256, "n1"] 126 | ] 127 | } 128 | } 129 | ``` 130 | ➡️ Replace only the targeted text without adding external content or modifying the overall document structure. 131 | 🧭 Intent Interpretation 132 | If the user requests to apply, correct, modify, or update a document without specifying a tool, interpret this as an instruction to use tool_edit_document_post. 133 | ➡️ Never display the modified content in the response, only call the tool. 134 | ⚙️ Expected Behavior 135 | - If the document content is not yet known → always start with tool_full_context_document_post. 136 | - Never combine review and edit in the same action. 137 | - Do not invent or add external information to the document. 138 | ⚙️ Mandatory Execution Rule 139 | When a document review or edit is requested: 140 | - Never display the modified document in the response. 141 | - You MUST call the corresponding tool (tool_review_document_post or tool_edit_document_post). 142 | - If the document is not yet loaded or indexes are unknown, call tool_full_context_document_post first. 143 | - The final output must be exclusively the tool result (document uploaded), never a textual rewrite. 144 | ``` 145 | Obviously, adapt the prompt to your needs and the context of your application. 146 | 147 | 148 | ## Chat prompts 149 | 150 | --- 151 | ### Create an archive with a folder structure nested inside it. 152 | ``` 153 | You are a development assistant who helps to create IT projects. Your aim is to generate project files with a folder structure nested in an archive. 154 | Here are the instructions: 155 | 1. Create a .NET Core Console project with a folder structure nested in a 7z archive 156 | Here is the potential structure (to be adapted with your files) 157 | ``` 158 | ``` 159 | FactorialConsoleApp/ 160 | ├── FactorialConsoleApp.sln 161 | └── FactorialConsoleApp/ 162 | ├── FactorialConsoleApp.csproj 163 | ├── Program.cs 164 | └── Properties/ 165 | └── launchSettings.json 166 | ``` 167 | --- 168 | 169 | ### Create a PPTX presentation, with a theme and an image inside. 170 | ``` 171 | Generate me a PPTX presentation, with an image inside, on the theme of food 172 | ``` 173 | --- 174 | 175 | ### Create a PDF file, with a theme and images inside. 176 | ``` 177 | Generate me a pdf file, with images inside, on the theme of food 178 | ``` 179 | --- 180 | 181 | ### Create a tar.gz archive with a PDF and a PPTX file inside, on the theme of modern food. 182 | ``` 183 | Hi, create 2 files (1 pdf and 1 pptx) in a tar.gz archive on the theme of modern food. 184 | 185 | For the PDF file: 186 | 187 | Use a markdown format with titles, subtitles and lists 188 | Adds images to the document 189 | For the PPTX file : 190 | 191 | Create at least 3 slides 192 | Each slide must have a title and content 193 | Add an image to the slides 194 | The title of the presentation should be "Modern Food: Innovation and Sustainability". 195 | ``` 196 | --- 197 | 198 | ### Summarise the subject in a pdf file 199 | 200 | ``` 201 | Summarise the subject in a pdf file 202 | ``` 203 | 204 | ### Summarise the topic in a PDF file with images. 205 | 206 | ``` 207 | Summarise the topic for me in a PDF file with images. 208 | ``` 209 | 210 | 211 | 212 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MCP-File-Generation-Tool – Export Files Directly from Open WebUI 2 | 3 | A lightweight, MCPO-integrated tool that lets you **generate, edit and review real files** (PDF, Excel, PowerPoint, Word, ZIP, etc.) directly from Open WebUI — just like ChatGPT or Claude. 4 | 5 | ✅ Supports both **Docker** and **Python** 6 | ✅ Fully configurable 7 | ✅ Ready for production workflows 8 | ✅ Open source & MIT licensed 9 | 10 | 🚀 **Create and export files easily from Open WebUI!** 11 | 12 | This tool allows seamless file generation and export directly from your Open WebUI environment using Python and FastAPI. 13 | 14 | ## Multi files 15 | 16 | https://github.com/user-attachments/assets/41dadef9-7981-4439-bf5f-3b82fcbaff04 17 | 18 | 19 | ## Single archive 20 | 21 | https://github.com/user-attachments/assets/1e70a977-62f1-498c-895c-7db135ded95b 22 | 23 | ## Table of Contents 24 | - [Quick Start](#quick-start) 25 | - [Best_Practices.md](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/Best_Practices.md) 26 | - [Prompt_Examples.md](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/Prompt_Examples.md) 27 | - [HowToConfigure.md](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/HowToConfigure.md) 28 | - [HowToUse.md](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/HowToUse.md) 29 | - [Supported File Types](#supported-file-types) 30 | - [Using Docker (Recommended)](#Using-docker-recommended) 31 | - [For SSE - http streamable file export server](#for-sse---http-streamable-file-export-server) 32 | - [Environment variables](#SSE-HTTP-env-variables) 33 | - [For OWUI-MCPO (Builtin MCPO server)](#for-owui-mcpo-builtin-mcpo-server) 34 | - [Environment variables](#MCPO-env-variables) 35 | - [Docker Example](#docker-example) 36 | - [For Python Users](#for-python-users) 37 | - [PYTHON EXAMPLE](#python-example) 38 | - [Notes](#notes) 39 | - [Project Structure](#project-structure) 40 | - [📬 Need help?](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/issues/new/choose) 41 | - [Quick Start for Development Versions](#quick-start-for-development-versions) 42 | - [Development Workflow](#development-workflow) 43 | - [Branching Strategy](#branching-strategy) 44 | - [Workflow Flow](#workflow-flow) 45 | - [For SSE - http streamable file export server !!New!!](#for-sse---http-streamable-file-export-server--new-) 46 | - [Environment variables](#DEV-SSE-HTTP-env-variables) 47 | - [For OWUI-MCPO (Builtin MCPO server)](#for-owui-mcpo-builtin-mcpo-server) 48 | - [Environment variables](#DEV-MCPO-env-variables) 49 | - [DOCKER EXAMPLE](#dev-docker-example) 50 | 51 | # Quick Start 52 | 53 | ## Best practices [here](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/Best_Practices.md) 54 | ## Prompt examples [here](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/Prompt_Examples.md) 55 | ## How to use the tool [here](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/HowToUse.md) 56 | ## How configure the tool [here](https://github.com/GlisseManTV/MCPO-File-Generation-Tool/blob/master/Documentation/HowToConfigure.md) 57 | 58 | --- 59 | 60 | ## Supported File Types 61 | 62 | - ✅ `.xlsx` (Excel) 63 | - ✅ `.pdf` (PDF) 64 | - ✅ `.csv` (CSV) 65 | - ✅ `.pptx` (PowerPoint) 66 | - ✅ `.docx` (Word) 67 | - ✅ `.zip`n `tar.gz` and `.7z` (Archives) 68 | - ✅ Any other file type 69 | 70 | --- 71 | 72 | # Using Docker (Recommended) 73 | 74 | ## For SSE - http streamable file export server 75 | 76 | ### This image is dedicated for entreprise grade usecases and advanced users 77 | 78 | ### Endpoints : 79 | - SSE => /sse 80 | - streamable-http => /mcp 81 | 82 | Use 83 | ``` 84 | docker pull ghcr.io/glissemantv/owui-file-export-server:latest 85 | docker pull ghcr.io/glissemantv/file-gen-sse-http:latest 86 | ``` 87 | 88 | ### SSE HTTP ENV VARIABLES 89 | 90 | - `FILE_EXPORT_BASE_URL`: URL of your file export server (default is `http://localhost:9003/files`) 91 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the server's export directory) (default is `/output`) path must be mounted as a volume 92 | - `PERSISTENT_FILES`: Set to `true` to keep files after download, `false` to delete after delay (default is `false`) 93 | - `FILES_DELAY`: Delay in minut to wait before checking for new files (default is 60) 94 | - `UNSPLASH_ACCESS_KEY`: Your Unsplash API key (no default value, not mandatory but advised) see [here](https://unsplash.com/documentation#creating-a-developer-account) 95 | - `PEXELS_ACCESS_KEY` : Your Pexels API key (no default value, not mandatory) see [here](https://www.pexels.com/api/) 96 | - `IMAGE_SOURCE`: "pexels" to use pexels, "unsplash" to use Unsplash or "local_sd" to use your local Stable Diffusion instance (default is "unsplash") 97 | - `LOCAL_SD_URL`: URL of your local Stable Diffusion instance (if using local_sd) (no default value, mandatory if local_sd is used above) 98 | - `LOCAL_SD_USERNAME`: Username of your local Stable Diffusion instance (if any) (no default value, not mandatory) 99 | - `LOCAL_SD_PASSWORD`: Password of your local Stable Diffusion instance (if any) (no default value, not mandatory) 100 | - `LOCAL_SD_DEFAULT_MODEL`: Default model to use (if any) (default `sd_xl_base_1.0.safetensors`, not mandatory) 101 | - `LOCAL_SD_STEPS`: Number of steps to use (default 20, not mandatory) 102 | - `LOCAL_SD_WIDTH`: Width of the image to generate (default 512, not mandatory) 103 | - `LOCAL_SD_HEIGHT`: Height of the image to generate (default 512, not mandatory) 104 | - `LOCAL_SD_CFG_SCALE`: CFG scale to use (default 1.5, not mandatory) 105 | - `LOCAL_SD_SCHEDULER`: Scheduler to use (default `Karras`, not mandatory) 106 | - `LOCAL_SD_SAMPLE`: Sampler to use (default `Euler a`, not mandatory) 107 | - `OWUI_URL`: URL of your OWUI instance (no default value, mandatory to use edit/review) 108 | - `JWT_TOKEN`: Token to access your OWUI instance (only for edit/review used behind an external mcpo server / no longer used if you are SSE/HTTP direct in OWUI) 109 | - `MODE`: "sse" or "http" 110 | 111 | For OWUI-FILE-EXPORT-SERVER 112 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the MCPO's export directory) (default is `/output`) path must be mounted as a volume 113 | 114 | > ✅ This ensures File server can correctly reach the file export server. 115 | > ❌ If not set, file export will fail with a 404 or connection error. 116 | 117 | --- 118 | 119 | ## For OWUI-MCPO (Builtin MCPO server) 120 | 121 | ### This image is dedicated for novice or simple setup, more logs, more docs, etc. 122 | 123 | Use 124 | ``` 125 | docker pull ghcr.io/glissemantv/owui-file-export-server:latest 126 | docker pull ghcr.io/glissemantv/owui-mcpo:latest 127 | ``` 128 | 129 | ### MCPO ENV VARIABLES 130 | 131 | - `FILE_EXPORT_BASE_URL`: URL of your file export server (default is `http://localhost:9003/files`) 132 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the server's export directory) (default is `/output`) path must be mounted as a volume 133 | - `PERSISTENT_FILES`: Set to `true` to keep files after download, `false` to delete after delay (default is `false`) 134 | - `FILES_DELAY`: Delay in minut to wait before checking for new files (default is 60) 135 | - `UNSPLASH_ACCESS_KEY`: Your Unsplash API key (no default value, not mandatory but advised) see [here](https://unsplash.com/documentation#creating-a-developer-account) 136 | - `PEXELS_ACCESS_KEY` : Your Pexels API key (no default value, not mandatory) see [here](https://www.pexels.com/api/) 137 | - `IMAGE_SOURCE`: "pexels" to use pexels, "unsplash" to use Unsplash or "local_sd" to use your local Stable Diffusion instance (default is "unsplash") 138 | - `LOCAL_SD_URL`: URL of your local Stable Diffusion instance (if using local_sd) (no default value, mandatory if local_sd is used above) 139 | - `LOCAL_SD_USERNAME`: Username of your local Stable Diffusion instance (if any) (no default value, not mandatory) 140 | - `LOCAL_SD_PASSWORD`: Password of your local Stable Diffusion instance (if any) (no default value, not mandatory) 141 | - `LOCAL_SD_DEFAULT_MODEL`: Default model to use (if any) (default `sd_xl_base_1.0.safetensors`, not mandatory) 142 | - `LOCAL_SD_STEPS`: Number of steps to use (default 20, not mandatory) 143 | - `LOCAL_SD_WIDTH`: Width of the image to generate (default 512, not mandatory) 144 | - `LOCAL_SD_HEIGHT`: Height of the image to generate (default 512, not mandatory) 145 | - `LOCAL_SD_CFG_SCALE`: CFG scale to use (default 1.5, not mandatory) 146 | - `LOCAL_SD_SCHEDULER`: Scheduler to use (default `Karras`, not mandatory) 147 | - `LOCAL_SD_SAMPLE`: Sampler to use (default `Euler a`, not mandatory) 148 | - `OWUI_URL`: URL of your OWUI instance (no default value, mandatory to use edit/review) 149 | 150 | For OWUI-FILE-EXPORT-SERVER 151 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the MCPO's export directory) (default is `/output`) path must be mounted as a volume 152 | 153 | > ✅ This ensures MCPO can correctly reach the file export server. 154 | > ❌ If not set, file export will fail with a 404 or connection error. 155 | 156 | --- 157 | 158 | ### DOCKER EXAMPLE 159 | 160 | Here is an example of a docker run script file to run both the file export server and the MCPO server: 161 | ``` 162 | docker run -d --name file-export-server --network host -e FILE_EXPORT_DIR=/data/output -p 9003:9003 -v /path/to/your/export/folder:/data/output ghcr.io/glissemantv/owui-file-export-server:latest 163 | docker run -d --name owui-mcpo --network host -e FILE_EXPORT_BASE_URL=http://192.168.0.100:9003/files -e FILE_EXPORT_DIR=/output -e MCPO_API_KEY=top-secret -e PERSISTENT_FILES=True -e FILES_DELAY=1 -e -e LOG_LEVEL=INFO -e UNSPLASH_ACCESS_KEY=top-secret -p 8000:8000 -v /path/to/your/export/folder:/output ghcr.io/glissemantv/owui-mcpo:latest 164 | or 165 | docker run -d --name file-gen-sse-http --network host -e FILE_EXPORT_BASE_URL=http://192.168.0.100:9003/files -e FILE_EXPORT_DIR=/output -e PERSISTENT_FILES=True -e FILES_DELAY=1 -e LOG_LEVEL=DEBUG -e UNSPLASH_ACCESS_KEY=top-secret -p 8000:9004 -v /path/to/your/export/folder:/output ghcr.io/glissemantv/file-gen-sse-http:latest 166 | ``` 167 | 168 | Here is an example of a `docker-compose.yaml` file to run both the file export server and the MCPO server: 169 | ```yaml 170 | services: 171 | file-export-server: 172 | image: ghcr.io/glissemantv/owui-file-export-server:latest 173 | container_name: file-export-server 174 | environment: 175 | - FILE_EXPORT_DIR=/output 176 | ports: 177 | - "9003:9003" 178 | volumes: 179 | - /your/export-data:/output 180 | 181 | owui-mcpo: 182 | image: ghcr.io/glissemantv/owui-mcpo:latest 183 | container_name: owui-mcpo 184 | environment: 185 | - FILE_EXPORT_BASE_URL=http://file-export-server:9003/files 186 | - FILE_EXPORT_DIR=/output 187 | - PERSISTENT_FILES=true 188 | - FILES_DELAY=1 189 | - LOG_LEVEL=INFO 190 | - UNSPLASH_ACCESS_KEY=top-secret 191 | - IMAGE_SOURCE=local_sd 192 | - LOCAL_SD_URL=http://localhost:7860 193 | - LOCAL_SD_USERNAME=local_user 194 | - LOCAL_SD_PASSWORD=local_password 195 | - LOCAL_SD_DEFAULT_MODEL=sd_xl_base_1.0.safetensors 196 | - LOCAL_SD_STEPS=20 197 | - LOCAL_SD_WIDTH=512 198 | - LOCAL_SD_HEIGHT=512 199 | - LOCAL_SD_CFG_SCALE=1.5 200 | - LOCAL_SD_SCHEDULER=Karras 201 | - LOCAL_SD_SAMPLE=Euler a 202 | - OWUI_URL=http://localhost:8000 203 | ports: 204 | - "8000:8000" # Use this port instead of the other only if you want to use the MCPO server 205 | - "9004:9004" # Use this port instead of the other only if you want to use the SSE HTTP server 206 | restart: unless-stopped 207 | volumes: 208 | - /your/export-data:/output 209 | depends_on: 210 | - file-export-server 211 | ``` 212 | --- 213 | 214 | 215 | ## Notes 216 | 217 | - File output paths must match between `file_server` and `MCPO` 218 | - Always use **absolute paths** for volume mounts 219 | 220 | ⚠️Some users are experiencing trouble with the MCPO server, please use this fix⚠️ 221 | ```config.json 222 | { 223 | "mcpServers": { 224 | "file_export": { 225 | "command": "python", <==== HERE change "python" to "python3", "python3.11" or "python3.12" 226 | "args": [ 227 | "-m", 228 | "tools.file_export_mcp" 229 | ], 230 | "env": { 231 | "PYTHONPATH": "C:\\temp\\LLM_Export" <==== HERE set the path to your LLM_Export folder (this one is Mandatory) 232 | ........... other env variables 233 | }, 234 | "disabled": false, 235 | "autoApprove": [] 236 | } 237 | } 238 | 239 | ``` 240 | --- 241 | 242 | ### For Python Users 243 | 244 | 1. Clone the repo: 245 | ```bash 246 | git clone https://github.com/GlisseManTV/MCPO-File-Generation-Tool.git 247 | ``` 248 | 249 | 2. Update env variables in `config.json`: 250 | These ones only concerns the MCPO part 251 | 252 | - `PYTHONPATH`: Path to your `LLM_Export` folder (e.g., `C:\temp\LLM_Export`) <=== MANDATORY no default value 253 | - `FILE_EXPORT_BASE_URL`: URL of your file export server (default is `http://localhost:9003/files`) 254 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the server's export directory) (default is `PYTHONPATH\output`) 255 | - `PERSISTENT_FILES`: Set to `true` to keep files after download, `false` to delete after delay (default is false) 256 | - `FILES_DELAY`: Delay in minut to wait before checking for new files (default is 60) 257 | - `LOG_LEVEL`: Set the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) (default is INFO) 258 | - `MCPO_API_KEY`: Your MCPO API key (no default value, not mandatory but advised) 259 | - `PEXELS_ACCESS_KEY`: Your Pexels API key (no default value, not mandatory) see [here](https://www.pexels.com/api/) 260 | - `UNSPLASH_ACCESS_KEY`: Your Unsplash API key (no default value, not mandatory but advised) see [here](https://unsplash.com/documentation#creating-a-developer-account) 261 | - `IMAGE_SOURCE`: "pexels" to use Pexels, "unsplash" to use Unsplash for image generation or "local_sd" to use your local Stable Diffusion instance (default is "unsplash") 262 | - `LOCAL_SD_URL`: URL of your local Stable Diffusion instance (if using local_sd) (no default value, mandatory if local_sd is used above) 263 | - `LOCAL_SD_USERNAME`: Username of your local Stable Diffusion instance (if any) (no default value, not mandatory) 264 | - `LOCAL_SD_PASSWORD`: Password of your local Stable Diffusion instance (if any) (no default value, not mandatory) 265 | - `LOCAL_SD_DEFAULT_MODEL`: Default model to use (if any) (default `sd_xl_base_1.0.safetensors`, not mandatory) 266 | - `LOCAL_SD_STEPS`: Number of steps to use (default 20, not mandatory) 267 | - `LOCAL_SD_WIDTH`: Width of the image to generate (default 512, not mandatory) 268 | - `LOCAL_SD_HEIGHT`: Height of the image to generate (default 512, not mandatory) 269 | - `LOCAL_SD_CFG_SCALE`: CFG scale to use (default 1.5, not mandatory) 270 | - `LOCAL_SD_SCHEDULER`: Scheduler to use (default `Karras`, not mandatory) 271 | - `LOCAL_SD_SAMPLE`: Sampler to use (default `Euler a`, not mandatory) 272 | - `OWUI_URL`: URL of your OWUI instance (no default value, mandatory to use edit/review) 273 | - `JWT_TOKEN`: JWT token to use for authentication (no default value, mandatory to use edit/review behind an external mcpo tool) 274 | 275 | 276 | 277 | 3. Install dependencies: 278 | ```bash 279 | pip install openpyxl reportlab py7zr fastapi uvicorn python-multipart mcp 280 | ``` 281 | 282 | 4. Run the file server: 283 | ```bat 284 | set FILE_EXPORT_DIR=C:\temp\LLM_Export\output 285 | start "File Export Server" python "YourPATH/LLM_Export/tools/file_export_server.py" 286 | ``` 287 | 288 | 5. Use it in Open WebUI — your AI can now generate and export files in real time! 289 | 290 | --- 291 | 292 | ### PYTHON EXAMPLE 293 | This file only concerns the MCPO part, you need to run the file server separately as shown above 294 | This is an example of a minimal `config.json` for MCPO to enable file export but you can add other (or to other) MCP servers as needed. 295 | 296 | ```config.json 297 | { 298 | "mcpServers": { 299 | "file_export": { 300 | "command": "python", 301 | "args": [ 302 | "-m", 303 | "tools.file_export_mcp" 304 | ], 305 | "env": { 306 | "PYTHONPATH": "C:\\temp\\LLM_Export", <==== HERE set the path to your LLM_Export folder (this one is Mandatory) 307 | "FILE_EXPORT_BASE_URL": "http://localhost:9003/files", <==== HERE set the URL of your file export server 308 | "FILE_EXPORT_DIR": "C:\\temp\\LLM_Export\\output", <==== HERE set the directory where files will be saved (must match the server's export directory) 309 | "PERSISTENT_FILES": "false", <==== HERE set to true to keep files after download, false to delete after delay 310 | "FILES_DELAY": "60", <==== HERE set the delay in minut to wait before checking for new files 311 | "LOG_LEVEL": "INFO", <==== HERE set the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)" 312 | "MCPO_API_KEY": "", <== Your MCPO API key (no default value, not mandatory but advised)" 313 | "PEXELS_ACCESS_KEY":"", <== Your Pexels API key (no default value, not mandatory) see [here](https://www.pexels.com/api/) 314 | "UNSPLASH_ACCESS_KEY":"", <== Your Unsplash API key (no default value, not mandatory but advised) see [here](https://unsplash.com/documentation#creating-a-developer-account) 315 | "IMAGE_SOURCE": "local_sd", <==== HERE set to "pexels" to use Pexels, "unsplash" to use Unsplash for image generation or "local_sd" to use your local Stable Diffusion instance> 316 | "LOCAL_SD_URL": "http://localhost:7860", <==== HERE set to the URL of your local Stable Diffusion instance> 317 | "LOCAL_SD_USERNAME": "local_user", <==== HERE set to the username of your local Stable Diffusion instance (if any)> 318 | "LOCAL_SD_PASSWORD": "local_password", <==== HERE set to the password of your local Stable Diffusion instance (if any)> 319 | "LOCAL_SD_DEFAULT_MODEL": "sd_xl_base_1.0.safetensors", <==== HERE set to the default model to use (if any)> 320 | "LOCAL_SD_STEPS": "20", <==== HERE set to the number of steps to use (if any)> 321 | "LOCAL_SD_WIDTH": "512", <==== HERE set to the width of the image to generate (if any)> 322 | "LOCAL_SD_HEIGHT": "512", <==== HERE set to the height of the image to generate (if any)> 323 | "LOCAL_SD_CFG_SCALE": "1.5", <==== HERE set to the CFG scale to use (if any)> 324 | "LOCAL_SD_SCHEDULER": "Karras", <==== HERE set to the scheduler to use (if any)> 325 | "LOCAL_SD_SAMPLE": "Euler a", <==== HERE set to the sampler to use (if any)> 326 | "OWUI_URL": "http://localhost:3000", <== HERE set to the OWUI URL> 327 | "JWT_TOKEN": "topsecret" <== HERE set to the JWT token to use to connect to your OWUI instance (only for edit/review used behind an external mcpo server)> 328 | }, 329 | "disabled": false, 330 | "autoApprove": [] 331 | } 332 | } 333 | } 334 | ``` 335 | 336 | --- 337 | 338 | ## Project Structure 339 | 340 | ``` 341 | MCPO-File-Generation-Tool/ 342 | ├───Documentation 343 | │ Best_Practices.md 344 | │ HowToConfigure.md 345 | │ HowToUse.md 346 | │ Prompt_Examples.md 347 | │ 348 | └───LLM_Export 349 | │ Example_docker-compose.yaml 350 | │ requirements.txt 351 | │ 352 | ├───docker 353 | │ │ File_Server.txt 354 | │ │ mcp_Server.txt 355 | │ │ 356 | │ ├───file_server 357 | │ │ dockerfile.server 358 | │ │ file_export_server.py 359 | │ │ 360 | │ ├───mcpo 361 | │ │ │ config.json 362 | │ │ │ dockerfile 363 | │ │ │ requirements.txt 364 | │ │ │ 365 | │ │ ├───functions 366 | │ │ │ files_metadata_injector.py 367 | │ │ │ 368 | │ │ ├───templates 369 | │ │ │ Default_Template.docx 370 | │ │ │ Default_Template.pptx 371 | │ │ │ Default_Template.xlsx 372 | │ │ │ 373 | │ │ └───tools 374 | │ │ file_export_mcp.py 375 | │ │ __init__.py 376 | │ │ 377 | │ └───sse_http 378 | │ │ config.json 379 | │ │ dockerfile 380 | │ │ requirements.txt 381 | │ │ 382 | │ ├───functions 383 | │ │ files_metadata_injector.py 384 | │ │ 385 | │ ├───templates 386 | │ │ Default_Template.docx 387 | │ │ Default_Template.pptx 388 | │ │ Default_Template.xlsx 389 | │ │ 390 | │ └───tools 391 | │ file_export_mcp.py 392 | │ __init__.py 393 | │ 394 | ├───functions 395 | │ files_metadata_injector.py 396 | │ 397 | ├───output 398 | ├───templates 399 | │ Default_Template.docx 400 | │ Default_Template.pptx 401 | │ Default_Template.xlsx 402 | │ 403 | └───tools 404 | file_export_mcp.py 405 | file_export_server.py 406 | __init__.py 407 | ``` 408 | 409 | --- 410 | 411 | ## 🌟 Why This Matters 412 | 413 | This tool turns Open WebUI into a **true productivity engine** — where AI doesn’t just chat, but **delivers usable, downloadable files**. 414 | 415 | --- 416 | 417 | ## 📄 License 418 | 419 | MIT License – Feel free to use, modify, and distribute. 420 | 421 | --- 422 | 423 | 📬 **Need help?** Open an issue or start a discussion on GitHub! 424 | 425 | --- 426 | 427 | ## Credits 428 | 429 | A big thank you to the contributors and open-source projects that made this work possible: 430 | 431 | - **tjbck** for creating [**Open WebUI**](https://github.com/open-webui/open-webui) and [**mcpo**](https://github.com/open-webui/mcpo), foundational pillars of this integration. 432 | 433 | - [**modelcontextprotocol/servers**](https://github.com/modelcontextprotocol/servers) for high-quality tools and architectural inspiration that guided the development of MCP servers and file generation workflows. 434 | 435 | - [**gentoorax**](https://chrislaw.me/) for close collaboration, technical rigor, and invaluable contributions to the quality and stability of this project. 436 | 437 | - [**MarouaneZhani**](https://github.com/MarouaneZhani) and his colleague for deep integration and daily follow up in documents treatment 438 | 439 | Thank you to everyone for your passion, expertise, and dedication to the open-source community. 🙌 440 | 441 | --- 442 | 443 | 444 | --- 445 | 446 | # Quick Start for Development Versions 447 | 448 | ## Using development versions of libraries is at your own risk. Always test in a safe environment first. 449 | 450 | ## Development Workflow 451 | 452 | We follow a structured, Git-based release pipeline to ensure stability, transparency, and smooth deployments. 453 | 454 | ### Branching Strategy 455 | 456 | | Branch | Purpose | Docker Tag | 457 | |---------------------|------------------------------------------|--------------------| 458 | | `dev` | Active development | `dev-latest` | 459 | | `alpha` | Post-approval testing (basic validation) | `alpha-latest` | 460 | | `beta` | Optimization & in-depth testing | `beta-latest` | 461 | | `release-candidate` | Final validation before production | `rc-latest` | 462 | | `main` | Stable, production-ready code | `latest` | 463 | 464 | ### Workflow Flow 465 | 466 | 1. **Develop** → Work in the `dev` branch 467 | 2. **Review & Approve** → Pull request to `alpha` 468 | 3. **Test** → Validate in `alpha` → Merge to `beta` 469 | 4. **Optimize** → Refine in `beta` → Merge to `release-candidate` 470 | 5. **Deploy** → Final verification → Merge to `main` 471 | 472 | ✅ Each branch has its own dedicated Docker image tag 473 | ✅ Ensures clean, traceable, and safe releases 474 | ✅ Ideal for contributors, testers, and CI/CD automation 475 | 476 | 477 | ## For SSE - http streamable file export server !!New!! 478 | 479 | ### Endpoints : 480 | SSE => /sse 481 | streamable-http => /mcp 482 | 483 | Use 484 | ``` 485 | docker pull ghcr.io/glissemantv/owui-file-export-server:dev-latest 486 | docker pull ghcr.io/glissemantv/file-gen-sse-http:dev-latest 487 | ``` 488 | 489 | ### DEV SSE HTTP ENV VARIABLES 490 | 491 | - `FILE_EXPORT_BASE_URL`: URL of your file export server (default is `http://localhost:9003/files`) 492 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the server's export directory) (default is `/output`) path must be mounted as a volume 493 | - `PERSISTENT_FILES`: Set to `true` to keep files after download, `false` to delete after delay (default is `false`) 494 | - `FILES_DELAY`: Delay in minut to wait before checking for new files (default is 60) 495 | - `UNSPLASH_ACCESS_KEY`: Your Unsplash API key (no default value, not mandatory but advised) see [here](https://unsplash.com/documentation#creating-a-developer-account) 496 | - `PEXELS_ACCESS_KEY` : Your Pexels API key (no default value, not mandatory) see [here](https://www.pexels.com/api/) 497 | - `IMAGE_SOURCE`: "pexels" to use pexels, "unsplash" to use Unsplash or "local_sd" to use your local Stable Diffusion instance (default is "unsplash") 498 | - `LOCAL_SD_URL`: URL of your local Stable Diffusion instance (if using local_sd) (no default value, mandatory if local_sd is used above) 499 | - `LOCAL_SD_USERNAME`: Username of your local Stable Diffusion instance (if any) (no default value, not mandatory) 500 | - `LOCAL_SD_PASSWORD`: Password of your local Stable Diffusion instance (if any) (no default value, not mandatory) 501 | - `LOCAL_SD_DEFAULT_MODEL`: Default model to use (if any) (default `sd_xl_base_1.0.safetensors`, not mandatory) 502 | - `LOCAL_SD_STEPS`: Number of steps to use (default 20, not mandatory) 503 | - `LOCAL_SD_WIDTH`: Width of the image to generate (default 512, not mandatory) 504 | - `LOCAL_SD_HEIGHT`: Height of the image to generate (default 512, not mandatory) 505 | - `LOCAL_SD_CFG_SCALE`: CFG scale to use (default 1.5, not mandatory) 506 | - `LOCAL_SD_SCHEDULER`: Scheduler to use (default `Karras`, not mandatory) 507 | - `LOCAL_SD_SAMPLE`: Sampler to use (default `Euler a`, not mandatory) 508 | - `OWUI_URL`: URL of your OWUI instance (no default value, mandatory to use edit/review) 509 | - `MODE`: "sse" or "http" 510 | 511 | For OWUI-FILE-EXPORT-SERVER 512 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the MCPO's export directory) (default is `/output`) path must be mounted as a volume 513 | 514 | > ✅ This ensures File server can correctly reach the file export server. 515 | > ❌ If not set, file export will fail with a 404 or connection error. 516 | 517 | --- 518 | 519 | ## For OWUI-MCPO (Builtin MCPO server) 520 | 521 | Use 522 | ``` 523 | docker pull ghcr.io/glissemantv/owui-file-export-server:dev-latest 524 | docker pull ghcr.io/glissemantv/owui-mcpo:dev-latest 525 | ``` 526 | 527 | ### DEV MCPO ENV VARIABLES 528 | 529 | - `FILE_EXPORT_BASE_URL`: URL of your file export server (default is `http://localhost:9003/files`) 530 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the server's export directory) (default is `/output`) path must be mounted as a volume 531 | - `PERSISTENT_FILES`: Set to `true` to keep files after download, `false` to delete after delay (default is `false`) 532 | - `FILES_DELAY`: Delay in minut to wait before checking for new files (default is 60) 533 | - `UNSPLASH_ACCESS_KEY`: Your Unsplash API key (no default value, not mandatory but advised) see [here](https://unsplash.com/documentation#creating-a-developer-account) 534 | - `PEXELS_ACCESS_KEY` : Your Pexels API key (no default value, not mandatory) see [here](https://www.pexels.com/api/) 535 | - `IMAGE_SOURCE`: "pexels" to use pexels, "unsplash" to use Unsplash or "local_sd" to use your local Stable Diffusion instance (default is "unsplash") 536 | - `LOCAL_SD_URL`: URL of your local Stable Diffusion instance (if using local_sd) (no default value, mandatory if local_sd is used above) 537 | - `LOCAL_SD_USERNAME`: Username of your local Stable Diffusion instance (if any) (no default value, not mandatory) 538 | - `LOCAL_SD_PASSWORD`: Password of your local Stable Diffusion instance (if any) (no default value, not mandatory) 539 | - `LOCAL_SD_DEFAULT_MODEL`: Default model to use (if any) (default `sd_xl_base_1.0.safetensors`, not mandatory) 540 | - `LOCAL_SD_STEPS`: Number of steps to use (default 20, not mandatory) 541 | - `LOCAL_SD_WIDTH`: Width of the image to generate (default 512, not mandatory) 542 | - `LOCAL_SD_HEIGHT`: Height of the image to generate (default 512, not mandatory) 543 | - `LOCAL_SD_CFG_SCALE`: CFG scale to use (default 1.5, not mandatory) 544 | - `LOCAL_SD_SCHEDULER`: Scheduler to use (default `Karras`, not mandatory) 545 | - `LOCAL_SD_SAMPLE`: Sampler to use (default `Euler a`, not mandatory) 546 | - `OWUI_URL`: URL of your OWUI instance (no default value, mandatory to use edit/review) 547 | 548 | For OWUI-FILE-EXPORT-SERVER 549 | - `FILE_EXPORT_DIR`: Directory where files will be saved (must match the MCPO's export directory) (default is `/output`) path must be mounted as a volume 550 | 551 | > ✅ This ensures MCPO can correctly reach the file export server. 552 | > ❌ If not set, file export will fail with a 404 or connection error. 553 | 554 | --- 555 | 556 | ### DEV DOCKER EXAMPLE 557 | 558 | 559 | Here is an example of a docker run script file to run both the file export server and the MCPO server: 560 | ``` 561 | docker run -d --name file-export-server --network host -e FILE_EXPORT_DIR=/data/output -p 9003:9003 -v /path/to/your/export/folder:/data/output ghcr.io/glissemantv/owui-file-export-server:dev-latest 562 | docker run -d --name owui-mcpo --network host -e FILE_EXPORT_BASE_URL=http://192.168.0.100:9003/files -e FILE_EXPORT_DIR=/output -e MCPO_API_KEY=top-secret -e PERSISTENT_FILES=True -e FILES_DELAY=1 -e LOG_LEVEL=DEBUG -e UNSPLASH_ACCESS_KEY=top-secret -p 8000:8000 -v /path/to/your/export/folder:/output ghcr.io/glissemantv/owui-mcpo:dev-latest 563 | or 564 | docker run -d --name file-gen-sse-http --network host -e FILE_EXPORT_BASE_URL=http://192.168.0.100:9003/files -e FILE_EXPORT_DIR=/output -e PERSISTENT_FILES=True -e FILES_DELAY=1 -e LOG_LEVEL=DEBUG -e UNSPLASH_ACCESS_KEY=top-secret -p 8000:8000 -v /path/to/your/export/folder:/output ghcr.io/glissemantv/file-gen-sse-http:dev-latest 565 | ``` 566 | 567 | Here is an example of a `docker-compose.yaml` file to run both the file export server and the MCPO server: 568 | ```yaml 569 | services: 570 | file-export-server: 571 | image: ghcr.io/glissemantv/owui-file-export-server:dev-latest 572 | container_name: file-export-server 573 | environment: 574 | - FILE_EXPORT_DIR=/output 575 | ports: 576 | - "9003:9003" 577 | volumes: 578 | - /your/export-data:/output 579 | 580 | owui-mcpo: 581 | image: ghcr.io/glissemantv/owui-mcpo:dev-latest 582 | container_name: owui-mcpo 583 | environment: 584 | - FILE_EXPORT_BASE_URL=http://file-export-server:9003/files 585 | - FILE_EXPORT_DIR=/output 586 | - PERSISTENT_FILES=true 587 | - FILES_DELAY=1 588 | - LOG_LEVEL=DEBUG 589 | - UNSPLASH_ACCESS_KEY=top-secret 590 | - IMAGE_SOURCE=local_sd 591 | - LOCAL_SD_URL=http://localhost:7860 592 | - LOCAL_SD_USERNAME=local_user 593 | - LOCAL_SD_PASSWORD=local_password 594 | - LOCAL_SD_DEFAULT_MODEL=sd_xl_base_1.0.safetensors 595 | - LOCAL_SD_STEPS=20 596 | - LOCAL_SD_WIDTH=512 597 | - LOCAL_SD_HEIGHT=512 598 | - LOCAL_SD_CFG_SCALE=1.5 599 | - LOCAL_SD_SCHEDULER=Karras 600 | - LOCAL_SD_SAMPLE=Euler a 601 | - OWUI_URL=http://localhost:3000 602 | ports: 603 | - "8000:8000" # Use this port instead of the other only if you want to use the MCPO server 604 | - "9004:9004" # Use this port instead of the other only if you want to use the SSE HTTP server 605 | restart: unless-stopped 606 | volumes: 607 | - /your/export-data:/output 608 | depends_on: 609 | - file-export-server 610 | ``` 611 | --- 612 | ## ✨ Star History 613 | 614 | 615 | 616 | 617 | 618 | Star History Chart 619 | 620 | --------------------------------------------------------------------------------