iccdev-mcp 0.1.0__tar.gz

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,5 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.egg-info/
4
+ *.pyc
5
+ .pytest_cache/
@@ -0,0 +1,26 @@
1
+ Copyright (c) International Color Consortium.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification,
4
+ are permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice,
7
+ this list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+
13
+ 3. Neither the name of International Color Consortium (ICC) nor the names of
14
+ its contributors may be used to endorse or promote products derived from
15
+ this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,382 @@
1
+ Metadata-Version: 2.5
2
+ Name: iccdev-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for ICC color profile tools (iccDEV)
5
+ Project-URL: Homepage, https://github.com/InternationalColorConsortium/iccDEV
6
+ Project-URL: Documentation, https://github.com/InternationalColorConsortium/iccDEV/tree/master/iccdev-mcp
7
+ Project-URL: Issues, https://github.com/InternationalColorConsortium/iccDEV/issues
8
+ Author: International Color Consortium
9
+ License-Expression: BSD-3-Clause
10
+ License-File: LICENSE.md
11
+ Keywords: color,color-management,icc,mcp,profile
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Multimedia :: Graphics
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: mcp[cli]<3,>=2.1.1
25
+ Provides-Extra: dev
26
+ Requires-Dist: httpx2<3,>=2; extra == 'dev'
27
+ Requires-Dist: httpx<1,>=0.28; extra == 'dev'
28
+ Requires-Dist: pytest-asyncio<2,>=1.3; extra == 'dev'
29
+ Requires-Dist: pytest<10,>=9.0.3; extra == 'dev'
30
+ Provides-Extra: native
31
+ Provides-Extra: rest
32
+ Requires-Dist: starlette<2,>=0.46.0; extra == 'rest'
33
+ Requires-Dist: uvicorn<1,>=0.29.0; extra == 'rest'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # iccdev-mcp
37
+
38
+ MCP server for ICC color profile tools from the International Color
39
+ Consortium's RefIccMAX (iccDEV) library.
40
+
41
+ Exposes tools to AI assistants (Claude, Copilot, Cursor) via the
42
+ Model Context Protocol, covering profile inspection, color transforms,
43
+ and format conversion for ICC v2/v4 and iccMAX v5 profiles.
44
+
45
+ The static MCP inventory lists supported tools; `health_check` reports the
46
+ tools available in the running environment. Optional native capabilities can differ
47
+ between container variants, so clients and CI must inspect capability flags and
48
+ the discovered CLI inventory rather than assume a fixed health-tool total.
49
+ The response includes the available native, CLI, and service inventories so
50
+ clients can derive its dynamic `total_tools` value without numeric assumptions.
51
+
52
+
53
+ ## Install
54
+
55
+ For the lowest-friction setup, use the unified iccDEV Docker image. It includes
56
+ the MCP server, REST dependencies, CLI tools, runtime libraries, maintainer
57
+ utilities, and `Testing/` profiles, so no local iccDEV build is required.
58
+
59
+ ```bash
60
+ docker run --rm -i ghcr.io/internationalcolorconsortium/iccdev:latest \
61
+ iccdev-mcp-entrypoint mcp
62
+ ```
63
+
64
+ Use `pip install` when integrating with a local source checkout or a locally
65
+ built iccDEV toolchain. `iccdev-mcp` is published on PyPI:
66
+
67
+ ```bash
68
+ python -m pip install "iccdev-mcp[rest]"
69
+ ```
70
+
71
+ The universal wheel from a successful rolling
72
+ <a href="https://github.com/InternationalColorConsortium/iccDEV/releases/latest">Latest Build</a>
73
+ remains available for exact-tag installation:
74
+
75
+ ```bash
76
+ # Replace <release-tag> with the Git tag for the intended release.
77
+ python -m pip install "git+https://github.com/InternationalColorConsortium/iccDEV.git@<release-tag>#subdirectory=iccdev-mcp"
78
+ # Prebuilt GitHub release wheel; copy its exact tag-specific asset URL.
79
+ python -m pip install "<iccdev_mcp-wheel-asset-URL>"
80
+ # Optional REST server dependencies:
81
+ python -m pip install "iccdev-mcp[rest] @ <iccdev_mcp-wheel-asset-URL>"
82
+ ```
83
+
84
+ Release assets include one `iccdev_mcp-*-py3-none-any.whl` and a matching
85
+ source distribution for Python 3.10+. Verify their published checksums and
86
+ provenance before installation. The release workflow tests source imports,
87
+ isolated wheel and sdist installations, console entry points, stdio tool calls,
88
+ and REST health on Windows and Linux. It includes no native binaries or
89
+ compiled transform bindings. See the
90
+ <a href="https://github.com/InternationalColorConsortium/iccDEV/blob/master/docs/python-packaging-release.md">package release guide</a>
91
+ for maintainer validation and the PyPI publication boundary.
92
+
93
+ For an isolated MCP client, use the public package directly:
94
+
95
+ ```json
96
+ {
97
+ "mcpServers": {
98
+ "iccdev": {
99
+ "command": "uvx",
100
+ "args": ["iccdev-mcp"]
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ Use `uvx --from "<iccdev_mcp-wheel-asset-URL>" iccdev-mcp` when an exact
107
+ GitHub release asset is required instead of the PyPI package.
108
+
109
+ The wheel ships only the `iccdev_mcp` namespace, so it can share an environment
110
+ with the separate Cython `iccdev` bindings. Header inspection and signature
111
+ helpers are included. Pixel transforms require installing the native bindings
112
+ from `python/` in the same environment. The `validate_profile` tool dynamically
113
+ loads the public C validation ABI, so it also needs a shared IccProfLib build.
114
+ CLI-backed tools require iccDEV CLI binaries. Build iccDEV locally or
115
+ set `ICCDEV_TOOLS_DIR` and `ICCDEV_BUILD_DIR` to an existing build. The REST
116
+ health endpoint reports the bundled Python API and CLI discovery separately, so
117
+ incomplete local builds are visible at startup.
118
+
119
+ ```bash
120
+ # Point to compiled iccDEV tools
121
+ export ICCDEV_TOOLS_DIR=/path/to/iccDEV/Build/Tools
122
+ export ICCDEV_BUILD_DIR=/path/to/iccDEV/Build
123
+ ```
124
+
125
+
126
+ ## Usage
127
+
128
+ ### Docker
129
+
130
+ The unified image uses a shell default. Start an MCP transport explicitly:
131
+
132
+ ```bash
133
+ # MCP stdio mode
134
+ docker run --rm -i ghcr.io/internationalcolorconsortium/iccdev:latest \
135
+ iccdev-mcp-entrypoint mcp
136
+
137
+ # REST API mode on http://127.0.0.1:8080
138
+ docker run --rm -p 127.0.0.1:8080:8080 \
139
+ ghcr.io/internationalcolorconsortium/iccdev:latest \
140
+ iccdev-mcp-entrypoint rest
141
+ ```
142
+
143
+ Open <http://127.0.0.1:8080/> for the bundled REST dashboard. The dashboard
144
+ groups MCP-backed API routes, shows REST-only utility routes such as
145
+ file browsing and upload, and runs tools without requiring a separate client.
146
+
147
+ Supported container modes are `mcp`/`stdio`, `rest`/`api`, `sse`, and
148
+ `streamable-http`/`http`.
149
+
150
+ Useful runtime defaults are already configured:
151
+
152
+ | Variable | Default |
153
+ |----------|---------|
154
+ | `ICCDEV_TOOLS_DIR` | `/workspace/build/Tools` |
155
+ | `ICCDEV_TESTING_DIR` | `/workspace/iccDEV/Testing` |
156
+ | `ICCDEV_VALIDATION_LIBRARY` | `/opt/iccdev-validation/lib/libIccProfLib2.so` |
157
+
158
+ The unified image keeps sanitizer CLI tools, but loads the validation ABI from
159
+ an isolated non-sanitized shared build. An explicit validation library overrides
160
+ `ICCDEV_BUILD_DIR`, including the image default above. To select a custom build,
161
+ override this library path or unset it before starting the server. Empty,
162
+ missing, and unloadable explicit library paths fail closed without silently
163
+ falling back. Pip-only installations retain optional validation behavior.
164
+
165
+ Mount additional profiles read-only and list them through
166
+ `ICCDEV_PROFILE_DIRS`:
167
+
168
+ ```bash
169
+ docker run --rm -p 127.0.0.1:8080:8080 \
170
+ -v "$PWD/profiles:/profiles:ro" \
171
+ -e ICCDEV_PROFILE_DIRS=/profiles \
172
+ ghcr.io/internationalcolorconsortium/iccdev:latest \
173
+ iccdev-mcp-entrypoint rest
174
+ ```
175
+
176
+ Local build and smoke test:
177
+
178
+ ```bash
179
+ docker build -t iccdev:mcp-local -f Dockerfile .
180
+ docker run --rm -p 127.0.0.1:8080:8080 \
181
+ iccdev:mcp-local iccdev-mcp-entrypoint rest
182
+ curl -fsS http://127.0.0.1:8080/api/health
183
+ curl -fsS http://127.0.0.1:8080/api/tools
184
+ python3 .github/scripts/iccdev-container-smoke.py iccdev:mcp-local
185
+ # Optional REST dashboard in a browser
186
+ xdg-open http://127.0.0.1:8080/ # or open the URL manually
187
+ ```
188
+
189
+ ### Claude Desktop
190
+
191
+ For a container-only local client, use this unified image configuration. Keep
192
+ `-i` (open stdin), omit `-t`, and do not close stdin until requested tool
193
+ responses arrive:
194
+
195
+ ```json
196
+ {
197
+ "mcpServers": {
198
+ "iccdev": {
199
+ "command": "docker",
200
+ "args": ["run", "--rm", "-i",
201
+ "ghcr.io/internationalcolorconsortium/iccdev:latest",
202
+ "iccdev-mcp-entrypoint", "mcp"]
203
+ }
204
+ }
205
+ }
206
+ ```
207
+
208
+ Add to `claude_desktop_config.json`:
209
+
210
+ ```json
211
+ {
212
+ "mcpServers": {
213
+ "iccdev": {
214
+ "command": "iccdev-mcp",
215
+ "env": {
216
+ "ICCDEV_TOOLS_DIR": "/path/to/iccDEV/Build/Tools"
217
+ }
218
+ }
219
+ }
220
+ }
221
+ ```
222
+
223
+ ### VS Code (Copilot)
224
+
225
+ Add to `.vscode/mcp.json`:
226
+
227
+ ```json
228
+ {
229
+ "servers": {
230
+ "iccdev": {
231
+ "command": "iccdev-mcp"
232
+ }
233
+ }
234
+ }
235
+ ```
236
+
237
+ ### GitHub Copilot coding agent
238
+
239
+ Add this repository MCP configuration under
240
+ `Settings` -> `Copilot` -> `MCP servers`. GitHub requires explicit `type`,
241
+ `args`, and `tools` fields for repository MCP settings.
242
+
243
+ ```json
244
+ {
245
+ "mcpServers": {
246
+ "iccdev": {
247
+ "type": "local",
248
+ "command": "iccdev-mcp",
249
+ "args": [],
250
+ "env": {
251
+ "ICCDEV_TOOLS_DIR": "Build/Tools"
252
+ },
253
+ "tools": [
254
+ "inspect_header",
255
+ "profile_summary",
256
+ "validate_profile",
257
+ "color_transform",
258
+ "roundtrip_delta",
259
+ "icc_sig_to_str",
260
+ "enum_spaces",
261
+ "list_available_profiles",
262
+ "health_check",
263
+ "dump_profile",
264
+ "profile_to_xml",
265
+ "xml_to_profile",
266
+ "profile_to_json",
267
+ "json_to_profile",
268
+ "tiff_dump",
269
+ "jpeg_dump",
270
+ "png_dump",
271
+ "heif_dump",
272
+ "from_cube",
273
+ "apply_profiles",
274
+ "apply_named_cmm",
275
+ "create_link",
276
+ "v5_to_v4",
277
+ "spec_sep_to_tiff",
278
+ "apply_search",
279
+ "round_trip_test",
280
+ "pawg_report"
281
+ ]
282
+ }
283
+ }
284
+ }
285
+ ```
286
+
287
+ ### Remote (SSE transport)
288
+
289
+ ```bash
290
+ iccdev-mcp --transport sse --port 8080
291
+ ```
292
+
293
+
294
+ ## Tools
295
+
296
+ ### Python-Native
297
+
298
+ | Tool | Description |
299
+ |------|-------------|
300
+ | `inspect_header` | ICC profile header (22 fields + 6 computed names) |
301
+ | `profile_summary` | Compact profile classification and routing metadata |
302
+ | `validate_profile` | In-memory validation status and report from the native C API; requires a shared IccProfLib build |
303
+ | `color_transform` | Multi-profile CMM transform; requires the native `iccdev` bindings |
304
+ | `roundtrip_delta` | Device-channel round-trip Euclidean distance, not CIE Delta E; requires native bindings |
305
+ | `icc_sig_to_str` | 4-byte ICC signature to string |
306
+ | `enum_spaces` | List all 32 ICC color space identifiers |
307
+
308
+ ### CLI-Backed -- require iccDEV tools
309
+
310
+ | Tool | CLI Binary | Description |
311
+ |------|-----------|-------------|
312
+ | `dump_profile` | iccDumpProfile | Full profile text dump |
313
+ | `pawg_report` | iccPawgReport | PAWG security, conformance, and quality checklist |
314
+ | `profile_to_xml` | iccToXml | ICC to XML conversion |
315
+ | `xml_to_profile` | iccFromXml | XML to ICC conversion |
316
+ | `profile_to_json` | iccToJson | ICC to JSON conversion |
317
+ | `json_to_profile` | iccFromJson | JSON to ICC conversion |
318
+ | `round_trip_test` | iccRoundTrip | Round-trip transform fidelity |
319
+ | `tiff_dump` | iccTiffDump | TIFF metadata + embedded ICC |
320
+ | `jpeg_dump` | iccJpegDump | JPEG metadata + embedded ICC |
321
+ | `png_dump` | iccPngDump | PNG metadata + embedded ICC |
322
+ | `heif_dump` | iccHeifDump | HEIF, HEIC, and AVIF metadata + embedded ICC |
323
+ | `from_cube` | iccFromCube | .cube LUT to ICC profile |
324
+ | `apply_profiles` | iccApplyProfiles | Multi-profile TIFF transform |
325
+ | `apply_named_cmm` | iccApplyNamedCmm | Named color CMM |
326
+ | `create_link` | iccApplyToLink | Device link creation |
327
+ | `v5_to_v4` | iccV5DspObsToV4Dsp | v5 display to v4 conversion |
328
+ | `spec_sep_to_tiff` | iccSpecSepToTiff | Spectral separation |
329
+ | `apply_search` | iccApplySearch | Search-based transform |
330
+
331
+ ### CLI-Only Tools (Not MCP-Exposed)
332
+
333
+ The following built iccDEV executables do not have MCP wrappers and must not
334
+ be added to an MCP server `tools` allowlist: `iccBenchApply`, `iccProfilePlot`,
335
+ `iccProfileVisualize`, and `iccProfileVisualizePlot`. Use them directly from
336
+ the command line; see the repository
337
+ [CLI tool reference](../docs/tools-cli-reference.md) for their interfaces.
338
+
339
+ ### Utility (2)
340
+
341
+ | Tool | Description |
342
+ |------|-------------|
343
+ | `health_check` | Server status and tool availability |
344
+ | `list_available_profiles` | Browse ICC test profiles |
345
+
346
+ The REST dashboard at `/` and `/ui` provides Testing/ directory and filename
347
+ selectors for ICC, XML, JSON, TIFF, JPEG, PNG, HEIF, HEIC, AVIF, and cube inputs. `/api/tools`
348
+ returns the stable MCP inventory and separately lists REST-only utility
349
+ routes (`/api/tools`, `/api/files`, and `/api/upload`). Core CLI-backed forms
350
+ expose documented options for `iccDumpProfile` validation/verbosity/tag
351
+ selection, `iccPawgReport` profile assessment, `iccRoundTrip` intent/MPE
352
+ selection, and `iccApplyProfiles` structured or raw `-cfg` argument mode.
353
+
354
+ ## Environment Variables
355
+
356
+ | Variable | Description |
357
+ |----------|-------------|
358
+ | `ICCDEV_TOOLS_DIR` | Path to iccDEV CLI tool binaries |
359
+ | `ICCDEV_BUILD_DIR` | CMake build root containing the shared IccProfLib validation ABI |
360
+ | `ICCDEV_VALIDATION_LIBRARY` | Explicit shared IccProfLib path; overrides `ICCDEV_BUILD_DIR` |
361
+ | `ICCDEV_TESTING_DIR` | Path to iccDEV Testing/ profiles directory |
362
+ | `ICCDEV_PROFILE_DIRS` | Additional profile search directories (colon-separated) |
363
+
364
+
365
+ ## Development
366
+
367
+ ```bash
368
+ # Install for development
369
+ cd iccdev-mcp
370
+ pip install -e ".[dev,rest]"
371
+
372
+ # Run tests
373
+ pytest tests/ -v
374
+
375
+ # Run server (stdio)
376
+ python -m iccdev_mcp.server
377
+ ```
378
+
379
+
380
+ ## License
381
+
382
+ BSD 3-Clause. See [LICENSE.md](LICENSE.md).