imgx-mcp 1.0.3 → 1.1.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 +24 -0
- package/README.md +55 -4
- package/dist/cli.bundle.js +185 -109
- package/dist/image-generation-skill.zip +0 -0
- package/dist/mcp.bundle.js +175 -113
- package/package.json +62 -60
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 (2026-03-04)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Project-scoped history** — When `.imgxrc` exists, history is saved to `<project-root>/.imgx/output-history.json` instead of the global `%APPDATA%/imgx/` (or `~/.config/imgx/`). Each project gets its own independent edit history. Falls back to global when no `.imgxrc` is found
|
|
8
|
+
- **`findProjectRoot()`** — Walks up from CWD to find `.imgxrc`, with `IMGX_PROJECT_ROOT` env var override and result caching
|
|
9
|
+
- **`resolveProjectPath()`** — Resolves relative paths against the project root (or CWD if no project)
|
|
10
|
+
- **`clearGlobalHistory()`** — Explicitly clears the global history store, separate from project history
|
|
11
|
+
- **CLI `history clear --all`** — Clears both project and global history with mandatory interactive confirmation (cannot be skipped with `--yes`)
|
|
12
|
+
- 17 new tests for project root detection, project-scoped history, and path resolution (total: 54 tests)
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **`clear_history` (MCP)** now scopes to the current project automatically
|
|
17
|
+
- **Relative path resolution** — `saveImage()`, `readImageAsBase64()`, `fallbackOutputDir()`, and OpenAI `edit()` now resolve relative paths against the project root instead of the MCP server's CWD
|
|
18
|
+
- **`loadProjectConfig()`** uses `findProjectRoot()` to locate `.imgxrc` from ancestor directories, not just CWD
|
|
19
|
+
|
|
20
|
+
## 1.0.4 (2026-03-03)
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Skill ZIP for Claude Desktop** — `dist/image-generation-skill.zip` for uploading via Settings > Profile > Customize > Skills. Included in npm package under `dist/`
|
|
25
|
+
- **`build:skill-zip` npm script** — `python scripts/build-skill-zip.py` generates the ZIP with forward-slash paths and ZIP_DEFLATED compression
|
|
26
|
+
|
|
3
27
|
## 1.0.3 (2026-03-03)
|
|
4
28
|
|
|
5
29
|
### Fixed
|
package/README.md
CHANGED
|
@@ -60,6 +60,16 @@ The skill files are included in the [npm package](https://www.npmjs.com/package/
|
|
|
60
60
|
|
|
61
61
|
> **Personal skill** (all projects): Place in `~/.claude/skills/image-generation/` instead of `.claude/skills/`.
|
|
62
62
|
|
|
63
|
+
### Claude Desktop
|
|
64
|
+
|
|
65
|
+
Claude Desktop supports skills via ZIP upload:
|
|
66
|
+
|
|
67
|
+
1. Download [`image-generation-skill.zip`](dist/image-generation-skill.zip) from the repository (or find it in the [npm package](https://www.npmjs.com/package/imgx-mcp) under `dist/`)
|
|
68
|
+
2. In Claude Desktop: **Settings > Profile > Customize > Skills > Add Skill**
|
|
69
|
+
3. Upload the ZIP
|
|
70
|
+
|
|
71
|
+
> Update the skill by re-downloading and re-uploading the ZIP after new releases.
|
|
72
|
+
|
|
63
73
|
### What the skill does
|
|
64
74
|
|
|
65
75
|
The skill guides Claude Code through image workflows: blog covers, iterative editing, provider comparison, icon generation. It knows the MCP tool parameters and best practices, so you get better results with less effort.
|
|
@@ -69,7 +79,7 @@ The skill guides Claude Code through image workflows: blog covers, iterative edi
|
|
|
69
79
|
| | MCP server | Skill |
|
|
70
80
|
|---|---|---|
|
|
71
81
|
| What it does | Exposes image tools to AI agents | Guided prompt for using the tools |
|
|
72
|
-
| Works with | Any MCP-compatible tool | Claude Code |
|
|
82
|
+
| Works with | Any MCP-compatible tool | Claude Code, Claude Desktop |
|
|
73
83
|
| Install | Add to `.mcp.json` | Copy skill files to project |
|
|
74
84
|
| Team sharing | Commit `.mcp.json` to repo | Commit `.claude/skills/` to repo |
|
|
75
85
|
|
|
@@ -82,9 +92,15 @@ The skill guides Claude Code through image workflows: blog covers, iterative edi
|
|
|
82
92
|
| `generate_image` | Generate an image from a text prompt |
|
|
83
93
|
| `edit_image` | Edit an existing image with text instructions |
|
|
84
94
|
| `edit_last` | Edit the last generated/edited image (no input path needed) |
|
|
95
|
+
| `undo_edit` | Undo the last edit, reverting to the previous image in the session |
|
|
96
|
+
| `redo_edit` | Redo a previously undone edit |
|
|
97
|
+
| `edit_history` | Show all sessions and their edit history with metadata |
|
|
98
|
+
| `switch_session` | Switch to a different editing session |
|
|
99
|
+
| `clear_history` | Clear project history (optionally delete image files) |
|
|
100
|
+
| `set_output_dir` | Change the default output directory (optionally move existing files) |
|
|
85
101
|
| `list_providers` | List available providers and capabilities |
|
|
86
102
|
|
|
87
|
-
Images are saved to `~/Pictures/imgx
|
|
103
|
+
Images are saved to `~/Pictures/imgx/<session-id>/` by default. Each session gets its own directory. File paths are returned in the response. Inline image preview is included in MCP responses (base64).
|
|
88
104
|
|
|
89
105
|
### Iterative editing
|
|
90
106
|
|
|
@@ -98,6 +114,27 @@ The `edit_last` tool uses the output of the previous `generate_image` or `edit_i
|
|
|
98
114
|
|
|
99
115
|
No need to specify file paths between steps.
|
|
100
116
|
|
|
117
|
+
### Session management
|
|
118
|
+
|
|
119
|
+
Each `generate_image` call starts a new session. Subsequent `edit_last` calls are added to the same session, forming an edit chain. Each session has its own output directory.
|
|
120
|
+
|
|
121
|
+
**Undo / Redo** — Step backward and forward through the edit chain:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
generate → edit_last → edit_last → edit_last
|
|
125
|
+
↑ current
|
|
126
|
+
← undo_edit
|
|
127
|
+
↑ current
|
|
128
|
+
redo_edit →
|
|
129
|
+
↑ current
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
After undo, calling `edit_last` branches from the current position (newer entries are discarded).
|
|
133
|
+
|
|
134
|
+
**Session switching** — Use `edit_history` to see all sessions, then `switch_session` to resume a previous session. The `edit_last` tool will use the current position in the switched session.
|
|
135
|
+
|
|
136
|
+
**Output directory** — `edit_last` inherits the output directory from the session. If `generate_image` was called with `output_dir`, all subsequent `edit_last` calls in that session output to the same directory.
|
|
137
|
+
|
|
101
138
|
## API key setup
|
|
102
139
|
|
|
103
140
|
Set up at least one provider:
|
|
@@ -222,7 +259,7 @@ imgx separates **model-independent** and **model-dependent** concerns:
|
|
|
222
259
|
```
|
|
223
260
|
MCP server (tool definitions, stdio transport) CLI (argument parsing, output formatting)
|
|
224
261
|
↓ ↓
|
|
225
|
-
Core (Capability enum, ImageProvider interface, provider registry, file I/O)
|
|
262
|
+
Core (Capability enum, ImageProvider interface, provider registry, file I/O, history)
|
|
226
263
|
↓
|
|
227
264
|
Provider (model-specific API calls, capability declarations)
|
|
228
265
|
```
|
|
@@ -270,6 +307,18 @@ imgx edit -i photo.png -p "Make the background darker"
|
|
|
270
307
|
imgx edit --last -p "Add warm lighting"
|
|
271
308
|
imgx edit --last -p "Crop to 16:9" -o final.png
|
|
272
309
|
|
|
310
|
+
# Undo / redo
|
|
311
|
+
imgx undo # Revert to previous image in session
|
|
312
|
+
imgx redo # Re-apply an undone edit
|
|
313
|
+
|
|
314
|
+
# History
|
|
315
|
+
imgx history # Show all sessions and entries
|
|
316
|
+
imgx history switch <session-id> # Switch to a different session
|
|
317
|
+
imgx history clear # Clear project history (interactive)
|
|
318
|
+
imgx history clear --yes # Clear without confirmation
|
|
319
|
+
imgx history clear --keep-files # Clear history but keep image files
|
|
320
|
+
imgx history clear --all # Clear ALL history across all projects
|
|
321
|
+
|
|
273
322
|
# Provider management
|
|
274
323
|
imgx providers # List providers and capabilities
|
|
275
324
|
imgx capabilities # Detailed capabilities of current provider
|
|
@@ -328,11 +377,13 @@ Or create manually:
|
|
|
328
377
|
|
|
329
378
|
Project config is shared via Git. Do not put API keys in `.imgxrc`.
|
|
330
379
|
|
|
380
|
+
When `.imgxrc` is present, imgx-mcp treats that directory as the project root. History is saved to `<project-root>/.imgx/output-history.json` (project-scoped, not shared with other projects). Relative paths in `output` and `output_dir` are resolved against the project root instead of the MCP server's working directory.
|
|
381
|
+
|
|
331
382
|
### Settings resolution
|
|
332
383
|
|
|
333
384
|
1. CLI flags (`--model`, `--output-dir`, etc.)
|
|
334
385
|
2. Environment variables (`IMGX_MODEL`, `IMGX_OUTPUT_DIR`, etc.)
|
|
335
|
-
3. Project config (`.imgxrc`
|
|
386
|
+
3. Project config (`.imgxrc` — searched from current directory upward)
|
|
336
387
|
4. User config (`~/.config/imgx/config.json` or `%APPDATA%\imgx\config.json`)
|
|
337
388
|
5. Provider defaults
|
|
338
389
|
|