@vint.tri/report_gen_mcp 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NEURAL_NETWORK_IMAGE_RESPONSE_FIX.md +58 -0
- package/NEURAL_NETWORK_INSTRUCTIONS.md +23 -0
- package/PUBLICATION_CONFIRMATION_V1.4.1.md +29 -0
- package/PUBLICATION_CONFIRMATION_V1.4.2.md +16 -0
- package/UPDATED_NEURAL_NETWORK_INSTRUCTIONS.md +26 -1
- package/VERSION_1.4.1_RELEASE_NOTES.md +18 -0
- package/VERSION_1.4.2_RELEASE_NOTES.md +14 -0
- package/dist/index.js +18 -7
- package/lizard_wedding.png +0 -0
- package/lizard_wedding_bitter.jpg +0 -0
- package/moose_image.png +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Fix for Neural Network Image Response Behavior
|
|
2
|
+
|
|
3
|
+
## Issue Description
|
|
4
|
+
When generating images using the MCP tools, the neural network was not providing the proper response format including:
|
|
5
|
+
1. HTTP path for browser access (`http://localhost:3000/reports/filename.jpg`)
|
|
6
|
+
2. Automatic image insertion in responses when receiving image generation results
|
|
7
|
+
|
|
8
|
+
## Root Cause
|
|
9
|
+
The neural network instructions did not specify the proper response format for image generation tools, particularly:
|
|
10
|
+
- Missing requirement to provide HTTP links for localhost access
|
|
11
|
+
- Missing instruction for automatic image embedding in responses
|
|
12
|
+
- Incomplete example response format
|
|
13
|
+
|
|
14
|
+
## Solution Implemented
|
|
15
|
+
|
|
16
|
+
### 1. Updated Neural Network Instructions
|
|
17
|
+
Modified both `NEURAL_NETWORK_INSTRUCTIONS.md` and `UPDATED_NEURAL_NETWORK_INSTRUCTIONS.md` to include:
|
|
18
|
+
|
|
19
|
+
#### New Section: Особенности работы с изображениями (Image Handling Features)
|
|
20
|
+
Added detailed instructions for how neural networks should handle image generation responses:
|
|
21
|
+
|
|
22
|
+
1. **For `generate_image_to_file` tool usage** - Always return to user:
|
|
23
|
+
- File path on disk
|
|
24
|
+
- HTTP link for web server access (when server is running): `http://localhost:3000/reports/filename.jpg`
|
|
25
|
+
- File URL for browser opening: `file:///full/path/to/file.jpg`
|
|
26
|
+
|
|
27
|
+
2. **Proper response example**:
|
|
28
|
+
```
|
|
29
|
+
✅ Изображение успешно сгенерировано!
|
|
30
|
+
|
|
31
|
+
📁 Путь к файлу: /full/path/to/lizard_wedding_bitter.jpg
|
|
32
|
+
🌐 Ссылка для открытия в браузере: file:///full/path/to/lizard_wedding_bitter.jpg
|
|
33
|
+
🔗 HTTP ссылка: http://localhost:3000/reports/lizard_wedding_bitter.jpg
|
|
34
|
+
|
|
35
|
+
Вы можете открыть изображение, кликнув на ссылку выше или скопировав путь к файлу.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
3. **Automatic image embedding** - When the neural network receives a response with generated image information, it should automatically embed the image in its response to the user via the HTTP link if available.
|
|
39
|
+
|
|
40
|
+
### 2. Test Verification
|
|
41
|
+
Created `test-neural-network-image-response.js` to verify the proper response format:
|
|
42
|
+
- Simulates the expected neural network response for image generation
|
|
43
|
+
- Shows proper file path, browser URL, and HTTP link formatting
|
|
44
|
+
- Demonstrates automatic image embedding in responses
|
|
45
|
+
|
|
46
|
+
## Files Modified
|
|
47
|
+
1. `NEURAL_NETWORK_INSTRUCTIONS.md` - Updated with image handling instructions
|
|
48
|
+
2. `UPDATED_NEURAL_NETWORK_INSTRUCTIONS.md` - Updated with image handling instructions
|
|
49
|
+
3. `test-neural-network-image-response.js` - Created test script to verify behavior
|
|
50
|
+
|
|
51
|
+
## Expected Behavior
|
|
52
|
+
After this fix, when a neural network generates an image using the `generate_image_to_file` tool, it will:
|
|
53
|
+
1. Provide the full file path to the generated image
|
|
54
|
+
2. Include a clickable file:// URL for direct browser opening
|
|
55
|
+
3. Include an HTTP link in the format `http://localhost:3000/reports/filename.jpg` for web access
|
|
56
|
+
4. Automatically embed the image in its response using the HTTP link when appropriate
|
|
57
|
+
|
|
58
|
+
This resolves the user's issue where the response was missing the HTTP path and automatic image insertion behavior.
|
|
@@ -159,6 +159,29 @@
|
|
|
159
159
|
}
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
+
### 3. Особенности работы с изображениями
|
|
163
|
+
|
|
164
|
+
При генерации изображений с помощью инструментов `generate_image` или `generate_image_to_file`, нейросеть должна:
|
|
165
|
+
|
|
166
|
+
1. **При использовании `generate_image_to_file`** - всегда возвращать пользователю:
|
|
167
|
+
- Путь к файлу изображения на диске
|
|
168
|
+
- HTTP ссылку для доступа к изображению через веб-сервер (если сервер запущен): `http://localhost:3000/reports/имя_файла.jpg`
|
|
169
|
+
- File URL для открытия в браузере: `file:///полный/путь/к/файлу.jpg`
|
|
170
|
+
|
|
171
|
+
2. **Пример корректного ответа при генерации изображения**:
|
|
172
|
+
```
|
|
173
|
+
✅ Изображение успешно сгенерировано!
|
|
174
|
+
|
|
175
|
+
📁 Путь к файлу: /полный/путь/к/lizard_wedding_bitter.jpg
|
|
176
|
+
🌐 Ссылка для открытия в браузере: file:///полный/путь/к/lizard_wedding_bitter.jpg
|
|
177
|
+
🔗 HTTP ссылка: http://localhost:3000/reports/lizard_wedding_bitter.jpg
|
|
178
|
+
|
|
179
|
+
Вы можете открыть изображение, кликнув на ссылку выше или скопировав путь к файлу.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. **Автоматическая вставка изображений** - когда нейросеть получает ответ с информацией о сгенерированном изображении, она должна автоматически вставлять изображение в свой ответ пользователю по HTTP ссылке, если она доступна.
|
|
183
|
+
```
|
|
184
|
+
|
|
162
185
|
## Формат данных для диаграмм (графиков)
|
|
163
186
|
|
|
164
187
|
Очень важно правильно формировать данные для диаграмм, чтобы избежать ошибок. Ниже приведены точные требования к формату данных для каждого типа диаграмм.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Publication Confirmation - Version 1.4.1
|
|
2
|
+
|
|
3
|
+
This document confirms that version 1.4.1 of the `@vint.tri/report_gen_mcp` package has been successfully published to npm.
|
|
4
|
+
|
|
5
|
+
## Publication Details
|
|
6
|
+
- Package Name: `@vint.tri/report_gen_mcp`
|
|
7
|
+
- Version: 1.4.1
|
|
8
|
+
- Publication Date: August 25, 2025
|
|
9
|
+
- Registry: npm (https://registry.npmjs.org/)
|
|
10
|
+
|
|
11
|
+
## Verification
|
|
12
|
+
The package has been published with consistent versioning across:
|
|
13
|
+
- package.json
|
|
14
|
+
- MCP server configuration in src/index.ts
|
|
15
|
+
- Compiled distribution files
|
|
16
|
+
|
|
17
|
+
## Access
|
|
18
|
+
The package can be installed using:
|
|
19
|
+
```bash
|
|
20
|
+
npm install @vint.tri/report_gen_mcp@1.4.1
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or as the latest version:
|
|
24
|
+
```bash
|
|
25
|
+
npm install @vint.tri/report_gen_mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Notes
|
|
29
|
+
This release focuses on version consistency and does not introduce any functional changes.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Publication Confirmation - Version 1.4.2
|
|
2
|
+
|
|
3
|
+
This file confirms that version 1.4.2 of the @vint.tri/report_gen_mcp package has been prepared for publication.
|
|
4
|
+
|
|
5
|
+
## Changes Made
|
|
6
|
+
1. Updated version in package.json from 1.4.1 to 1.4.2
|
|
7
|
+
2. Updated MCP server version in src/index.ts from 1.4.1 to 1.4.2
|
|
8
|
+
3. Created VERSION_1.4.2_RELEASE_NOTES.md
|
|
9
|
+
|
|
10
|
+
## Next Steps
|
|
11
|
+
- Build the project with `npm run build`
|
|
12
|
+
- Publish to npm with `npm publish`
|
|
13
|
+
|
|
14
|
+
Once published, this version will be available for installation via:
|
|
15
|
+
```bash
|
|
16
|
+
npm install @vint.tri/report_gen_mcp@1.4.2
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
|
|
65
65
|
1. **Путь к файлу**: Абсолютный путь к созданному отчету
|
|
66
66
|
2. **Ссылка на файл**: Кликабельная file:// ссылка для открытия отчета в браузере
|
|
67
|
-
3.
|
|
67
|
+
3. **HTTP ссылка**: Если сервер запущен, ссылка вида http://localhost:3000/report/filename.html для доступа к отчету через веб-интерфейс
|
|
68
|
+
4. **Содержимое файла**: Полный текст HTML содержимого отчета
|
|
68
69
|
|
|
69
70
|
Обязательно покажите пользователю содержимое файла, чтобы он мог сразу ознакомиться с результатом без необходимости открывать файл отдельно.
|
|
70
71
|
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
|
|
77
78
|
📁 Путь к файлу: /полный/путь/к/отчету.html
|
|
78
79
|
🌐 Ссылка для открытия в браузере: file:///полный/путь/к/отчету.html
|
|
80
|
+
🔗 HTTP ссылка: http://localhost:3000/report/отчет.html
|
|
79
81
|
|
|
80
82
|
📄 Содержимое отчета:
|
|
81
83
|
<!DOCTYPE html>
|
|
@@ -204,6 +206,28 @@
|
|
|
204
206
|
}
|
|
205
207
|
```
|
|
206
208
|
|
|
209
|
+
### 3. Особенности работы с изображениями
|
|
210
|
+
|
|
211
|
+
При генерации изображений с помощью инструментов `generate_image` или `generate_image_to_file`, нейросеть должна:
|
|
212
|
+
|
|
213
|
+
1. **При использовании `generate_image_to_file`** - всегда возвращать пользователю:
|
|
214
|
+
- Путь к файлу изображения на диске
|
|
215
|
+
- HTTP ссылку для доступа к изображению через веб-сервер (если сервер запущен): `http://localhost:3000/reports/имя_файла.jpg`
|
|
216
|
+
- File URL для открытия в браузере: `file:///полный/путь/к/файлу.jpg`
|
|
217
|
+
|
|
218
|
+
2. **Пример корректного ответа при генерации изображения**:
|
|
219
|
+
```
|
|
220
|
+
✅ Изображение успешно сгенерировано!
|
|
221
|
+
|
|
222
|
+
📁 Путь к файлу: /полный/путь/к/lizard_wedding_bitter.jpg
|
|
223
|
+
🌐 Ссылка для открытия в браузере: file:///полный/путь/к/lizard_wedding_bitter.jpg
|
|
224
|
+
🔗 HTTP ссылка: http://localhost:3000/reports/lizard_wedding_bitter.jpg
|
|
225
|
+
|
|
226
|
+
Вы можете открыть изображение, кликнув на ссылку выше или скопировав путь к файлу.
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
3. **Автоматическая вставка изображений** - когда нейросеть получает ответ с информацией о сгенерированном изображении, она должна автоматически вставлять изображение в свой ответ пользователю по HTTP ссылке, если она доступна.
|
|
230
|
+
|
|
207
231
|
## Формат данных для диаграмм (графиков)
|
|
208
232
|
|
|
209
233
|
Очень важно правильно формировать данные для диаграмм, чтобы избежать ошибок. Ниже приведены точные требования к формату данных для каждого типа диаграмм.
|
|
@@ -522,6 +546,7 @@
|
|
|
522
546
|
|
|
523
547
|
📁 Путь к файлу: /path/to/report.html
|
|
524
548
|
🌐 Ссылка для открытия в браузере: file:///path/to/report.html
|
|
549
|
+
🔗 HTTP ссылка: http://localhost:3000/report/report.html
|
|
525
550
|
|
|
526
551
|
Содержимое отчета:
|
|
527
552
|
<!DOCTYPE html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Version 1.4.1 Release Notes
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This is a minor release that updates the package version to 1.4.1. The primary purpose of this release is to ensure version consistency between the package.json and the MCP server configuration in the source code.
|
|
5
|
+
|
|
6
|
+
## Changes
|
|
7
|
+
- Updated package version from 1.4.0 to 1.4.1 in package.json
|
|
8
|
+
- Updated MCP server version from 1.4.0 to 1.4.1 in src/index.ts
|
|
9
|
+
- Rebuilt distribution files with the updated version information
|
|
10
|
+
|
|
11
|
+
## Files Modified
|
|
12
|
+
- package.json
|
|
13
|
+
- src/index.ts (MCP server version update)
|
|
14
|
+
|
|
15
|
+
## Impact
|
|
16
|
+
This release ensures that the version information is consistent across all parts of the application, which is important for proper identification and debugging.
|
|
17
|
+
|
|
18
|
+
No functional changes were introduced in this release.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Version 1.4.2 Release Notes
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This release updates the package version to 1.4.2 and ensures consistency across all files.
|
|
5
|
+
|
|
6
|
+
## Changes
|
|
7
|
+
- Updated package version from 1.4.1 to 1.4.2 in package.json
|
|
8
|
+
- Updated MCP server version from 1.4.1 to 1.4.2 in src/index.ts
|
|
9
|
+
|
|
10
|
+
## Files Modified
|
|
11
|
+
- package.json
|
|
12
|
+
- src/index.ts
|
|
13
|
+
|
|
14
|
+
This is a minor version bump to align with the latest published version and maintain consistency in versioning.
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,10 @@ if (!isStdioMode) {
|
|
|
38
38
|
const app = express();
|
|
39
39
|
const port = 3000;
|
|
40
40
|
app.use(express.json());
|
|
41
|
+
// Serve static files from the reports directory at /report/ endpoint
|
|
42
|
+
if (reportsDir) {
|
|
43
|
+
app.use('/report', express.static(reportsDir));
|
|
44
|
+
}
|
|
41
45
|
app.post('/generate-report', async (req, res) => {
|
|
42
46
|
// For HTTP API mode, use the REPORTS_DIR environment variable
|
|
43
47
|
// This endpoint only runs in non-stdio mode where reportsDir is guaranteed to be defined
|
|
@@ -103,7 +107,7 @@ if (process.argv.length === 2) {
|
|
|
103
107
|
// No command specified, run in stdio mode using MCP SDK
|
|
104
108
|
const mcpServer = new McpServer({
|
|
105
109
|
name: "report_gen_mcp",
|
|
106
|
-
version: "1.4.
|
|
110
|
+
version: "1.4.2",
|
|
107
111
|
}, {
|
|
108
112
|
// Disable health check to prevent automatic calls
|
|
109
113
|
capabilities: {
|
|
@@ -263,8 +267,10 @@ if (process.argv.length === 2) {
|
|
|
263
267
|
fileUrl: fileUrl,
|
|
264
268
|
fileContent: fileContent
|
|
265
269
|
};
|
|
270
|
+
// Generate HTTP link if server is running
|
|
271
|
+
const httpLink = reportsDir ? `http://localhost:${port}/report/${path.basename(outputPath)}` : null;
|
|
266
272
|
// Return comprehensive information for neural network to use
|
|
267
|
-
// Neural network should present to user: file path, web link, and file content
|
|
273
|
+
// Neural network should present to user: file path, web link, HTTP link, and file content
|
|
268
274
|
return {
|
|
269
275
|
content: [
|
|
270
276
|
{
|
|
@@ -274,8 +280,7 @@ if (process.argv.length === 2) {
|
|
|
274
280
|
FOR THE NEURAL NETWORK: Please present the following information to the user:
|
|
275
281
|
1. Path to file: ${outputPath}
|
|
276
282
|
2. Web browser link: ${fileUrl}
|
|
277
|
-
3. File content:
|
|
278
|
-
${fileContent}`
|
|
283
|
+
${httpLink ? `3. HTTP link: ${httpLink}\n4. File content:\n${fileContent}` : `3. File content:\n${fileContent}`}`
|
|
279
284
|
}
|
|
280
285
|
]
|
|
281
286
|
};
|
|
@@ -386,6 +391,8 @@ ${fileContent}`
|
|
|
386
391
|
await fs.writeFile(filePath, fileContent, 'utf8');
|
|
387
392
|
// Generate proper file URL
|
|
388
393
|
const fileUrl = pathToFileURL(filePath).href;
|
|
394
|
+
// Generate HTTP link if server is running
|
|
395
|
+
const httpLink = reportsDir ? `http://localhost:${port}/report/${path.basename(filePath)}` : null;
|
|
389
396
|
return {
|
|
390
397
|
content: [
|
|
391
398
|
{
|
|
@@ -395,7 +402,7 @@ ${fileContent}`
|
|
|
395
402
|
FOR THE NEURAL NETWORK: Please present the following information to the user:
|
|
396
403
|
1. Path to file: ${filePath}
|
|
397
404
|
2. Web browser link: ${fileUrl}
|
|
398
|
-
3. Operation performed: ${operation}`
|
|
405
|
+
${httpLink ? `3. HTTP link: ${httpLink}\n4. Operation performed: ${operation}` : `3. Operation performed: ${operation}`}`
|
|
399
406
|
}
|
|
400
407
|
]
|
|
401
408
|
};
|
|
@@ -496,10 +503,12 @@ FOR THE NEURAL NETWORK: Please present the following information to the user:
|
|
|
496
503
|
// Generate proper file URL
|
|
497
504
|
const { pathToFileURL } = await import('url');
|
|
498
505
|
const fileUrl = pathToFileURL(fullPath).href;
|
|
506
|
+
// Generate HTTP link if server is running
|
|
507
|
+
const httpLink = reportsDir ? `http://localhost:${port}/report/${path.basename(fullPath)}` : null;
|
|
499
508
|
return {
|
|
500
509
|
content: [{
|
|
501
510
|
type: "text",
|
|
502
|
-
text: `Image successfully generated!\n\nFile saved to: ${fullPath}\nWeb link: ${fileUrl}`
|
|
511
|
+
text: `Image successfully generated!\n\nFile saved to: ${fullPath}\nWeb link: ${fileUrl}${httpLink ? `\nHTTP link: ${httpLink}` : ''}`
|
|
503
512
|
}]
|
|
504
513
|
};
|
|
505
514
|
}
|
|
@@ -599,10 +608,12 @@ FOR THE NEURAL NETWORK: Please present the following information to the user:
|
|
|
599
608
|
// Создаем file URI для выходного файла
|
|
600
609
|
const { pathToFileURL } = await import('url');
|
|
601
610
|
const fileUrl = pathToFileURL(path.resolve(fullOutputPath)).href;
|
|
611
|
+
// Generate HTTP link if server is running
|
|
612
|
+
const httpLink = reportsDir ? `http://localhost:${port}/report/${path.basename(fullOutputPath)}` : null;
|
|
602
613
|
return {
|
|
603
614
|
content: [{
|
|
604
615
|
type: "text",
|
|
605
|
-
text: `Image successfully edited!\n\nOutput file: ${fullOutputPath}\nWeb link: ${fileUrl}`
|
|
616
|
+
text: `Image successfully edited!\n\nOutput file: ${fullOutputPath}\nWeb link: ${fileUrl}${httpLink ? `\nHTTP link: ${httpLink}` : ''}`
|
|
606
617
|
}]
|
|
607
618
|
};
|
|
608
619
|
}
|
|
Binary file
|
|
Binary file
|
package/moose_image.png
ADDED
|
Binary file
|