@imageconvertit/mcp-server 0.3.2 → 0.3.3

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/README.md CHANGED
@@ -127,6 +127,7 @@ cd packages/mcp-server && npm run smoke
127
127
  ## Notes
128
128
 
129
129
  - **One package, two meters** — Core = Automation files; Cloud AI = credits
130
+ - Paths only for Core — use **absolute** `inputDir` / `outputDir` (client cwd is often wrong)
130
131
  - Paths only for Core — never send image bytes through the model
131
132
  - Cloud AI: MCP reads the file locally, POSTs to `/api/run-ai`, writes the result path
132
133
  - Max 50 files/pages per Core authorize call · concurrency ≤ 3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imageconvertit/mcp-server",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "ImageConvertIt local MCP — Core (E-Commerce + Format, Automation file meter) + Cloud AI (12 tools, website credit wallet). Provider keys never leave the server.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,8 @@
20
20
  "scripts": {
21
21
  "start": "node ./src/index.js",
22
22
  "smoke": "node ./scripts/smoke-ops.mjs",
23
- "audit:cloud-ai": "node ./scripts/audit-cloud-ai.mjs"
23
+ "audit:cloud-ai": "node ./scripts/audit-cloud-ai.mjs",
24
+ "e2e:paid": "node ./scripts/paid-e2e-checklist.mjs"
24
25
  },
25
26
  "dependencies": {
26
27
  "@imgly/background-removal-node": "^1.4.5",
package/src/index.js CHANGED
@@ -14,12 +14,35 @@
14
14
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
15
15
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
16
16
  import { z } from 'zod';
17
+ import { createRequire } from 'node:module';
17
18
 
18
- import * as format from './tools/format.js';
19
- import * as ecom from './tools/ecommerce.js';
20
- import * as ai from './tools/ai.js';
19
+ /**
20
+ * Lazy tool modules — sharp / rembg / onnx stay off the cold-start path so
21
+ * clients can list tools before native deps finish loading.
22
+ * Call shape stays `await format.batchResize(env, args)`.
23
+ */
24
+ function lazyToolMod(specifier) {
25
+ let modPromise;
26
+ return new Proxy({}, {
27
+ get(_target, prop) {
28
+ return async (...args) => {
29
+ modPromise ||= import(specifier);
30
+ const mod = await modPromise;
31
+ const fn = mod[prop];
32
+ if (typeof fn !== 'function') {
33
+ throw new Error(`MCP tool export missing: ${String(prop)}`);
34
+ }
35
+ return fn(...args);
36
+ };
37
+ },
38
+ });
39
+ }
40
+
41
+ const format = lazyToolMod('./tools/format.js');
42
+ const ecom = lazyToolMod('./tools/ecommerce.js');
43
+ const ai = lazyToolMod('./tools/ai.js');
21
44
 
22
- const PKG_VERSION = '0.3.1';
45
+ const PKG_VERSION = createRequire(import.meta.url)('../package.json').version;
23
46
 
24
47
  const env = {
25
48
  ICI_LICENSE_KEY: process.env.ICI_LICENSE_KEY || '',