@vint.tri/report_gen_mcp 1.3.5 → 1.3.6

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.
@@ -0,0 +1,143 @@
1
+ # Image Tools Configuration
2
+
3
+ This document explains how to configure and use the image generation and editing tools in the Report Generator MCP.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. Python 3.7 or higher
8
+ 2. Required Python packages:
9
+ - `mcp` (Model Context Protocol SDK)
10
+ - `aiohttp`
11
+
12
+ Install the required packages:
13
+ ```bash
14
+ pip install -r src/python/requirements.txt
15
+ ```
16
+
17
+ Or use the npm script:
18
+ ```bash
19
+ npm run install-python-deps
20
+ ```
21
+
22
+ ## Environment Variables
23
+
24
+ The following environment variables are required for the image tools to work:
25
+
26
+ - `CHUTES_API_TOKEN`: Your API token for Chutes AI services
27
+ - `IMG_SAVE_BASE_DIR`: Base directory for saving generated/edited images (optional)
28
+
29
+ Optional environment variables for image generation:
30
+ - `SD_MODEL`: Default model for image generation (default: "JuggernautXL")
31
+ - `SD_WIDTH`: Default width for generated images (default: 1024)
32
+ - `SD_HEIGHT`: Default height for generated images (default: 1024)
33
+ - `SD_GUIDANCE_SCALE`: Default guidance scale (default: 7.5)
34
+ - `SD_NEGATIVE_PROMPT`: Default negative prompt (default: "")
35
+ - `SD_NUM_INFERENCE_STEPS`: Default number of inference steps (default: 25)
36
+ - `SD_SEED`: Default seed (default: 0)
37
+
38
+ Optional environment variables for image editing:
39
+ - `EDIT_WIDTH`: Default width for edited images (default: 1024)
40
+ - `EDIT_HEIGHT`: Default height for edited images (default: 1024)
41
+ - `EDIT_CFG_SCALE`: Default CFG scale (default: 4.0)
42
+ - `EDIT_NEGATIVE_PROMPT`: Default negative prompt (default: "")
43
+ - `EDIT_INFERENCE_STEPS`: Default number of inference steps (default: 50)
44
+
45
+ ## Image Generation Tool
46
+
47
+ ### Tool Name
48
+ `generate-image`
49
+
50
+ ### Description
51
+ Generate an image using AI based on a text prompt.
52
+
53
+ ### Parameters
54
+ - `prompt` (string, required): Text prompt for image generation (must be in English)
55
+ - `width` (number, optional): Width of the image in pixels (128-2048, default: 1024)
56
+ - `height` (number, optional): Height of the image in pixels (128-2048, default: 1024)
57
+ - `model` (string, optional): Model to use for image generation (default: "JuggernautXL")
58
+ - `guidanceScale` (number, optional): Guidance scale for image generation (1.0-20.0, default: 7.5)
59
+ - `negativePrompt` (string, optional): Negative prompt for things to exclude from the image (default: "")
60
+ - `numInferenceSteps` (number, optional): Number of inference steps (1-50, default: 25)
61
+ - `seed` (number, optional): Seed for reproducibility (0 = random, default: 0)
62
+ - `outputFile` (string, optional): Output file path for saving the image
63
+
64
+ ### Example Usage
65
+ ```json
66
+ {
67
+ "name": "generate-image",
68
+ "arguments": {
69
+ "prompt": "A beautiful landscape with mountains and lakes",
70
+ "width": 1024,
71
+ "height": 768,
72
+ "model": "JuggernautXL",
73
+ "guidanceScale": 7.5,
74
+ "negativePrompt": "blurry, low quality",
75
+ "numInferenceSteps": 30,
76
+ "seed": 12345
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Image Editing Tool
82
+
83
+ ### Tool Name
84
+ `edit-image`
85
+
86
+ ### Description
87
+ Edit an existing image using AI based on a text prompt.
88
+
89
+ ### Parameters
90
+ - `prompt` (string, required): Text prompt for image editing (must be in English)
91
+ - `imagePath` (string, required): Path to the input image file
92
+ - `output_path` (string, required): Path for the output edited image file
93
+ - `width` (number, optional): Width of the edited image in pixels (512-2048, default: 1024)
94
+ - `height` (number, optional): Height of the edited image in pixels (512-2048, default: 1024)
95
+ - `cfgScale` (number, optional): CFG scale for image editing (1.0-10.0, default: 4.0)
96
+ - `negativePrompt` (string, optional): Negative prompt for things to exclude from the edited image (default: "")
97
+ - `numInferenceSteps` (number, optional): Number of inference steps (10-100, default: 50)
98
+ - `seed` (number, optional): Seed for reproducibility (leave empty for random)
99
+
100
+ ### Example Usage
101
+ ```json
102
+ {
103
+ "name": "edit-image",
104
+ "arguments": {
105
+ "prompt": "Add a sunset to this landscape",
106
+ "imagePath": "/path/to/input/image.jpg",
107
+ "output_path": "/path/to/output/edited_image.jpg",
108
+ "width": 1024,
109
+ "height": 768,
110
+ "cfgScale": 4.0,
111
+ "negativePrompt": "blurry, low quality",
112
+ "numInferenceSteps": 50,
113
+ "seed": 12345
114
+ }
115
+ }
116
+ ```
117
+
118
+ ## Integration with Report Generation
119
+
120
+ The image tools can be used independently or integrated with the report generation tool. When used with the report generator, you can embed generated or edited images directly into your reports using the `[[image:id]]` placeholder syntax.
121
+
122
+ ### Example Report with Generated Image
123
+ ```markdown
124
+ # My Report
125
+
126
+ This is a sample report with an AI-generated image.
127
+
128
+ [[image:landscape]]
129
+ ```
130
+
131
+ With corresponding elements:
132
+ ```json
133
+ {
134
+ "landscape": {
135
+ "type": "pollinations",
136
+ "config": {
137
+ "prompt": "A beautiful landscape with mountains and lakes"
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ Note: Currently, the integration uses Pollinations.ai for image generation within reports. The standalone image tools use Chutes AI for more advanced generation and editing capabilities.
@@ -1,26 +1,27 @@
1
- # Publication Confirmation - Version 1.3.4
1
+ # Publication Confirmation - Version 1.3.5
2
2
 
3
- The @vint.tri/report_gen_mcp package has been successfully published to npm as version 1.3.4.
3
+ The @vint.tri/report_gen_mcp package has been successfully published to npm as version 1.3.5.
4
4
 
5
- ## Changes in Version 1.3.4
5
+ ## Changes in Version 1.3.5
6
6
 
7
- 1. **Fixed CSS Selector Issue**: Resolved the problem with the edit-report tool not working correctly with CSS selectors like `h2:nth-of-type(3)`
8
- 2. **Added jsdom Dependency**: Integrated jsdom library for proper DOM manipulation and robust CSS selector support
9
- 3. **Updated Edit-Report Implementation**: Refactored the edit-report tool to use jsdom's querySelector method instead of regex-based approach
10
- 4. **Version Updates**: Updated both package.json and src/index.ts to reflect version 1.3.4
7
+ 1. **Fixed Report Path Issue**: Resolved the problem with reports being saved in the wrong directory by using the `REPORTS_DIR` environment variable instead of the system temporary directory `/tmp/`.
8
+ 2. **Updated Claude Desktop Configuration**: Added the `env` section with the `REPORTS_DIR` variable to properly specify the report saving directory.
9
+ 3. **Version Updates**: Updated the package version to 1.3.5 in all relevant files (`package.json`, `src/index.ts`, `dist/index.js`).
10
+ 4. **Documentation**: Created detailed documentation explaining the issue and solution (`REPORT_PATH_FIX_EXPLANATION.md`).
11
+ 5. **Testing**: Added a test script to verify that reports are saved in the correct directory (`test-report-path-fix.js`).
11
12
 
12
13
  ## Verification
13
14
 
14
15
  - ✅ Package successfully published to npm
15
- - ✅ Version 1.3.4 is now the latest version on npm
16
- - ✅ CSS selector functionality tested and working correctly
16
+ - ✅ Version 1.3.5 is now the latest version on npm
17
+ - ✅ Report path functionality tested and working correctly
17
18
  - ✅ All existing functionality preserved
18
19
 
19
20
  ## Testing
20
21
 
21
22
  The fix has been verified with a test script that confirms:
22
- - CSS selectors like `h2:nth-of-type(3)` now work correctly
23
- - Content can be successfully inserted at the correct positions in HTML documents
24
- - The edit-report tool functions as expected with complex CSS selectors
23
+ - Reports are saved in the correct directory specified by `REPORTS_DIR`
24
+ - The path in the result matches the expected path
25
+ - The neural network can properly process the response and provide all necessary information to the user
25
26
 
26
- Users can now successfully use CSS selectors with the edit-report tool to modify their HTML reports.
27
+ Users can now successfully save reports in the directory specified by the `REPORTS_DIR` environment variable.