@topazlabs/mcp 0.1.10 → 0.1.12

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
@@ -1,27 +1,20 @@
1
1
  # @topazlabs/mcp
2
2
 
3
- AI image enhancement and comparison for LLMs via the [Model Context Protocol](https://modelcontextprotocol.io).
4
-
5
- Built by [Topaz Labs](https://www.topazlabs.com) — the company behind industry-leading AI upscaling and enhancement tools.
3
+ **AI image enhancement for LLMs.** An [MCP server](https://modelcontextprotocol.io) that lets Claude and other MCP-compatible AI assistants enhance images using [Topaz Labs](https://www.topazlabs.com) AI.
6
4
 
7
5
  ## Quick Start
8
6
 
9
- ```bash
10
- npx @topazlabs/mcp
11
- ```
12
-
13
- No install required. The server starts on stdio and connects to any MCP client.
14
-
15
- ## Configuration
16
-
17
7
  ### Claude Desktop
18
8
 
19
- Add to your `claude_desktop_config.json`:
9
+ Add to your Claude Desktop config:
10
+
11
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
12
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
20
13
 
21
14
  ```json
22
15
  {
23
16
  "mcpServers": {
24
- "topaz": {
17
+ "Topaz Labs": {
25
18
  "command": "npx",
26
19
  "args": ["-y", "@topazlabs/mcp"],
27
20
  "env": {
@@ -32,65 +25,98 @@ Add to your `claude_desktop_config.json`:
32
25
  }
33
26
  ```
34
27
 
35
- ### HTTP Mode (hosted)
28
+ Get an API key at [topazlabs.com](https://www.topazlabs.com).
36
29
 
37
- ```bash
38
- TOPAZ_API_KEY=<key> MCP_AUTH_TOKEN=<token> PORT=3001 npx @topazlabs/mcp --http
39
- ```
30
+ ## Compatibility
40
31
 
41
- ## Tools
32
+ This server uses **stdio transport**, which is supported by all major MCP desktop clients:
42
33
 
43
- ### `enhance`
34
+ | Client | Status |
35
+ |--------|--------|
36
+ | Claude Desktop / Cowork | ✅ |
37
+ | Cursor | ✅ |
38
+ | Windsurf | ✅ |
39
+ | VS Code (Copilot) | ✅ |
40
+ | Cline | ✅ |
41
+ | Claude Code | ✅ |
42
+ | Zed | ✅ |
44
43
 
45
- Enhance an image using Topaz Labs AI. Upscales, sharpens, and improves quality.
44
+ HTTP streaming transport (for ChatGPT, remote agents, web/mobile clients) is not yet supported but may be added in a future release.
46
45
 
47
- **Parameters:**
46
+ ## Tool
48
47
 
49
- | Parameter | Type | Required | Description |
50
- |-----------|------|----------|-------------|
51
- | `image` | string | ✅ | Local file path or URL |
52
- | `size` | object | | Output size spec (see below) |
53
- | `model` | string | | Model name (auto-selects if omitted) |
48
+ ### `image-enhance`
54
49
 
55
- **Size options:**
50
+ Send an image, get back an enhanced version. Defaults to Standard V2 and auto-upscales to 2K.
56
51
 
57
- ```json
58
- { "width": 1920, "height": 1080 } // Exact dimensions
59
- { "width": 1920 } // Scale proportionally
60
- { "height": 1080 } // Scale proportionally
61
- { "scale": 2.5 } // Multiply original dimensions
62
52
  ```
53
+ image: "~/Photos/photo.jpg" # Local path or URL (required)
54
+ size: { scale: 2 } # Optional: exact dims, single dim, or scale factor
55
+ model: "Standard V2" # Optional: defaults to Standard V2
56
+ ```
57
+
58
+ **Size options:** `{ width, height }` for exact, `{ width }` or `{ height }` for proportional, `{ scale }` for a multiplier. If omitted, images under 2K are auto-upscaled to 2K width.
63
59
 
64
- Blank defaults to auto-upscale: images under 4K get upscaled to 4K width; images already 4K+ stay at 1x.
60
+ **Models:**
65
61
 
66
- **Auto model selection:**
62
+ | Model | Type | Best for |
63
+ |-------|------|----------|
64
+ | Standard V2 | standard | General photos (default) |
65
+ | Low Resolution V2 | standard | Tiny images, thumbnails |
66
+ | CGI | standard | Digital art, renders, illustrations |
67
+ | High Fidelity V2 | standard | High-quality sources needing upscale |
68
+ | Redefine | generative | Creative reinterpretation |
69
+ | Recover 3 | generative | Low-res images, old photos |
70
+ | Standard MAX | generative | Maximum quality, slower |
71
+ | Wonder 2 | generative | Nature photography, portraits, fine detail |
67
72
 
68
- | Image Size | Default Model |
69
- |-----------|--------------|
70
- | Under 4K | Wonder |
71
- | 4K+ | Standard V2 (with face enhancement) |
73
+ ## Environment Variables
72
74
 
73
- **Available models:** Standard V2, Low Resolution V2, CGI, High Fidelity V2, Text Refine, Redefine, Recovery V2, Standard MAX, Wonder, Bloom
75
+ | Variable | Required | Description |
76
+ |----------|----------|-------------|
77
+ | `TOPAZ_API_KEY` | Yes | Topaz Labs API key |
74
78
 
75
- ### `compare`
79
+ ## Architecture
76
80
 
77
- Compare two images side-by-side with an interactive before/after slider viewer.
81
+ ```
82
+ packages/mcp/
83
+ src/
84
+ api/ — Topaz API client, types, model definitions
85
+ lib/ — Path security, URL fetching utilities
86
+ tools/ — enhance tool handler
87
+ server.ts — MCP server setup and tool registration
88
+ main.ts — Entry point (stdio transport)
89
+ test/ — Vitest test suite
90
+ ```
91
+
92
+ ## Development
93
+
94
+ ```bash
95
+ npm install
96
+ npm run build
97
+ npm test
98
+ ```
78
99
 
79
- **Parameters:**
100
+ Use `npm run dev -w packages/mcp` to watch for changes during development.
80
101
 
81
- | Parameter | Type | Required | Description |
82
- |-----------|------|----------|-------------|
83
- | `before` | string | ✅ | Path or URL to the "before" image |
84
- | `after` | string | ✅ | Path or URL to the "after" image |
85
- | `label_before` | string | | Label for before image (default: "Before") |
86
- | `label_after` | string | | Label for after image (default: "After") |
102
+ ## Publishing to npm
87
103
 
88
- **Viewer features:** Draggable slider, zoom (100%/200%/400%), pan, keyboard shortcuts (1/2/3 for before/split/after).
104
+ ```bash
105
+ # 1. Build and test
106
+ npm run build && npm test
107
+
108
+ # 2. Publish
109
+ npm publish -w packages/mcp
110
+ ```
89
111
 
90
- ## API Key
112
+ To bump the version before publishing:
113
+
114
+ ```bash
115
+ npm version patch -w packages/mcp
116
+ ```
91
117
 
92
- Get your API key at [topazlabs.com](https://www.topazlabs.com). Set it as the `TOPAZ_API_KEY` environment variable.
118
+ > **Note:** `"access": "public"` is configured in `.npmrc` (required for scoped packages). Make sure you're logged in to an npm account that has access to the `@topazlabs` scope: `npm login`.
93
119
 
94
120
  ## License
95
121
 
96
- MIT
122
+ MIT — [Topaz Labs](https://www.topazlabs.com)
package/dist/server.js CHANGED
@@ -17,7 +17,7 @@ export function createServer() {
17
17
  }
18
18
  const server = new McpServer({ name: "Topaz Labs", version: "0.1.7" }, { capabilities: { tools: {} } });
19
19
  // --- Tool: enhance ---
20
- server.registerTool("enhance", {
20
+ server.registerTool("image-enhance", {
21
21
  title: "Enhance Image",
22
22
  description: "Enhance an image using Topaz Labs AI. Upscales, sharpens, and improves quality. Accepts a local file path or URL. If the user shares an image in the conversation without providing a path, ask them for the file path or a URL to the original image.",
23
23
  inputSchema: {
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,UAAU,YAAY;IAC1B,IAAI,MAA+B,CAAC;IAEpC,SAAS,SAAS;QAChB,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;YACzC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,EACx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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBACpD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBACrD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;aAC9C,CAAC;iBACD,QAAQ,EAAE;iBACV,QAAQ,CACP,kIAAkI,CACnI;YACH,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,6JAA6J,CAC9J;SACJ;KACF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,OAAO,MAAM,aAAa,CACxB;gBACE,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,EACD,SAAS,EAAE,CACZ,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,SAAS,CACd,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CACjD,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topazlabs/mcp",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Topaz Labs MCP server — AI image enhancement for LLMs",
5
5
  "type": "module",
6
6
  "bin": {