GenFilesMCP is a Model Context Protocol (MCP) server that generates PowerPoint, Excel, Word, or Markdown files from user requests and chat context. This MCP executes Python templates to produce files, uploads them to an Open Web UI (OWUI) endpoint, and stores them in the user's personal knowledge base. Additionally, it supports analyzing and reviewing existing Word documents by extracting their structure and adding comments for corrections, grammar suggestions, or idea enhancements.
- Features
- Status
- Prerequisites
- Installation
- Configuration
- Setup for Document Generation and Review Features
- Usage Examples
- Star History
- File Generation: Creates files in multiple formats (PowerPoint, Excel, Word, Markdown) from user requests.
- FastMCP Server: Receives and processes generation requests via a FastMCP server.
- Python Templates: Uses customizable Python templates to generate files with specific structures.
- OWUI Integration: Automatically uploads generated files to Open Web UI's file API (
/api/v1/files/) and (/api/v1/knowledge/). - Document Review: Analyzes existing Word documents and adds structured comments for corrections, grammar suggestions, or idea enhancements.
- Knowledge Base Integration: Generated and reviewed documents are automatically stored in the user's personal knowledge base, allowing easy access, download, and deletion.
- Multi-User Support: Designed for environments with multiple users, with user-specific document collections.
This release is v0.2.2. It includes a fix derived from Open Web UI Discussion #15192 to prevent errors when uploading files to knowledge collections. This ensures that users who want to save documents generated or reviewed by their LLM using GenFilesMCP can use the parameter ENABLE_CREATE_KNOWLEDGE=true without losing the possibility of using RAG.
The ENABLE_CREATE_KNOWLEDGE variable lets deployments choose whether generated or reviewed files are automatically added to users' knowledge collections. The original behavior (downloading files from chats) remains unchanged for end users.
Note: If you encounter any errors, please create an issue so we can review it. In the meantime, you can set
ENABLE_CREATE_KNOWLEDGE=false; this will not affect the file generation or review capabilities.
- Docker installed on your system
- Open Web UI instance running (v0.6.31 or later for native MCP support)
- Administrators must enable "Knowledge Access" permission in Workspace Permissions for default or group user permissions
Pull the pre-built Docker image from GitHub Container Registry:
docker pull ghcr.io/baronco/genfilesmcp:v0.2.2Run the container:
docker run -d --restart unless-stopped -p YOUR_PORT:YOUR_PORT \
-e OWUI_URL="http://host.docker.internal:3000" \
-e PORT=YOUR_PORT \
-e ENABLE_CREATE_KNOWLEDGE=false \
--name gen_files_mcp \
ghcr.io/baronco/genfilesmcp:v0.2.2Alternatively, use the :latest tag for the most recent version:
docker run -d --restart unless-stopped -p YOUR_PORT:YOUR_PORT \
-e OWUI_URL="http://host.docker.internal:3000" \
-e PORT=YOUR_PORT \
-e ENABLE_CREATE_KNOWLEDGE=false \
--name gen_files_mcp \
ghcr.io/baronco/genfilesmcp:latestIf you need to build the image yourself:
- Clone the repository:
git clone https://github.com/Baronco/GenFilesMCP.git
cd GenFilesMCP- Build the Docker image:
docker build -t genfilesmcp .- Run the container:
docker run -d --restart unless-stopped \
-p YOUR_PORT:YOUR_PORT \
-e OWUI_URL="http://host.docker.internal:3000" \
-e PORT=YOUR_PORT \
-e ENABLE_CREATE_KNOWLEDGE=false \
--name gen_files_mcp \
genfilesmcpIf you want to build the image yourself (you have the Dockerfile and local dependencies):
- Clone the repository
git clone https://github.com/Baronco/GenFilesMCP.git
cd GenFilesMCP- Use the docker-compose.yml:
services:
genfilesmcp:
build:
context: .
dockerfile: Dockerfile
container_name: genfilesmcp
environment:
- ENABLE_CREATE_KNOWLEDGE=false
- OWUI_URL=http://open-webui:8080
- PORT=8015If you only want to use the image published on GitHub, modify the docker-compose.yml:
services:
genfilesmcp:
image: ghcr.io/baronco/genfilesmcp:latest
container_name: genfilesmcp
environment:
- ENABLE_CREATE_KNOWLEDGE=false
- OWUI_URL=http://open-webui:8080
- PORT=8015Finally, run the Docker Compose setup:
docker compose up -dThe MCP server requires the following environment variables:
| Variable | Description | Example |
|---|---|---|
OWUI_URL |
URL of your Open Web UI instance | http://host.docker.internal:3000 |
PORT |
Port where the MCP server will listen | 8015 |
ENABLE_CREATE_KNOWLEDGE |
Controls whether generated or reviewed files are automatically added to users' knowledge collections. Set to true to enable automatic creation/updating of knowledge collections; set to false to disable that behavior and preserve RAG workflows (recommended default for RAG users). NOTE: If ENABLE_CREATE_KNOWLEDGE=true, it is mandatory to enable the Open Web UI document option Bypass Embedding and Retrieval. |
false |
Important: This version requires Open Web UI version v0.6.31 or later for native MCP support. MCPO is no longer supported.
Configure the MCP directly in your Open Web UI "External Tools" settings. Set the type to "MCP Streamable HTTP" and Auth to "Session".
When using docker-compose set URL to "http://genfilesmcp:8015/mcp"
Note for Open Web UI v0.6.40+: The latest version introduces a "Function Name Filter List" field in the connection settings which may not function correctly. A known workaround is to add a comma , in that field. See Issue #19486 for details.
Once Tools are enabled for your model, Open WebUI gives you two different ways to let your LLM use them in conversations. You can decide how the model should call Tools by choosing between:
Default Mode (Prompt-based)orNative Mode (Built-in function calling), check the documentation for more details: OWUI Tools
These features require additional setup in Open Web UI:
- Create a mandatory custom tool called
chat_contextin Open Web UI to retrieve user and file metadata
- In Open Web UI, go to Workspace > Tools > (+) Create
- Paste the following code:
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 = {}, __user__: 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": [], "user_id": None, "user_email": None}
# user data
if "id" in __user__:
chat_context["user_id"] = __user__["id"]
if "email" in __user__:
chat_context["user_email"] = __user__["email"]
if chat_context["user_id"] is None:
chat_context = {"error": "User: Unknown"}
# files metadata
if __files__:
for f in __files__:
chat_context["files"].append({"id": f["id"], "name": f["name"]})
return chat_context
else:
return chat_context- Save the tool as
chat_context
Note: This tool is mandatory for the correct functioning of document generation and review features, as it provides the necessary user context (user_id) for storing documents in the user's knowledge base.
This version integrates with Open Web UI's knowledge base system:
- Permission Requirement: Administrators must enable the "Knowledge Access" permission in Workspace Permissions for default or group user permissions: -> Admin Panel -> Users -> Groups -> Default permissisons (or other Group).
- User Collections: Each user will have two dedicated knowledge collections created automatically:
- "My Generated Files": Contains all documents generated by the user.
- "Documents Reviewed by AI": Contains all Word documents reviewed and commented on by the AI.
- Document Management: Users can easily review, access, download, and delete their generated or reviewed documents from their knowledge base. Deleting a document from the knowledge base also removes it from the chats where it was generated.
To support automatic creation of knowledge collections for files generated or reviewed by the MCP server, the Open Web UI document option Bypass Embedding and Retrieval must be enabled. This is required only when ENABLE_CREATE_KNOWLEDGE=true.
Behavior summary:
- If
ENABLE_CREATE_KNOWLEDGE=false(default recommended for RAG users): The MCP server will NOT create or update knowledge collections for generated/reviewed files. Users who rely on RAG or do not want knowledge collections created can keep this setting disabled and do NOT enableBypass Embedding and Retrieval. Users will still be able to download generated/reviewed files from their chats as before. - If
ENABLE_CREATE_KNOWLEDGE=true: The MCP server will attempt to create/update per-user knowledge collections for generated/reviewed files. In this mode, you MUST enableBypass Embedding and Retrievalin the Open Web UI document options so the knowledge creation/upload flow works correctly.
For optimal results, create a custom agent in Open Web UI:
- Copy the system prompt from
example/systemprompt.md - Create a new agent called FileGenAgent
- Use this system prompt for the agent
- Tested successfully with GPT-5 Thinking mini
Example files: You can find the prompt and generated result in the
examplefolder:History_of_Neural_Nets_Summary_69d1751b-577b-4329-beca-ac16db7acdbd.docx
This file was generated using the GenFiles MCP server and GPT-5 mini
Open the generated file in Excel:
In this example, it was used a MCP server to web research and GenFilesMCP to generate a PowerPoint presentation:
Open the generated file in PowerPoint:
Example files: You can find the prompt and generated result in the
examplefolder:Cartagena_Temperature_Timeseries.xlsx
The review feature allows the agent to analyze uploaded documents and add structured comments for improvements.
Workflow:
- User uploads
History_of_Neural_Nets_Summary.docxto the chat - User requests a review with comments for corrections, grammar suggestions, and idea enhancements
- Agent calls the
get_files_metadatacustom tool to retrieve file ID and name - Agent uses the
full_context_docxMCP function to analyze the document structure - Agent calls the
review_docxMCP function to add comments to specific elements
Result:
Example files: Find the reviewed document in the
examplefolder:History_of_Neural_Nets_Summary_reviewed_a35adcc5-e338-47c6-a0b0-2c21602b0777.docx
Generated using the GenFiles MCP server and GPT-5 mini
The review functionality preserves the original formatting while adding structured comments
This project is licensed under the MIT License - see the LICENSE.md file for details.













