watermarkbuster-mcp 1.0.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/LICENSE +22 -0
- package/README.md +69 -0
- package/package.json +37 -0
- package/src/cli.js +66 -0
- package/src/server.js +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rigale (Watermark Buster interface, web service, and design)
|
|
4
|
+
Copyright (c) 2026 watermarks-remover contributors (cleaning engine)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Watermark Buster MCP
|
|
2
|
+
|
|
3
|
+
Connect a local MCP client to the hosted Watermark Buster tools. The package is a bridge. It does not run the cleaning engine on your computer.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js 20 or newer
|
|
8
|
+
- An internet connection to `https://watermarkbuster.com/mcp`
|
|
9
|
+
|
|
10
|
+
No account, API token, GPU, Python, or local model is required.
|
|
11
|
+
|
|
12
|
+
## Use with `npx`
|
|
13
|
+
|
|
14
|
+
Set these values in your MCP client:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
Command: npx
|
|
18
|
+
Arguments: -y watermarkbuster-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For clients that use an `mcpServers` JSON object, the matching form is:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"watermark-buster": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "watermarkbuster-mcp"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The MCP client starts the command. Running it in a normal terminal shows no user interface because it waits for MCP messages on standard input.
|
|
35
|
+
|
|
36
|
+
## Install first
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install --global watermarkbuster-mcp
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then set the MCP command to:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
watermarkbuster-mcp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Tools
|
|
49
|
+
|
|
50
|
+
The bridge reads the current tool list from the hosted MCP server when it starts. The current tools are:
|
|
51
|
+
|
|
52
|
+
- `inspect_text`
|
|
53
|
+
- `clean_text`
|
|
54
|
+
- `clean_file`
|
|
55
|
+
- `get_capabilities`
|
|
56
|
+
|
|
57
|
+
## Data flow
|
|
58
|
+
|
|
59
|
+
Tool input is sent to `https://watermarkbuster.com` for processing. The hosted service processes content for the call and does not archive it. Do not use this npm bridge if content must stay on your computer.
|
|
60
|
+
|
|
61
|
+
For clients that support remote Streamable HTTP MCP, connect directly to `https://watermarkbuster.com/mcp` instead.
|
|
62
|
+
|
|
63
|
+
## Connection errors
|
|
64
|
+
|
|
65
|
+
If the hosted service cannot be reached, the command writes `Watermark Buster MCP: <reason>` to standard error and exits with a failure status. Check that `https://watermarkbuster.com/mcp` is reachable, then let the MCP client start the command again.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "watermarkbuster-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Connect local MCP clients to the hosted Watermark Buster tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"watermarkbuster-mcp": "src/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"check": "node --check src/cli.js && node --check src/server.js",
|
|
19
|
+
"test": "node --test"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"mcp",
|
|
23
|
+
"model-context-protocol",
|
|
24
|
+
"watermark",
|
|
25
|
+
"metadata",
|
|
26
|
+
"unicode"
|
|
27
|
+
],
|
|
28
|
+
"homepage": "https://watermarkbuster.com/mcp",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@modelcontextprotocol/client": "2.0.0",
|
|
35
|
+
"@modelcontextprotocol/server": "2.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/cli.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Client,
|
|
5
|
+
StreamableHTTPClientTransport,
|
|
6
|
+
} from "@modelcontextprotocol/client";
|
|
7
|
+
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
PACKAGE_VERSION,
|
|
11
|
+
REMOTE_MCP_ENDPOINT,
|
|
12
|
+
createBridgeServer,
|
|
13
|
+
} from "./server.js";
|
|
14
|
+
|
|
15
|
+
function reportFailure(error) {
|
|
16
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
17
|
+
console.error(`Watermark Buster MCP: ${message}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function reportShutdownOutcomes(shutdownOutcomes) {
|
|
21
|
+
for (const shutdownOutcome of shutdownOutcomes) {
|
|
22
|
+
if (shutdownOutcome.status === "rejected") {
|
|
23
|
+
reportFailure(shutdownOutcome.reason);
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function registerShutdown(stdioHandle, remoteClient) {
|
|
30
|
+
let shutdownStarted = false;
|
|
31
|
+
const shutdown = async () => {
|
|
32
|
+
if (shutdownStarted) return;
|
|
33
|
+
shutdownStarted = true;
|
|
34
|
+
const shutdownOutcomes = await Promise.allSettled([
|
|
35
|
+
stdioHandle.close(),
|
|
36
|
+
remoteClient.close(),
|
|
37
|
+
]);
|
|
38
|
+
reportShutdownOutcomes(shutdownOutcomes);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
process.stdin.once("end", () => void shutdown());
|
|
42
|
+
process.once("SIGINT", () => void shutdown());
|
|
43
|
+
process.once("SIGTERM", () => void shutdown());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function startBridge() {
|
|
47
|
+
const remoteClient = new Client({
|
|
48
|
+
name: "watermarkbuster-mcp",
|
|
49
|
+
version: PACKAGE_VERSION,
|
|
50
|
+
});
|
|
51
|
+
const remoteTransport = new StreamableHTTPClientTransport(
|
|
52
|
+
new URL(REMOTE_MCP_ENDPOINT),
|
|
53
|
+
);
|
|
54
|
+
await remoteClient.connect(remoteTransport);
|
|
55
|
+
const { tools } = await remoteClient.listTools();
|
|
56
|
+
const stdioHandle = serveStdio(
|
|
57
|
+
() => createBridgeServer(remoteClient, tools),
|
|
58
|
+
{ onerror: reportFailure },
|
|
59
|
+
);
|
|
60
|
+
registerShutdown(stdioHandle, remoteClient);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
startBridge().catch((error) => {
|
|
64
|
+
reportFailure(error);
|
|
65
|
+
process.exitCode = 1;
|
|
66
|
+
});
|
package/src/server.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
import { McpServer, fromJsonSchema } from "@modelcontextprotocol/server";
|
|
4
|
+
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const packageMetadata = require("../package.json");
|
|
7
|
+
|
|
8
|
+
export const REMOTE_MCP_ENDPOINT = "https://watermarkbuster.com/mcp";
|
|
9
|
+
export const PACKAGE_VERSION = packageMetadata.version;
|
|
10
|
+
|
|
11
|
+
const SERVER_INSTRUCTIONS = [
|
|
12
|
+
"This local bridge forwards Watermark Buster tool calls to",
|
|
13
|
+
`${REMOTE_MCP_ENDPOINT}. Content leaves this machine for processing.`,
|
|
14
|
+
"The hosted service does not archive submitted content.",
|
|
15
|
+
].join(" ");
|
|
16
|
+
|
|
17
|
+
function remoteToolConfiguration(remoteTool) {
|
|
18
|
+
const configuration = {
|
|
19
|
+
title: remoteTool.title,
|
|
20
|
+
description: remoteTool.description,
|
|
21
|
+
inputSchema: fromJsonSchema(remoteTool.inputSchema),
|
|
22
|
+
annotations: remoteTool.annotations,
|
|
23
|
+
icons: remoteTool.icons,
|
|
24
|
+
_meta: remoteTool._meta,
|
|
25
|
+
};
|
|
26
|
+
if (remoteTool.outputSchema) {
|
|
27
|
+
configuration.outputSchema = fromJsonSchema(remoteTool.outputSchema);
|
|
28
|
+
}
|
|
29
|
+
return configuration;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function remoteToolHandler(remoteClient, remoteToolName) {
|
|
33
|
+
return (toolArguments, context) => remoteClient.callTool(
|
|
34
|
+
{ name: remoteToolName, arguments: toolArguments },
|
|
35
|
+
{ signal: context.mcpReq.signal },
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function createBridgeServer(remoteClient, remoteTools) {
|
|
40
|
+
const bridgeServer = new McpServer({
|
|
41
|
+
name: "watermarkbuster-mcp",
|
|
42
|
+
title: "Watermark Buster",
|
|
43
|
+
version: PACKAGE_VERSION,
|
|
44
|
+
description: "Connect local MCP clients to the hosted Watermark Buster tools.",
|
|
45
|
+
websiteUrl: "https://watermarkbuster.com/mcp",
|
|
46
|
+
}, { instructions: SERVER_INSTRUCTIONS });
|
|
47
|
+
|
|
48
|
+
for (const remoteTool of remoteTools) {
|
|
49
|
+
bridgeServer.registerTool(
|
|
50
|
+
remoteTool.name,
|
|
51
|
+
remoteToolConfiguration(remoteTool),
|
|
52
|
+
remoteToolHandler(remoteClient, remoteTool.name),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return bridgeServer;
|
|
56
|
+
}
|