Skip to content

Commit eff6e15

Browse files
authored
Merge pull request #17 from Baronco/dev
Dev
2 parents 52c9296 + fe07e0b commit eff6e15

16 files changed

+265
-133
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ wheels/
1010
# Notebooks
1111
*.ipynb
1212
# env vars
13-
*.env
13+
*.env
14+
# local folders
15+
/documentos_test/*

README.md

Lines changed: 103 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ GenFilesMCP is a Model Context Protocol (MCP) server that generates PowerPoint,
1111
- [Installation](#installation)
1212
- [Option 1: Using Pre-built Docker Image (Recommended)](#option-1-using-pre-built-docker-image-recommended)
1313
- [Option 2: Building from Source](#option-2-building-from-source)
14+
- [Option 3: Docker Compose](#option-3-docker-compose)
1415
- [Configuration](#configuration)
1516
- [Environment Variables](#environment-variables)
1617
- [MCP Configuration in Open Web UI](#mcp-configuration-in-open-web-ui)
@@ -34,7 +35,11 @@ GenFilesMCP is a Model Context Protocol (MCP) server that generates PowerPoint,
3435

3536
## Status
3637

37-
This release is **v0.2.1**. It introduces a new environment variable `ENABLE_CREATE_KNOWLEDGE` that lets deployments choose whether generated or reviewed files are automatically added to users' knowledge collections. This enables coexistence between RAG-preserving deployments (do not enable knowledge creation) and deployments that want generated files saved to knowledge collections (requires enabling the Open Web UI document option `Bypass Embedding and Retrieval`). The original behavior (downloading files from chats) remains unchanged for end users.
38+
This release is **v0.2.2**. It includes a fix derived from [Open Web UI Discussion #15192](https://github.com/open-webui/open-webui/discussions/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.
39+
40+
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.
41+
42+
> **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.
3843
3944
## Prerequisites
4045

@@ -49,7 +54,7 @@ This release is **v0.2.1**. It introduces a new environment variable `ENABLE_CRE
4954
Pull the pre-built Docker image from GitHub Container Registry:
5055

5156
```bash
52-
docker pull ghcr.io/baronco/genfilesmcp:v0.2.1
57+
docker pull ghcr.io/baronco/genfilesmcp:v0.2.2
5358
```
5459

5560
Run the container:
@@ -60,7 +65,7 @@ docker run -d --restart unless-stopped -p YOUR_PORT:YOUR_PORT \
6065
-e PORT=YOUR_PORT \
6166
-e ENABLE_CREATE_KNOWLEDGE=false \
6267
--name gen_files_mcp \
63-
ghcr.io/baronco/genfilesmcp:v0.2.1
68+
ghcr.io/baronco/genfilesmcp:v0.2.2
6469
```
6570

6671
Alternatively, use the `:latest` tag for the most recent version:
@@ -103,6 +108,53 @@ docker run -d --restart unless-stopped \
103108
genfilesmcp
104109
```
105110

111+
### Option 3: Docker Compose
112+
113+
If you want to build the image yourself (you have the Dockerfile and local dependencies):
114+
115+
- Clone the repository
116+
117+
118+
```shell
119+
git clone https://github.com/Baronco/GenFilesMCP.git
120+
cd GenFilesMCP
121+
```
122+
123+
- Use the docker-compose.yml:
124+
125+
126+
```yaml
127+
services:
128+
genfilesmcp:
129+
build:
130+
context: .
131+
dockerfile: Dockerfile
132+
container_name: genfilesmcp
133+
environment:
134+
- ENABLE_CREATE_KNOWLEDGE=false
135+
- OWUI_URL=http://open-webui:8080
136+
- PORT=8015
137+
```
138+
139+
If you only want to use the image published on GitHub, modify the docker-compose.yml:
140+
141+
```yaml
142+
services:
143+
genfilesmcp:
144+
image: ghcr.io/baronco/genfilesmcp:latest
145+
container_name: genfilesmcp
146+
environment:
147+
- ENABLE_CREATE_KNOWLEDGE=false
148+
- OWUI_URL=http://open-webui:8080
149+
- PORT=8015
150+
```
151+
152+
Finally, run the Docker Compose setup:
153+
154+
```shell
155+
docker compose up -d
156+
```
157+
106158
## Configuration
107159

108160
### Environment Variables
@@ -119,14 +171,18 @@ The MCP server requires the following environment variables:
119171

120172
**Important:** This version requires **Open Web UI version v0.6.31 or later** for native MCP support. MCPO is no longer supported.
121173

122-
Configure the MCP directly in your Open Web UI "External Tools" settings. Set the type to "MCP Streamable HTTP".
174+
Configure the MCP directly in your Open Web UI "External Tools" settings. Set the type to "MCP Streamable HTTP" and Auth to "Session".
175+
176+
When using docker-compose set URL to "http://genfilesmcp:8015/mcp"
123177

124178
<div style="text-align: center;">
125179

126180
![MCP Configuration](img/mcp.png)
127181

128182
</div>
129183

184+
**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](https://github.com/open-webui/open-webui/issues/19486) for details.
185+
130186
> 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)` or `Native Mode (Built-in function calling)`, check the documentation for more details: [OWUI Tools](https://docs.openwebui.com/features/plugin/tools/)
131187
132188
## Setup for Document Generation and Review Features
@@ -193,7 +249,7 @@ class Tools:
193249

194250
This version integrates with Open Web UI's knowledge base system:
195251

196-
- **Permission Requirement**: Administrators must enable the "Knowledge Access" permission in Workspace Permissions for default or group user permissions.
252+
- **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).
197253

198254
<div style="text-align: center;">
199255

@@ -248,7 +304,44 @@ For optimal results, create a custom agent in Open Web UI:
248304
249305
> This file was generated using the GenFiles MCP server and GPT-5 mini
250306
251-
### Example 2: Reviewing a DOCX file with comments
307+
### Example 2: Generating a XLSX file
308+
309+
310+
<div style="text-align: center;">
311+
312+
![Generating XLSX Example 1](img/excel1.png)
313+
314+
</div>
315+
316+
Open the generated file in Excel:
317+
318+
<div style="text-align: center;">
319+
320+
![Generating XLSX Example 2](img/excel2.png)
321+
322+
</div>
323+
324+
### Example 3: Generating a PPTX file
325+
326+
In this example, it was used a MCP server to web research and GenFilesMCP to generate a PowerPoint presentation:
327+
328+
<div style="text-align: center;">
329+
330+
![Generating PPTX Example 1](img/powerpoint1.png)
331+
332+
</div>
333+
334+
Open the generated file in PowerPoint:
335+
336+
<div style="text-align: center;">
337+
338+
![Generating PPTX Example 2](img/powerpoint2.png)
339+
340+
</div>
341+
342+
> **Example files**: You can find the prompt and generated result in the `example` folder: `Cartagena_Temperature_Timeseries.xlsx`
343+
344+
### Example 4: Reviewing a DOCX file with comments
252345

253346
The review feature allows the agent to analyze uploaded documents and add structured comments for improvements.
254347

@@ -294,3 +387,7 @@ The review feature allows the agent to analyze uploaded documents and add struct
294387
## Star History
295388

296389
[![Star History Chart](https://api.star-history.com/svg?repos=Baronco/GenFilesMCP&type=date&legend=top-left)](https://www.star-history.com/#Baronco/GenFilesMCP&type=date&legend=top-left)
390+
391+
## License
392+
393+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
services:
2+
genfilesmcp:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
# if you don't need/want to build, comment out the 3 lines above and uncomment line below
7+
# currently you need to build for ARM
8+
# image: ghcr.io/baronco/genfilesmcp:latest
9+
container_name: genfilesmcp
10+
environment:
11+
- ENABLE_CREATE_KNOWLEDGE=false # true/false
12+
- OWUI_URL=http://open-webui:8080 # default name and port for OWUI with docker: http://open-webui:8080
13+
- PORT=8015
14+
# networks: # open-webui and genfilesmcp must be on the same docker network, depending on your setup, default network is probably fine
15+
# - ollama-tools
16+
17+
#networks:
18+
# ollama-tools:
19+
# external: false
20+
# driver: bridge
21+
22+
44.8 KB
Binary file not shown.
7.16 KB
Binary file not shown.

example/systemprompt.md

Lines changed: 43 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,74 @@
1-
You are **FileGenAgent**, a specialized assistant for **creating, reviewing, and researching documents** in the following formats:
2-
`.docx`, `.xlsx`, `.md`, `.pptx`.
1+
You are **FileGenAgent**, an expert AI assistant specialized in **creating, structuring, and refining professional documents**. You excel at producing high-quality files in `.docx`, `.xlsx`, `.md`, and `.pptx` formats.
32

43
* **Current date:** `{{CURRENT_DATE}}`
54
* **User name:** `{{USER_NAME}}`
65

76
---
87

9-
## Purpose & Behavior
8+
## Core Objectives
109

11-
Your mission is to help users efficiently **generate, improve, or analyze files**, ensuring clarity, structure, and usefulness.
12-
When uncertain, **state your assumption clearly and continue** do not block the workflow.
13-
14-
Always:
15-
16-
* Match the **user’s language**.
17-
* Maintain a **warm, concise, and consistent** tone.
18-
* Use **Markdown** for formatting (`#` for headers, `**bold**` for emphasis, lists for structure).
10+
1. **High-Quality Output**: Generate files that are not just correct, but professionally structured, visually appealing, and ready for use.
11+
2. **Efficiency**: Use tools effectively to minimize user effort.
12+
3. **Clarity**: Communicate clearly in the user's language.
1913

2014
---
2115

22-
## Tool Usage & Rules
23-
24-
### 1. Chat Context (`chat_context`)
25-
26-
Use `chat_context` **before performing any action** involving files or user data.
16+
## Operational Rules
2717

28-
This tool retrieves:
18+
### 1. Language & Tone
19+
* **Language**: Strictly infer the user's language from their messages. Ignore the user's name or metadata for language detection.
20+
* **Tone**: Professional, helpful, and concise.
2921

30-
* The **metadata of current chat files** (file `id` and `name`)
31-
* The **user information** (`user_id`, `user_email`)
22+
### 2. Context Awareness
23+
* **Mandatory First Step**: Always call `chat_context` before any file operation to retrieve file IDs, names, and user details.
24+
* **Consistency**: Use the exact `id` and `name` from `chat_context`.
3225

33-
#### Mandatory usage rules
26+
---
3427

35-
1. **Always call `chat_context` first** to get both file and user details.
36-
2. If the tool returns `"error": "User: Unknown"`, ask the user to confirm their identity before proceeding.
37-
3. When files are present, use the exact `id` and `name` from the `chat_context` output in subsequent tool calls.
38-
4. If no files are found, inform the user and wait for them to upload or specify one.
39-
5. Never assume file or user data manually always rely on `chat_context`.
28+
## File Generation Guidelines (`GenFilesMCP`)
4029

41-
---
30+
When generating files, adhere to these standards for each format:
4231

43-
### 2. File Generation `GenFilesMCP`
32+
### Excel (`.xlsx`)
33+
* **Structure**: Use clear headers, freeze top rows, and enable filters where appropriate.
34+
* **Data**: Ensure data types are correct (dates, numbers, currency).
35+
* **Formatting**: Auto-fit columns and use professional color schemes.
4436

45-
Use this tool when the user requests:
37+
### Word (`.docx`)
38+
* **Structure**: Use proper Heading styles (H1, H2, H3) for document hierarchy.
39+
* **Content**: Include a Table of Contents for longer documents.
40+
* **Formatting**: Use consistent fonts, spacing, and bullet points for readability.
4641

47-
* A **new file**, or
48-
* A **revised version** with direct edits applied.
42+
### PowerPoint (`.pptx`)
43+
* **Design**: Limit text per slide. Use bullet points and clear titles.
44+
* **Content**: Distribute content logically across slides. Use Speaker Notes for detailed explanations.
4945

50-
When returning a generated file, always include a download link using **this exact format**:
46+
### Markdown (`.md`)
47+
* **Syntax**: Use standard Markdown syntax.
48+
* **Organization**: Use headers, lists, and code blocks effectively.
5149

50+
**Output Requirement**:
51+
When a file is generated, **YOU MUST** provide the download link in this exact format:
5252
```
5353
[Download {filename}.{ext}](/api/v1/files/{id}/content)
5454
```
5555

56-
Enhance generated content by including (as appropriate):
57-
58-
* Tables, lists, charts, or formulas
59-
* Clear section headers and a table of contents
60-
* Visual structure and readability improvements
61-
62-
**Do not** produce files in any format outside `.docx`, `.xlsx`, `.md`, `.pptx`.
63-
6456
---
6557

66-
### 3. Word Review Workflow (`.docx`)
67-
68-
When the user requests **improvements or feedback**:
69-
70-
#### Option A Generate a new version
71-
72-
Use `generate_word` to produce a fully updated `.docx`.
58+
## Review & Editing Workflow
7359

74-
#### Option B Add reviewer comments
75-
76-
Use reviewer tools to **keep the original file unchanged** and **attach comments** instead.
77-
78-
**Mandatory review process:**
79-
80-
1. **Call `chat_context` first** to confirm the active `.docx` file name and ID.
81-
→ If unclear, ask the user before proceeding.
82-
2. Use **`full_context_docx`** to obtain the document’s element indexes.
83-
3. Use **`review_docx`** to send a list of tuples in the format:
84-
`(element_index, comment)`
60+
### Word Documents (`.docx`)
61+
* **New Version**: Use `generate_word` to create a fully revised file.
62+
* **Comments/Feedback**:
63+
1. Call `chat_context` to identify the file.
64+
2. Call `full_context_docx` to map element indexes.
65+
3. Call `review_docx` to attach specific comments to elements `(index, comment)`.
8566

8667
---
8768

88-
## General Rules
89-
90-
* Communicate assumptions transparently if data or intent is ambiguous.
91-
* Never use formats other than `.docx`, `.xlsx`, `.md`, or `.pptx`.
92-
* Always structure responses with **Markdown**:
69+
## General Constraints
9370

94-
* `#` headers for sections
95-
* **Bold** for emphasis
96-
* Lists or tables for organization
97-
* Code blocks when showing text, data, or formula samples
71+
* **Supported Formats**: Only `.docx`, `.xlsx`, `.md`, `.pptx`. Politely decline other formats.
72+
* **Capabilities**: Do not offer or suggest actions you cannot perform. You ONLY have MCP tools to generate `.docx`, `.xlsx`, `.md`, `.pptx` files and to review `.docx` files.
73+
* **Assumptions**: If a request is ambiguous, state your working assumptions clearly and proceed. Do not block the user unless the request is impossible to fulfill.
74+
* **Response Format**: Use Markdown for all chat responses.

img/excel1.png

131 KB
Loading

img/excel2.png

85.7 KB
Loading

img/mcp.png

5.77 KB
Loading

img/powerpoint1.png

186 KB
Loading

0 commit comments

Comments
 (0)