@cutoutlabs/mcp 0.1.0 → 0.2.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/README.md +1 -1
- package/index.js +18 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ No local install? Use the hosted server instead: `https://api.cutoutlabs.com/mcp
|
|
|
23
23
|
|
|
24
24
|
## Tools
|
|
25
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`, `overwrite`. Saves the result and returns its path.
|
|
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
27
|
- `get_quota`: free calls left today. The quota resets at 00:00 UTC.
|
|
28
28
|
|
|
29
29
|
## Limits
|
package/index.js
CHANGED
|
@@ -41,7 +41,7 @@ async function exists(file) {
|
|
|
41
41
|
const server = new McpServer({
|
|
42
42
|
name: "cutoutlabs",
|
|
43
43
|
title: "Cutout Lab",
|
|
44
|
-
version: "0.
|
|
44
|
+
version: "0.2.0",
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
server.registerTool(
|
|
@@ -49,7 +49,7 @@ server.registerTool(
|
|
|
49
49
|
{
|
|
50
50
|
title: "Remove image background",
|
|
51
51
|
description:
|
|
52
|
-
"Remove the background from a local image file or an image URL and save the result to disk. Returns the saved file path. Provide exactly one of input_path or image_url.",
|
|
52
|
+
"Remove the background from a local image file or an image URL and save the result to disk. Returns the saved file path. Provide exactly one of input_path or image_url. When several objects or a person and a product appear together, the model may keep or drop some of them (for example a hand holding a product); use roi to restrict the subject area. Parts of a subject hidden behind something else cannot be recovered.",
|
|
53
53
|
inputSchema: {
|
|
54
54
|
input_path: z
|
|
55
55
|
.string()
|
|
@@ -83,6 +83,18 @@ server.registerTool(
|
|
|
83
83
|
.boolean()
|
|
84
84
|
.default(false)
|
|
85
85
|
.describe("Crop the output to the subject."),
|
|
86
|
+
roi: z
|
|
87
|
+
.string()
|
|
88
|
+
.optional()
|
|
89
|
+
.describe(
|
|
90
|
+
"Region of interest as 'x1 y1 x2 y2' in px or %, e.g. '20% 10% 80% 95%'. Only the subject inside this box is kept.",
|
|
91
|
+
),
|
|
92
|
+
clean_edges: z
|
|
93
|
+
.boolean()
|
|
94
|
+
.default(false)
|
|
95
|
+
.describe(
|
|
96
|
+
"Remove coloured fringes from the old background in hair, fur, and soft edges.",
|
|
97
|
+
),
|
|
86
98
|
overwrite: z
|
|
87
99
|
.boolean()
|
|
88
100
|
.default(false)
|
|
@@ -98,6 +110,8 @@ server.registerTool(
|
|
|
98
110
|
format,
|
|
99
111
|
bg_color,
|
|
100
112
|
crop,
|
|
113
|
+
roi,
|
|
114
|
+
clean_edges,
|
|
101
115
|
overwrite,
|
|
102
116
|
}) => {
|
|
103
117
|
if (!API_KEY) return missingKey();
|
|
@@ -121,6 +135,8 @@ server.registerTool(
|
|
|
121
135
|
form.append("size", size);
|
|
122
136
|
form.append("format", format);
|
|
123
137
|
form.append("crop", String(crop));
|
|
138
|
+
form.append("clean_edges", String(clean_edges));
|
|
139
|
+
if (roi) form.append("roi", roi);
|
|
124
140
|
if (bg_color) form.append("bg_color", bg_color);
|
|
125
141
|
|
|
126
142
|
const response = await fetch(`${API_URL}/v1.0/removebg`, {
|
package/package.json
CHANGED