### Run Docker Compose Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Starts the Docker Compose setup in detached mode. ```shell docker compose up -d ``` -------------------------------- ### Example config.json for MCPO integration Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md This JSON configuration demonstrates how to set up GenFilesMCP to run via MCPO using stdio transport, specifying environment variables for Open WebUI integration and knowledge collection. ```json { "mcpServers": { "genfilesmcp-team1": { "command": "uvx", "args": [ "--from", "git+https://github.com/Baronco/GenFilesMCP.git@v0.3.0", "genfilesmcp" ], "env": { "MCP_TRANSPORT": "stdio", "OWUI_URL": "http://host.docker.internal:3000", "OWUI_API_KEY": "sk-xxxxxxxxxxxxxxxx", "ENABLE_CREATE_KNOWLEDGE": "true", "KNOWLEDGE_COLLECTION_NAME": "Team 1", "REVIEWER_AI_ASSISTANT_NAME": "GenFilesMCP" } }, "genfilesmcp-team2": { "command": "uvx", "args": [ "--from", "git+https://github.com/Baronco/GenFilesMCP.git@v0.3.0", "genfilesmcp" ], "env": { "MCP_TRANSPORT": "stdio", "OWUI_URL": "http://host.docker.internal:3000", "OWUI_API_KEY": "sk-yyyyyyyyyyyyyyyy", "ENABLE_CREATE_KNOWLEDGE": "true", "KNOWLEDGE_COLLECTION_NAME": "Team 2", "REVIEWER_AI_ASSISTANT_NAME": "GenFilesMCP" } } } } ``` -------------------------------- ### Build Docker Image from Source Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Builds a Docker image for GenFilesMCP from the cloned source code. ```bash docker build -t gen_files_mcp . ``` -------------------------------- ### Clone Repository Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Clones the GenFilesMCP GitHub repository to the local system. ```bash git clone https://github.com/Baronco/GenFilesMCP.git cd GenFilesMCP ``` -------------------------------- ### Allowed Open WebUI API Paths Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md A comma-separated list of allowed Open WebUI API base paths for service accounts. ```text /api/v1/auths, /api/v1/files, /api/v1/knowledge, /api/v1/knowledge/search ``` -------------------------------- ### Docker Compose Configuration (Build from source) Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Docker Compose configuration to build the GenFilesMCP image from the Dockerfile. ```yaml services: genfiles-mcp: build: context: . dockerfile: Dockerfile container_name: gen_files_mcp environment: - REVIEWER_AI_ASSISTANT_NAME=GenFilesMCP - ENABLE_CREATE_KNOWLEDGE=false - OWUI_URL=http://open-webui:8080 - PORT=8016 ``` -------------------------------- ### Run GenFilesMCP Docker Container from Built Image Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Runs the GenFilesMCP Docker container using a locally built image, with specified environment variables and port mapping. ```bash docker run -d --restart unless-stopped \ -p YOUR_PORT:YOUR_PORT \ -e OWUI_URL="http://host.docker.internal:3000" \ -e PORT=YOUR_PORT \ -e REVIEWER_AI_ASSISTANT_NAME="GenFilesMCP" \ -e ENABLE_CREATE_KNOWLEDGE=false \ --name gen_files_mcp \ gen_files_mcp ``` -------------------------------- ### Run GenFilesMCP Docker Container (v0.3.0) Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Runs the GenFilesMCP Docker container with specified environment variables and port mapping. Assumes Open WebUI is running on http://host.docker.internal:3000. ```bash docker run -d --restart unless-stopped -p YOUR_PORT:YOUR_PORT \ -e OWUI_URL="http://host.docker.internal:3000" \ -e PORT=YOUR_PORT \ -e REVIEWER_AI_ASSISTANT_NAME="GenFilesMCP" \ -e ENABLE_CREATE_KNOWLEDGE=false \ --name gen_files_mcp \ ghcr.io/baronco/genfilesmcp:v0.3.0 ``` -------------------------------- ### One-line Command for Running GenFilesMCP Docker Container (latest tag) Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md A convenient one-line command to run the GenFilesMCP Docker container using the ':latest' tag. ```bash docker run -d --restart unless-stopped -p 8016:8016 -e OWUI_URL="http://host.docker.internal:3000" -e PORT=8016 -e REVIEWER_AI_ASSISTANT_NAME="GenFilesMCP" -e ENABLE_CREATE_KNOWLEDGE=false --name gen_files_mcp ghcr.io/baronco/genfilesmcp:latest ``` -------------------------------- ### Run GenFilesMCP Docker Container (latest tag) Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Runs the GenFilesMCP Docker container using the ':latest' tag, with specified environment variables and port mapping. ```bash docker run -d --restart unless-stopped -p YOUR_PORT:YOUR_PORT \ -e OWUI_URL="http://host.docker.internal:3000" \ -e PORT=YOUR_PORT \ -e REVIEWER_AI_ASSISTANT_NAME="GenFilesMCP" \ -e ENABLE_CREATE_KNOWLEDGE=false \ --name gen_files_mcp \ ghcr.io/baronco/genfilesmcp:latest ``` -------------------------------- ### Chat Context Tool Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Python code for the custom 'chat_context' tool in Open Web UI, used to retrieve file metadata, user email, and user ID. ```python import os import requests from datetime import datetime from pydantic import BaseModel, Field class Tools: def __init__(self): pass # Add your custom tools using pure Python code here, make sure to add type hints and descriptions def chat_context(self, __files__: dict = {}, __metadata__: dict = {}) -> dict: """ Get files metadata and get the user Email and user ID from the user object. """ # id and name of current files chat_context = {"files": [], "attached_images": []} # files metadata if __files__: for f in __files__: chat_context["files"].append({"id": f["id"], "name": f["name"]}) # imgs in messages parent = __metadata__.get("parent_message", {}) files = parent.get("files", []) for f in files: content_type = f.get("content_type", "") file_id = f.get("id") filename = f.get("name") if content_type.startswith("image/"): chat_context["attached_images"].append( {"img_id": file_id, "file_name": filename} ) return chat_context ``` -------------------------------- ### Docker Compose Configuration (Use published image) Source: https://github.com/baronco/genfilesmcp/blob/main/docs/installation.md Docker Compose configuration to use the latest published GenFilesMCP image from GitHub Container Registry. ```yaml services: genfiles-mcp: image: ghcr.io/baronco/genfilesmcp:latest container_name: gen_files_mcp environment: - REVIEWER_AI_ASSISTANT_NAME=GenFilesMCP - ENABLE_CREATE_KNOWLEDGE=false - OWUI_URL=http://open-webui:8080 - PORT=8016 ``` -------------------------------- ### File Generation Tools Source: https://github.com/baronco/genfilesmcp/blob/main/src/mcp_instructions.md These tools are used to create new PowerPoint, Excel, Word, or Markdown files. ```python generate_powerpoint generate_excel generate_markdown generate_word ``` -------------------------------- ### Docker Run Command (One-liner) Source: https://github.com/baronco/genfilesmcp/blob/main/README.md A condensed version of the Docker run command for quick deployment. ```bash docker run -d --restart unless-stopped -p 8016:8016 -e OWUI_URL="http://host.docker.internal:3000" -e PORT=8016 -e REVIEWER_AI_ASSISTANT_NAME="GenFilesMCP" -e ENABLE_CREATE_KNOWLEDGE=false --name gen_files_mcp ghcr.io/baronco/genfilesmcp:v0.3.0 ``` -------------------------------- ### File Review Tools Source: https://github.com/baronco/genfilesmcp/blob/main/src/mcp_instructions.md These tools are used to analyze and add comments to existing Word files. ```python list_docx_elements review_docx_document ``` -------------------------------- ### Python script to generate Markdown Source: https://github.com/baronco/genfilesmcp/blob/main/src/markdown.md This script demonstrates how to generate a Markdown document using a Python script and save it to a BytesIO buffer. It includes comments explaining each step and the importance of encoding content to bytes. ```python # Allowed packages # Note: For simple Markdown, no additional packages are needed. pypandoc is optional for advanced formatting. # Buffer to save the Markdown file, previously defined in the server.py file # IMPORTANT: MD_BUFFER is a BytesIO buffer (in-memory file-like object), not a file path. # Writing to it saves in RAM, not on disk. Always encode text to bytes with .encode('utf-8'). MD_BUFFER = md_buffer # Do not modify this line, it is defined in the server.py file # Step 1: Build a Markdown document according to the user's request. # Use triple quotes for multi-line strings to avoid syntax errors. markdown_content = """# Example Markdown Document here""" # Step 2: Save the content to the buffer (recommended method for simple Markdown) # This writes directly to memory (RAM), no disk involved. MD_BUFFER.write(markdown_content.encode('utf-8')) ``` -------------------------------- ### Docker Run Command Source: https://github.com/baronco/genfilesmcp/blob/main/README.md Runs the GenFiles MCP Server container with specified environment variables and port mapping. ```bash docker run -d --restart unless-stopped -p 8016:8016 \ -e OWUI_URL="http://host.docker.internal:3000" \ -e PORT=8016 \ -e REVIEWER_AI_ASSISTANT_NAME="GenFilesMCP" \ -e ENABLE_CREATE_KNOWLEDGE=false \ --name gen_files_mcp \ ghcr.io/baronco/genfilesmcp:v0.3.0 ``` -------------------------------- ### Python script to generate a PowerPoint presentation Source: https://github.com/baronco/genfilesmcp/blob/main/src/powerpoint.md This script uses the 'pptx' library to create a new PowerPoint presentation, allowing for customization with titles, subtitles, diagrams, tables, colors, and clear fonts. The presentation is saved to a buffer and a markdown hyperlink is returned for downloading the file. ```python # Allowed packages import numpy as np from pptx import Presentation # Import here other pptx packages you need, but do not import other packages that are not allowed. # Buffer to save the PowerPoint file, previously defined in the server.py file PPTX_BUFFER = pptx_buffer # Do not modify this line, it is defined in the server.py file # Initialize a new Presentation instance prs = Presentation() # slides ratio has to be 16:9 not 4:3 # Generate here the necessary transformations for generating the PowerPoint presentation according to the user's request. Use titles, subtitles, diagrams, tables, colors, clear fonts, and other elements to make the presentation visually appealing and easy to understand. # Save the presentation prs.save(PPTX_BUFFER) # Do not modify this line, it is defined in the server.py file ``` -------------------------------- ### Python script to generate a Word document Source: https://github.com/baronco/genfilesmcp/blob/main/src/word.md This script demonstrates how to create a Word document using the python-docx library, add a title and an image, and save it to a buffer. It also shows how to generate a markdown hyperlink for downloading the file. ```python # Allowed packages import numpy as np from docx import Document from io import BytesIO from docx.shared import Inches # Import here other docx packages you need, but do not import other packages that are not allowed. # Buffer to save the docx file, previously defined in the server.py file DOCX_BUFFER = docx_buffer # Do not modify this line, it is defined in the server.py file # Width in inches for the image to be added width = 2 # Example width, modify as needed # If images are needed, they would be preloaded by the server and passed here. LIST_OF_BYTES_IO_IMAGES = images # # Do not modify this line if images are needed, it is defined in the server.py file # Initialize a new Document instance doc = Document() # Example title doc.add_heading("Example of report", level=1) # Ensure the pointer is at the start LIST_OF_BYTES_IO_IMAGES[0].seek(0) # Example of adding the first image from the list to the document doc.add_picture( LIST_OF_BYTES_IO_IMAGES[0], width=Inches(width) ) # Generate here the necessary transformations for generating the word document to the user's request. # Save the presentation doc.save(DOCX_BUFFER) # Do not modify this line, it is defined in the server.py file ``` -------------------------------- ### Python Script to Generate Excel Workbook Source: https://github.com/baronco/genfilesmcp/blob/main/src/excel.md This script uses the openpyxl library to create an Excel workbook, save it to a buffer, and returns a download link. ```python # Allowed packages import numpy as np from openpyxl import Workbook # Import here other xlsx packages you need, but do not import other packages that are not allowed. # Buffer to save excel file, previously defined in the server.py file XLSX_BUFFER = xlsx_buffer # Do not modify this line, it is defined in the server.py file # Initialize a new Workbook instance wb = Workbook() # Apply the required data transformations to build the Excel workbook based on the user's request. # Create the necessary worksheets, populate tables, add charts, and format cells for clarity and visual appeal. # Save the Excel workbook wb.save(XLSX_BUFFER) # Do not modify this line, it is defined in the server.py file ``` -------------------------------- ### Docker Pull Command Source: https://github.com/baronco/genfilesmcp/blob/main/README.md Pulls the latest Docker image for the GenFiles MCP Server. ```bash docker pull ghcr.io/baronco/genfilesmcp:v0.3.0 ``` -------------------------------- ### JSON Input Structure Source: https://github.com/baronco/genfilesmcp/blob/main/src/word_template.md The required JSON structure for generating a Word document, including metadata for the cover page and specifications for the document body. ```json { "document_cover": { "title": "string", "subtitle": "string", "description": "string", "author": "string", "month": "string", "year": "string", "page_break": boolean }, "columns_body": number, "document_elements": [ { "type": "string", "content": "string" } ], "file_name": "string" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.