@michelabboud/visual-forge-mcp 0.6.0 → 0.7.0
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/CHANGELOG.md +403 -2
- package/README.md +88 -5
- package/config/pricing.json +1 -1
- package/dist/parser/markdown-parser.d.ts +2 -0
- package/dist/parser/markdown-parser.d.ts.map +1 -1
- package/dist/parser/markdown-parser.js +23 -10
- package/dist/parser/markdown-parser.js.map +1 -1
- package/dist/placeholders/placeholder-manager.d.ts +8 -0
- package/dist/placeholders/placeholder-manager.d.ts.map +1 -1
- package/dist/placeholders/placeholder-manager.js +71 -18
- package/dist/placeholders/placeholder-manager.js.map +1 -1
- package/dist/providers/base-provider.d.ts +13 -0
- package/dist/providers/base-provider.d.ts.map +1 -1
- package/dist/providers/base-provider.js +263 -17
- package/dist/providers/base-provider.js.map +1 -1
- package/dist/providers/gemini/gemini-provider.d.ts.map +1 -1
- package/dist/providers/gemini/gemini-provider.js +3 -7
- package/dist/providers/gemini/gemini-provider.js.map +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +5 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +4 -1
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/utils/filename-sanitizer.d.ts +85 -0
- package/dist/utils/filename-sanitizer.d.ts.map +1 -0
- package/dist/utils/filename-sanitizer.js +156 -0
- package/dist/utils/filename-sanitizer.js.map +1 -0
- package/dist/utils/image-metadata-manager.d.ts +151 -0
- package/dist/utils/image-metadata-manager.d.ts.map +1 -0
- package/dist/utils/image-metadata-manager.js +172 -0
- package/dist/utils/image-metadata-manager.js.map +1 -0
- package/dist/utils/index-manager.d.ts +38 -0
- package/dist/utils/index-manager.d.ts.map +1 -0
- package/dist/utils/index-manager.js +110 -0
- package/dist/utils/index-manager.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/multi-format-optimizer.d.ts +96 -0
- package/dist/utils/multi-format-optimizer.d.ts.map +1 -0
- package/dist/utils/multi-format-optimizer.js +423 -0
- package/dist/utils/multi-format-optimizer.js.map +1 -0
- package/dist/utils/pricing-checker.d.ts.map +1 -1
- package/dist/utils/pricing-checker.js +3 -5
- package/dist/utils/pricing-checker.js.map +1 -1
- package/dist/utils/prompt-enhancer.d.ts +48 -0
- package/dist/utils/prompt-enhancer.d.ts.map +1 -0
- package/dist/utils/prompt-enhancer.js +169 -0
- package/dist/utils/prompt-enhancer.js.map +1 -0
- package/dist/utils/quality-validator.d.ts +61 -0
- package/dist/utils/quality-validator.d.ts.map +1 -0
- package/dist/utils/quality-validator.js +386 -0
- package/dist/utils/quality-validator.js.map +1 -0
- package/dist/utils/source-metadata.d.ts +56 -0
- package/dist/utils/source-metadata.d.ts.map +1 -0
- package/dist/utils/source-metadata.js +122 -0
- package/dist/utils/source-metadata.js.map +1 -0
- package/dist/workflow/workflow-orchestrator.d.ts.map +1 -1
- package/dist/workflow/workflow-orchestrator.js +23 -0
- package/dist/workflow/workflow-orchestrator.js.map +1 -1
- package/dist/workflow/workflow-tools.d.ts.map +1 -1
- package/dist/workflow/workflow-tools.js +18 -0
- package/dist/workflow/workflow-tools.js.map +1 -1
- package/docs/guides/provider-setup.md +543 -0
- package/package.json +2 -2
- package/scripts/README.md +460 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
# Visual Forge MCP - Provider Setup Guide
|
|
2
|
+
|
|
3
|
+
Complete guide for configuring AI image generation providers in Visual Forge MCP.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 Overview
|
|
8
|
+
|
|
9
|
+
Visual Forge MCP supports **7 AI image generation providers**. You need to configure at least one provider to generate images.
|
|
10
|
+
|
|
11
|
+
**✅ Server now starts without providers configured** - you can set them up after the server is running!
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 📋 Available Providers
|
|
16
|
+
|
|
17
|
+
| Provider | Cost/Image | Quality | Speed | Free Tier | Recommended For |
|
|
18
|
+
|----------|-----------|---------|-------|-----------|-----------------|
|
|
19
|
+
| **Google Gemini** | $0.039 | Good | Fast | Yes | General use, testing |
|
|
20
|
+
| **Replicate FLUX** | $0.003 | Excellent | Medium | Pay-as-go | Cost-effective production |
|
|
21
|
+
| **OpenAI DALL-E 3** | $0.04-$0.12 | Excellent | Medium | No | High-quality production |
|
|
22
|
+
| **Stability AI** | $0.04 | Very Good | Fast | No | Bulk generation |
|
|
23
|
+
| **xAI Grok 2** | $0.07 | Good | Fast | No | Modern architecture |
|
|
24
|
+
| **Leonardo Phoenix** | $0.02 | Very Good | Medium | Credits | Design work |
|
|
25
|
+
| **HuggingFace** | Free-$0.01 | Varies | Varies | Yes | Experimentation |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🔑 Setup Methods
|
|
30
|
+
|
|
31
|
+
Visual Forge MCP supports **3 configuration methods**. Choose what works best for your scenario:
|
|
32
|
+
|
|
33
|
+
### Method 1: Environment Variables (Recommended)
|
|
34
|
+
|
|
35
|
+
**✅ Best for:**
|
|
36
|
+
- Claude Code CLI
|
|
37
|
+
- Security-conscious users
|
|
38
|
+
- CI/CD pipelines
|
|
39
|
+
- Multiple tools sharing keys
|
|
40
|
+
|
|
41
|
+
**Pros:**
|
|
42
|
+
- Most secure (not in plain text files)
|
|
43
|
+
- Works across all tools
|
|
44
|
+
- Easy to manage
|
|
45
|
+
- Standard practice
|
|
46
|
+
|
|
47
|
+
**Cons:**
|
|
48
|
+
- Requires shell restart
|
|
49
|
+
- Need to set for each terminal session (unless in .bashrc)
|
|
50
|
+
|
|
51
|
+
**Setup:**
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Option A: Add to ~/.bashrc or ~/.zshrc (permanent)
|
|
55
|
+
echo 'export GOOGLE_API_KEY="AIza..."' >> ~/.bashrc
|
|
56
|
+
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrc
|
|
57
|
+
source ~/.bashrc
|
|
58
|
+
|
|
59
|
+
# Option B: Set for current session only (temporary)
|
|
60
|
+
export GOOGLE_API_KEY="AIza..."
|
|
61
|
+
export OPENAI_API_KEY="sk-..."
|
|
62
|
+
|
|
63
|
+
# Option C: Use .env file in project directory
|
|
64
|
+
# Create .env file in /home/michel/projects/visual-forge-mcp/
|
|
65
|
+
cat > .env << 'EOF'
|
|
66
|
+
GOOGLE_API_KEY=AIza...
|
|
67
|
+
OPENAI_API_KEY=sk-...
|
|
68
|
+
STABILITY_API_KEY=sk-...
|
|
69
|
+
REPLICATE_API_TOKEN=r8_...
|
|
70
|
+
XAI_API_KEY=xai-...
|
|
71
|
+
LEONARDO_API_KEY=...
|
|
72
|
+
HUGGINGFACE_API_KEY=hf_...
|
|
73
|
+
EOF
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Verify:**
|
|
77
|
+
```bash
|
|
78
|
+
echo $GOOGLE_API_KEY # Should show your key
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Method 2: MCP Tool (Interactive)
|
|
82
|
+
|
|
83
|
+
**✅ Best for:**
|
|
84
|
+
- Claude Desktop (GUI clients)
|
|
85
|
+
- Beginners
|
|
86
|
+
- Quick setup
|
|
87
|
+
- Testing different providers
|
|
88
|
+
|
|
89
|
+
**Pros:**
|
|
90
|
+
- Works immediately
|
|
91
|
+
- No shell configuration needed
|
|
92
|
+
- Can be done after server starts
|
|
93
|
+
- Easy to change providers
|
|
94
|
+
|
|
95
|
+
**Cons:**
|
|
96
|
+
- Keys stored in plain text (`~/.visual-forge-mcp/config.json`)
|
|
97
|
+
- Need to use MCP tool for each provider
|
|
98
|
+
- Requires MCP client support
|
|
99
|
+
|
|
100
|
+
**Setup:**
|
|
101
|
+
|
|
102
|
+
In your MCP client (Claude Code, Claude Desktop, etc.), use these tools:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
# Check current configuration
|
|
106
|
+
Use tool: get_provider_status
|
|
107
|
+
|
|
108
|
+
# Configure a provider
|
|
109
|
+
Use tool: configure_provider
|
|
110
|
+
provider: gemini
|
|
111
|
+
apiKey: AIza...
|
|
112
|
+
|
|
113
|
+
# Test the provider
|
|
114
|
+
Use tool: test_provider_connection
|
|
115
|
+
provider: gemini
|
|
116
|
+
|
|
117
|
+
# Check status again
|
|
118
|
+
Use tool: get_provider_status
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Available MCP Tools:**
|
|
122
|
+
- `configure_provider` - Add/update API key
|
|
123
|
+
- `get_provider_status` - Show configured providers
|
|
124
|
+
- `test_provider_connection` - Test if key works
|
|
125
|
+
- `remove_provider` - Remove API key
|
|
126
|
+
|
|
127
|
+
### Method 3: MCP Client Config (Automatic)
|
|
128
|
+
|
|
129
|
+
**✅ Best for:**
|
|
130
|
+
- Claude Code with environment variables
|
|
131
|
+
- Centralized configuration
|
|
132
|
+
- Team setups
|
|
133
|
+
|
|
134
|
+
**Pros:**
|
|
135
|
+
- Automatic passthrough of environment variables
|
|
136
|
+
- Centralized in MCP client config
|
|
137
|
+
- Works for all MCP servers
|
|
138
|
+
|
|
139
|
+
**Cons:**
|
|
140
|
+
- Requires editing MCP client settings
|
|
141
|
+
- Still needs environment variables set
|
|
142
|
+
|
|
143
|
+
**Setup for Claude Code:**
|
|
144
|
+
|
|
145
|
+
Edit `~/.claude/settings.json`:
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"mcpServers": {
|
|
150
|
+
"visual-forge": {
|
|
151
|
+
"command": "node",
|
|
152
|
+
"args": ["/path/to/visual-forge-mcp/dist/index.js"],
|
|
153
|
+
"env": {
|
|
154
|
+
"GOOGLE_API_KEY": "${GOOGLE_API_KEY}",
|
|
155
|
+
"OPENAI_API_KEY": "${OPENAI_API_KEY}",
|
|
156
|
+
"STABILITY_API_KEY": "${STABILITY_API_KEY}",
|
|
157
|
+
"REPLICATE_API_TOKEN": "${REPLICATE_API_TOKEN}",
|
|
158
|
+
"XAI_API_KEY": "${XAI_API_KEY}",
|
|
159
|
+
"LEONARDO_API_KEY": "${LEONARDO_API_KEY}",
|
|
160
|
+
"HUGGINGFACE_API_KEY": "${HUGGINGFACE_API_KEY}"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Then set environment variables in your shell (Method 1).
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 🔐 Getting API Keys
|
|
172
|
+
|
|
173
|
+
### Google Gemini (Recommended)
|
|
174
|
+
1. Visit: https://ai.google.dev/
|
|
175
|
+
2. Click "Get API Key"
|
|
176
|
+
3. Sign in with Google account
|
|
177
|
+
4. Create new project or select existing
|
|
178
|
+
5. Generate API key
|
|
179
|
+
6. Copy key (starts with `AIza...`)
|
|
180
|
+
|
|
181
|
+
**Format:** `AIza...` (40 characters)
|
|
182
|
+
|
|
183
|
+
### Replicate FLUX
|
|
184
|
+
1. Visit: https://replicate.com/
|
|
185
|
+
2. Sign up / Log in
|
|
186
|
+
3. Go to account settings
|
|
187
|
+
4. Generate API token
|
|
188
|
+
5. Copy token (starts with `r8_...`)
|
|
189
|
+
|
|
190
|
+
**Format:** `r8_...`
|
|
191
|
+
|
|
192
|
+
### OpenAI DALL-E
|
|
193
|
+
1. Visit: https://platform.openai.com/
|
|
194
|
+
2. Sign up / Log in
|
|
195
|
+
3. Go to API Keys section
|
|
196
|
+
4. Create new secret key
|
|
197
|
+
5. Copy key (starts with `sk-...`)
|
|
198
|
+
|
|
199
|
+
**Format:** `sk-...` (51+ characters)
|
|
200
|
+
|
|
201
|
+
### Stability AI
|
|
202
|
+
1. Visit: https://platform.stability.ai/
|
|
203
|
+
2. Sign up / Log in
|
|
204
|
+
3. Go to API Keys
|
|
205
|
+
4. Generate API key
|
|
206
|
+
5. Add credits to account
|
|
207
|
+
6. Copy key (starts with `sk-...`)
|
|
208
|
+
|
|
209
|
+
**Format:** `sk-...`
|
|
210
|
+
|
|
211
|
+
### xAI Grok
|
|
212
|
+
1. Visit: https://console.x.ai/
|
|
213
|
+
2. Sign up / Log in
|
|
214
|
+
3. Go to API Keys
|
|
215
|
+
4. Generate new key
|
|
216
|
+
5. Copy key (starts with `xai-...`)
|
|
217
|
+
|
|
218
|
+
**Format:** `xai-...`
|
|
219
|
+
|
|
220
|
+
### Leonardo.ai
|
|
221
|
+
1. Visit: https://leonardo.ai/
|
|
222
|
+
2. Sign up / Log in
|
|
223
|
+
3. Go to API Settings
|
|
224
|
+
4. Generate API key
|
|
225
|
+
5. Copy key
|
|
226
|
+
|
|
227
|
+
**Format:** Varies
|
|
228
|
+
|
|
229
|
+
### HuggingFace
|
|
230
|
+
1. Visit: https://huggingface.co/
|
|
231
|
+
2. Sign up / Log in
|
|
232
|
+
3. Go to Settings → Access Tokens
|
|
233
|
+
4. Create new token with "Read" permission
|
|
234
|
+
5. Copy token (starts with `hf_...`)
|
|
235
|
+
|
|
236
|
+
**Format:** `hf_...`
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 🎯 Complete Setup Examples
|
|
241
|
+
|
|
242
|
+
### Example 1: Quick Start with Gemini (Free)
|
|
243
|
+
|
|
244
|
+
**Using Environment Variables:**
|
|
245
|
+
```bash
|
|
246
|
+
# 1. Get Gemini API key from https://ai.google.dev/
|
|
247
|
+
# 2. Add to shell config
|
|
248
|
+
echo 'export GOOGLE_API_KEY="AIza..."' >> ~/.bashrc
|
|
249
|
+
source ~/.bashrc
|
|
250
|
+
|
|
251
|
+
# 3. Restart MCP server or Claude Code
|
|
252
|
+
# 4. Test
|
|
253
|
+
# In Claude: "Check provider status"
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Using MCP Tool:**
|
|
257
|
+
```
|
|
258
|
+
1. Start MCP server (it will start in setup mode)
|
|
259
|
+
2. In Claude Code: "Configure Gemini provider"
|
|
260
|
+
3. Tool: configure_provider
|
|
261
|
+
- provider: gemini
|
|
262
|
+
- apiKey: AIza...
|
|
263
|
+
4. Tool: test_provider_connection
|
|
264
|
+
- provider: gemini
|
|
265
|
+
5. Start generating images!
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Example 2: Production Setup (Multiple Providers)
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Add to ~/.bashrc for permanent setup
|
|
272
|
+
cat >> ~/.bashrc << 'EOF'
|
|
273
|
+
# Visual Forge MCP Providers
|
|
274
|
+
export GOOGLE_API_KEY="AIza..." # Primary (free)
|
|
275
|
+
export REPLICATE_API_TOKEN="r8_..." # Fallback (cheap)
|
|
276
|
+
export OPENAI_API_KEY="sk-..." # High quality
|
|
277
|
+
export STABILITY_API_KEY="sk-..." # Bulk generation
|
|
278
|
+
EOF
|
|
279
|
+
|
|
280
|
+
source ~/.bashrc
|
|
281
|
+
|
|
282
|
+
# Verify
|
|
283
|
+
echo $GOOGLE_API_KEY
|
|
284
|
+
echo $REPLICATE_API_TOKEN
|
|
285
|
+
|
|
286
|
+
# Restart Claude Code
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Example 3: Testing Setup (Temporary)
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
# Set for current terminal session only
|
|
293
|
+
export GOOGLE_API_KEY="AIza..."
|
|
294
|
+
export REPLICATE_API_TOKEN="r8_..."
|
|
295
|
+
|
|
296
|
+
# Start Claude Code from this terminal
|
|
297
|
+
claude
|
|
298
|
+
|
|
299
|
+
# Keys will be available for this session
|
|
300
|
+
# Will be gone when you close terminal
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Example 4: CI/CD Setup
|
|
304
|
+
|
|
305
|
+
```yaml
|
|
306
|
+
# GitHub Actions example
|
|
307
|
+
name: Generate Documentation Images
|
|
308
|
+
|
|
309
|
+
on: [push]
|
|
310
|
+
|
|
311
|
+
jobs:
|
|
312
|
+
generate-images:
|
|
313
|
+
runs-on: ubuntu-latest
|
|
314
|
+
steps:
|
|
315
|
+
- uses: actions/checkout@v3
|
|
316
|
+
|
|
317
|
+
- name: Setup Node.js
|
|
318
|
+
uses: actions/setup-node@v3
|
|
319
|
+
with:
|
|
320
|
+
node-version: '20'
|
|
321
|
+
|
|
322
|
+
- name: Install Visual Forge MCP
|
|
323
|
+
run: npm install -g @michelabboud/visual-forge-mcp
|
|
324
|
+
|
|
325
|
+
- name: Generate Images
|
|
326
|
+
env:
|
|
327
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
328
|
+
run: |
|
|
329
|
+
# Your image generation workflow
|
|
330
|
+
visual-forge-mcp generate docs/
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 🔍 Verification & Testing
|
|
336
|
+
|
|
337
|
+
### Check Configuration Status
|
|
338
|
+
|
|
339
|
+
**Using MCP Tool:**
|
|
340
|
+
```
|
|
341
|
+
Tool: get_provider_status
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Output:**
|
|
345
|
+
```json
|
|
346
|
+
{
|
|
347
|
+
"gemini": { "configured": true, "source": "environment" },
|
|
348
|
+
"openai": { "configured": true, "source": "config_file" },
|
|
349
|
+
"stability": { "configured": false },
|
|
350
|
+
"replicate": { "configured": false },
|
|
351
|
+
"xai": { "configured": false },
|
|
352
|
+
"leonardo": { "configured": false },
|
|
353
|
+
"huggingface": { "configured": false }
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Test Provider Connection
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
Tool: test_provider_connection
|
|
361
|
+
provider: gemini
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Success:**
|
|
365
|
+
```json
|
|
366
|
+
{
|
|
367
|
+
"success": true,
|
|
368
|
+
"provider": "gemini",
|
|
369
|
+
"message": "Google Gemini connection successful!"
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Failure:**
|
|
374
|
+
```json
|
|
375
|
+
{
|
|
376
|
+
"success": false,
|
|
377
|
+
"provider": "gemini",
|
|
378
|
+
"error": "Invalid API key"
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## ⚙️ Environment Variables Reference
|
|
385
|
+
|
|
386
|
+
### Required (at least one)
|
|
387
|
+
|
|
388
|
+
| Variable | Provider | Format | Example |
|
|
389
|
+
|----------|----------|--------|---------|
|
|
390
|
+
| `GOOGLE_API_KEY` | Google Gemini | `AIza...` | `AIza...abc123` |
|
|
391
|
+
| `REPLICATE_API_TOKEN` | Replicate FLUX | `r8_...` | `r8_abc123...` |
|
|
392
|
+
| `OPENAI_API_KEY` | OpenAI DALL-E | `sk-...` | `sk-proj-abc123...` |
|
|
393
|
+
| `STABILITY_API_KEY` | Stability AI | `sk-...` | `sk-abc123...` |
|
|
394
|
+
| `XAI_API_KEY` | xAI Grok | `xai-...` | `xai-abc123...` |
|
|
395
|
+
| `LEONARDO_API_KEY` | Leonardo | Various | `abc123...` |
|
|
396
|
+
| `HUGGINGFACE_API_KEY` | HuggingFace | `hf_...` | `hf_abc123...` |
|
|
397
|
+
|
|
398
|
+
### Optional Configuration
|
|
399
|
+
|
|
400
|
+
| Variable | Default | Description |
|
|
401
|
+
|----------|---------|-------------|
|
|
402
|
+
| `IMAGE_GEN_OUTPUT_DIR` | `./generated-images` | Where images are saved |
|
|
403
|
+
| `IMAGE_GEN_STATE_DIR` | `~/.visual-forge-mcp` | State/config storage |
|
|
404
|
+
| `IMAGE_GEN_LOG_LEVEL` | `info` | Log level (debug/info/warn/error) |
|
|
405
|
+
| `IMAGE_GEN_DEFAULT_PROVIDER` | `gemini` | Default provider to use |
|
|
406
|
+
| `IMAGE_OPTIMIZATION_ENABLED` | `true` | Enable web optimization |
|
|
407
|
+
| `IMAGE_OPTIMIZATION_QUALITY` | `85` | Optimization quality (1-100) |
|
|
408
|
+
| `IMAGE_OPTIMIZATION_FORMAT` | `webp` | Format (webp/jpeg/png) |
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## 🛠️ Troubleshooting
|
|
413
|
+
|
|
414
|
+
### Server won't start
|
|
415
|
+
|
|
416
|
+
**Error:** "No providers configured"
|
|
417
|
+
|
|
418
|
+
**This should not happen anymore!** The server now starts in setup mode.
|
|
419
|
+
|
|
420
|
+
If you still see this error:
|
|
421
|
+
1. Update to latest version: `npm install -g @michelabboud/visual-forge-mcp@latest`
|
|
422
|
+
2. Rebuild: `cd visual-forge-mcp && npm run build`
|
|
423
|
+
|
|
424
|
+
### "Provider not configured" when generating
|
|
425
|
+
|
|
426
|
+
**This is expected!** You need to configure at least one provider.
|
|
427
|
+
|
|
428
|
+
**Solutions:**
|
|
429
|
+
1. Use `configure_provider` MCP tool
|
|
430
|
+
2. Set environment variables and restart server
|
|
431
|
+
3. Check configuration: `get_provider_status`
|
|
432
|
+
|
|
433
|
+
### API key not working
|
|
434
|
+
|
|
435
|
+
```
|
|
436
|
+
Tool: test_provider_connection
|
|
437
|
+
provider: gemini
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Common issues:**
|
|
441
|
+
- Key has wrong format (check format in table above)
|
|
442
|
+
- Key was copied with extra spaces
|
|
443
|
+
- Key expired or was revoked
|
|
444
|
+
- API key permissions insufficient
|
|
445
|
+
- Account has no credits (Stability AI)
|
|
446
|
+
|
|
447
|
+
### Environment variables not loading
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
# Check if set
|
|
451
|
+
echo $GOOGLE_API_KEY
|
|
452
|
+
|
|
453
|
+
# If empty, check where it's defined
|
|
454
|
+
grep GOOGLE_API_KEY ~/.bashrc ~/.zshrc ~/.profile
|
|
455
|
+
|
|
456
|
+
# Make sure to source the file
|
|
457
|
+
source ~/.bashrc
|
|
458
|
+
|
|
459
|
+
# Restart terminal or Claude Code
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Config file location
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
# Check config file
|
|
466
|
+
cat ~/.visual-forge-mcp/config.json
|
|
467
|
+
|
|
468
|
+
# If doesn't exist, it's normal
|
|
469
|
+
# Keys are only saved here when using configure_provider tool
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
## 🔒 Security Best Practices
|
|
475
|
+
|
|
476
|
+
1. **Never commit API keys to git**
|
|
477
|
+
```bash
|
|
478
|
+
# Add to .gitignore
|
|
479
|
+
echo ".env" >> .gitignore
|
|
480
|
+
echo ".env.*" >> .gitignore
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
2. **Use environment variables for production**
|
|
484
|
+
- More secure than config files
|
|
485
|
+
- Standard practice
|
|
486
|
+
- Easy to rotate
|
|
487
|
+
|
|
488
|
+
3. **Restrict API key permissions**
|
|
489
|
+
- Only grant necessary permissions
|
|
490
|
+
- Use separate keys for dev/prod
|
|
491
|
+
- Rotate keys regularly
|
|
492
|
+
|
|
493
|
+
4. **Monitor usage**
|
|
494
|
+
- Check provider dashboards regularly
|
|
495
|
+
- Set up billing alerts
|
|
496
|
+
- Track costs with Visual Forge cost tracking
|
|
497
|
+
|
|
498
|
+
5. **Use config file only for testing**
|
|
499
|
+
- Convenient for development
|
|
500
|
+
- Keys stored in `~/.visual-forge-mcp/config.json`
|
|
501
|
+
- Make sure file permissions are restrictive: `chmod 600 ~/.visual-forge-mcp/config.json`
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## 📚 Quick Reference
|
|
506
|
+
|
|
507
|
+
### Setup Checklist
|
|
508
|
+
|
|
509
|
+
- [ ] Choose at least one provider
|
|
510
|
+
- [ ] Get API key from provider website
|
|
511
|
+
- [ ] Choose setup method (env vars recommended)
|
|
512
|
+
- [ ] Configure provider
|
|
513
|
+
- [ ] Test connection
|
|
514
|
+
- [ ] Verify with `get_provider_status`
|
|
515
|
+
- [ ] Start generating images!
|
|
516
|
+
|
|
517
|
+
### Common Commands
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
# Environment variables
|
|
521
|
+
export GOOGLE_API_KEY="AIza..."
|
|
522
|
+
source ~/.bashrc
|
|
523
|
+
|
|
524
|
+
# MCP Tools (in Claude)
|
|
525
|
+
configure_provider
|
|
526
|
+
get_provider_status
|
|
527
|
+
test_provider_connection
|
|
528
|
+
remove_provider
|
|
529
|
+
|
|
530
|
+
# Verification
|
|
531
|
+
echo $GOOGLE_API_KEY
|
|
532
|
+
cat ~/.visual-forge-mcp/config.json
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Getting Help
|
|
536
|
+
|
|
537
|
+
- **Documentation**: [README.md](../../README.md)
|
|
538
|
+
- **GitHub Issues**: https://github.com/michelabboud/visual-forge-mcp/issues
|
|
539
|
+
- **Provider Docs**: Links in "Getting API Keys" section above
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
**Last Updated:** 2026-01-15
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michelabboud/visual-forge-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "MCP server for AI image generation from markdown and HTML with multi-provider support and automatic web optimization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test:watch": "jest --watch",
|
|
26
26
|
"lint": "eslint src --ext .ts",
|
|
27
27
|
"clean": "rm -rf dist",
|
|
28
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
28
|
+
"prepublishOnly": "npm run clean && npm run build && npm test",
|
|
29
29
|
"pricing:show": "node scripts/update-pricing.js show",
|
|
30
30
|
"pricing:update": "node scripts/update-pricing.js update",
|
|
31
31
|
"pricing:check": "node scripts/update-pricing.js check",
|