@cutoutlabs/mcp 0.2.1 → 0.2.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/LICENSE +21 -0
- package/README.md +35 -31
- package/index.js +8 -4
- package/package.json +11 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cutout Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
# @cutoutlabs/mcp
|
|
2
|
-
|
|
3
|
-
MCP server for [Cutout Labs](https://www.cutoutlabs.com). It lets AI agents remove image backgrounds from local files or URLs and saves the transparent PNG next to the input.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
1. Get a free API key at https://www.cutoutlabs.com/background-removal-api
|
|
8
|
-
2. Add the server to your MCP client (Claude Desktop, Cursor, VS Code, and others):
|
|
9
|
-
|
|
10
|
-
```json
|
|
11
|
-
{
|
|
12
|
-
"mcpServers": {
|
|
13
|
-
"cutoutlabs": {
|
|
14
|
-
"command": "npx",
|
|
15
|
-
"args": ["-y", "@cutoutlabs/mcp"],
|
|
16
|
-
"env": { "CUTOUTLABS_API_KEY": "your-key" }
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
No local install? Use the hosted server instead: `https://api.cutoutlabs.com/mcp` with the header `Authorization: Bearer your-key`. The hosted server takes image URLs or base64 and returns the image inline.
|
|
23
|
-
|
|
24
|
-
## Tools
|
|
25
|
-
|
|
26
|
-
- `remove_background`: `input_path` or `image_url`, plus optional `output_path`, `size` (`preview`, `medium`, `hd`, `full`), `format` (`png`, `webp`, `jpg`), `bg_color`, `crop`, `roi` (keep only the subject inside `x1 y1 x2 y2`), `clean_edges` (remove coloured fringes), `overwrite`. Saves the result and returns its path.
|
|
27
|
-
- `get_quota`: free calls left
|
|
28
|
-
|
|
29
|
-
## Limits
|
|
30
|
-
|
|
31
|
-
Inputs up to 12 MB.
|
|
1
|
+
# @cutoutlabs/mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [Cutout Labs](https://www.cutoutlabs.com). It lets AI agents remove image backgrounds from local files or URLs and saves the transparent PNG next to the input.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
1. Get a free API key at https://www.cutoutlabs.com/background-removal-api
|
|
8
|
+
2. Add the server to your MCP client (Claude Desktop, Cursor, VS Code, and others):
|
|
9
|
+
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"mcpServers": {
|
|
13
|
+
"cutoutlabs": {
|
|
14
|
+
"command": "npx",
|
|
15
|
+
"args": ["-y", "@cutoutlabs/mcp"],
|
|
16
|
+
"env": { "CUTOUTLABS_API_KEY": "your-key" }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
No local install? Use the hosted server instead: `https://api.cutoutlabs.com/mcp` with the header `Authorization: Bearer your-key`. The hosted server takes image URLs or base64 and returns the image inline.
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
- `remove_background`: `input_path` or `image_url`, plus optional `output_path`, `size` (`preview`, `medium`, `hd`, `full`), `format` (`png`, `webp`, `jpg`), `bg_color`, `crop`, `roi` (keep only the subject inside `x1 y1 x2 y2`), `clean_edges` (remove coloured fringes), `overwrite`. Saves the result and returns its path.
|
|
27
|
+
- `get_quota`: free calls left this month. The quota resets on the 1st of each month at 00:00 UTC.
|
|
28
|
+
|
|
29
|
+
## Limits
|
|
30
|
+
|
|
31
|
+
Inputs up to 12 MB. 150 free images per calendar month per key during launch, and 10 requests per minute.
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { access, readFile, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -38,10 +39,12 @@ async function exists(file) {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
const { version } = createRequire(import.meta.url)("./package.json");
|
|
43
|
+
|
|
41
44
|
const server = new McpServer({
|
|
42
45
|
name: "cutoutlabs",
|
|
43
46
|
title: "Cutout Labs",
|
|
44
|
-
version
|
|
47
|
+
version,
|
|
45
48
|
});
|
|
46
49
|
|
|
47
50
|
server.registerTool(
|
|
@@ -168,7 +171,7 @@ server.registerTool(
|
|
|
168
171
|
const height = response.headers.get("x-height");
|
|
169
172
|
const remaining = response.headers.get("x-quota-remaining");
|
|
170
173
|
return text(
|
|
171
|
-
`Saved ${target}${width && height ? ` (${width}×${height})` : ""}. ${remaining ?? "?"} free calls left
|
|
174
|
+
`Saved ${target}${width && height ? ` (${width}×${height})` : ""}. ${remaining ?? "?"} free calls left this month.`,
|
|
172
175
|
);
|
|
173
176
|
},
|
|
174
177
|
);
|
|
@@ -177,7 +180,8 @@ server.registerTool(
|
|
|
177
180
|
"get_quota",
|
|
178
181
|
{
|
|
179
182
|
title: "Check remaining free calls",
|
|
180
|
-
description:
|
|
183
|
+
description:
|
|
184
|
+
"Return how many free remove_background calls remain this month for the API key. The quota resets on the 1st of each month at 00:00 UTC.",
|
|
181
185
|
annotations: { readOnlyHint: true },
|
|
182
186
|
},
|
|
183
187
|
async () => {
|
|
@@ -189,7 +193,7 @@ server.registerTool(
|
|
|
189
193
|
if (!response.ok) return failure(await errorMessage(response));
|
|
190
194
|
const body = await response.json();
|
|
191
195
|
return text(
|
|
192
|
-
`${body.data.attributes.api.free_calls} free calls left
|
|
196
|
+
`${body.data.attributes.api.free_calls} free calls left this month. Resets on the 1st at 00:00 UTC.`,
|
|
193
197
|
);
|
|
194
198
|
},
|
|
195
199
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutoutlabs/mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "MCP server for Cutout Labs: remove image backgrounds from local files or URLs and save transparent PNGs.",
|
|
5
5
|
"mcpName": "com.cutoutlabs/mcp",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node scripts/smoke-test.mjs"
|
|
19
|
+
},
|
|
17
20
|
"keywords": [
|
|
18
21
|
"mcp",
|
|
19
22
|
"model-context-protocol",
|
|
@@ -23,6 +26,13 @@
|
|
|
23
26
|
"transparent-png"
|
|
24
27
|
],
|
|
25
28
|
"homepage": "https://www.cutoutlabs.com/background-removal-api",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/cutout-labs/mcp.git"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/cutout-labs/mcp/issues"
|
|
35
|
+
},
|
|
26
36
|
"license": "MIT",
|
|
27
37
|
"dependencies": {
|
|
28
38
|
"@modelcontextprotocol/sdk": "^1.32.2",
|