gwt集成
AI代理集成 双子座水印工具 --克劳德式技能、Codex式技能和共享MCP服务器
此仓库为不同的代理系列以及一个共享的MCP服务器提供了专门的技能入口点。
| 集成 | 使用 | 代理如何调用GWT |
|---|---|---|
| 根技能 | Claude Code和类似Claude的代理 | 读取根 SKILL.md → 构建CLI参数→ 直接调用二进制 |
| 食品法典技能 | Codex和Codex类代理 | 安装地点 skills/gwt/ → 读到 SKILL.md → 直接调用二进制 |
| MCP服务器 | Claude Code、Cursor、Zed、OpenAI Codex、任何MCP客户端 | 调用MCP工具→ 服务器.py→ 二进制 |
技能入口点是有意专门化的。这 mcp/ 目录在所有客户端之间保持共享。
布局策略
此仓库使用不同的技能入口点:
- 根技能布局:适用于克劳德式代理人
skills/gwt/:用于Codex类制剂
这避免了强制两个代理系列共享完全相同的提示措辞和安装程序默认值。
安装目标规则
| 集成路径 | 情况 | 安装位置 |
|---|---|---|
| Codex技能 | 正常使用 | ~/.codex/skills/gwt/bin/ |
| 克劳德式技能 | 正常使用 | ~/.claude/skills/gwt/bin/ |
| MCP服务器 | 正常使用 | 共享服务器,独立于技能布局 |
| MCP服务器 | 本地验证 GWT_LOCAL_VALIDATION=1 | ./bin/ 在回购根目录 |
| 任意路径 | 手动覆盖 `python install.py --dir | |
| ` | 您指定的目录 |
换句话说,技能层按代理家族划分,而MCP层保持共享。
______________________________________________________________________
仓库结构
gwt-integrations/
├── SKILL.md ← Claude-like skill entrypoint
├── install.py ← Claude-like skill installer
├── skills/
│ └── gwt/ ← Codex-like skill entrypoint
├── mcp/
│ ├── server.py ← Shared MCP server (4 tools)
│ └── pyproject.toml
└── LICENSE根技能和 skills/gwt/ 技能是故意不同的。他们能 无需拆分MCP服务器,即可针对各自的代理系列进行调优。______________________________________________________________________
这两条路径是如何运作的
┌──────────────────┐
│ install.py (x2) │ Each skill has its own installer
└────────┬─────────┘ (Claude → ~/.claude, Codex → ~/.codex)
│
┌─────────────────┼─────────────────┐
│ │ │
┌─▼───────────┐ ┌──▼──────────┐ ┌───▼─────────────────┐
│ Claude-Like │ │ Codex-Like │ │ MCP Server │
│ SKILL.md │ │ skills/gwt/ │ │ mcp/server.py │
│ (root) │ │ SKILL.md │ │ │
│ │ │ │ │ Agent calls tools, │
│ Agent reads │ │ Agent reads │ │ server builds args,│
│ docs, execs │ │ docs, execs │ │ execs binary │
└─────────────┘ └─────────────┘ └─────────────────────┘
Claude-like Codex-like Any MCP client二进制发现顺序(默认行为):
GWT_BINARY_PATH环境变量- 系统
PATH ~/.codex/skills/gwt/bin/~/.claude/skills/gwt/bin/./bin/在repo根目录(本地验证/回退)./mcp/bin/相对于server.py(传统回退)
如果二进制文件缺失,每个技能入口点都可以调用自己的 install.py 而MCP服务器仍在repo根目录处共享。
______________________________________________________________________
克劳德式技能
安装
cd ~/.claude/skills
git clone https://github.com/allenk/gwt-integrations gwt克劳德代码发现 SKILL.md 在 ~/.claude/skills/gwt/SKILL.md 自动。
安装GWT二进制文件
当二进制文件丢失时,代理可以运行 install.py 自动。在一个 Claude风格的安装,默认为 ~/.claude/skills/gwt/bin/:
# or run manually
python ~/.claude/skills/gwt/install.py验证
打开克劳德代码并询问: "What skills do you have?"
食典类技能
安装
对于Codex的GitHub技能安装程序,请使用专用子目录:
python install-skill-from-github.py --repo allenk/gwt-integrations --path skills/gwt安装后,Codex将从加载技能 ~/.codex/skills/gwt/,和捆绑 install.py 将默认为 ~/.codex/skills/gwt/bin/.
验证
打开Codex并确认 gwt 技能是可用的。
仅限本地验证
为了在验证期间保持仓库自包含,请在本地安装二进制文件 而不是代理技能目录:
python ./install.py --dir ./bin
# then: export GWT_LOCAL_VALIDATION=1示例提示
Remove the Gemini watermark from this image.
Remove the watermark from all images in ~/Downloads/
The bottom-right corner still has artifacts, fix it
The image keeps getting skipped, try snap search______________________________________________________________________
MCP服务器
安装
git clone https://github.com/allenk/gwt-integrations
cd gwt-integrations
pip install -e ./mcp仅限本地验证
pip install -e ./mcp
python ./install.py --dir ./binMCP服务器将在首次使用时检测到丢失的二进制文件,并返回 install_command 代理可以立即执行:
{
"found": false,
"install_command": "python /path/to/gwt-integrations/install.py --dir /path/to/gwt-integrations/bin"
}MCP服务器在代理系列之间共享,因此 install_command 总是 以本地仓库为目标 bin/ 目录——它不假定任何特定的 技能目录(~/.claude/ 或 ~/.codex/).
GWT_LOCAL_VALIDATION=1 仍然控制着 搜索顺序 在 find_gwt_binary():设置时,repo本地 bin/ 在搜索之前 技能目录。
配置客户端
克劳德代码:
claude mcp add gwt -- python /path/to/gwt-integrations/mcp/server.py光标 (.cursor/mcp.json):
{
"mcpServers": {
"gwt": {
"command": "python",
"args": ["/path/to/gwt-integrations/mcp/server.py"]
}
}
}泽德 (~/.config/zed/settings.json):
{
"context_servers": {
"gwt": {
"command": { "path": "python",
"args": ["/path/to/gwt-integrations/mcp/server.py"] }
}
}
}OpenAI Codex CLI:
codex --mcp-server "python /path/to/gwt-integrations/mcp/server.py"MCP工具
| 工具 | 目的 |
|---|---|
get_gwt_info | 检查二进制文件;回报 install_command 如果丢失 |
remove_watermark | 单文件,全参数控制 |
remove_watermark_snap | 单个文件,调整大小/重新压缩的图像 |
remove_watermark_batch | 整个目录 |
______________________________________________________________________
使用场景
当用户不想手动构建CLI时,此仓库最有用 论据。相反,他们用自然语言描述图像问题 代理将该请求映射到技能路径或MCP工具路径。
场景1:默认角落的标准Gemini水印
用户说:
Remove the Gemini watermark from this image.
Remove the Gemini watermark from the bottom-right corner of this image.代理行为:
- 技能:在没有高级标志的情况下运行标准GWT检测
- MCP:呼叫
remove_watermark(input_path, output_path)
最适合:
- 典型的Gemini输出
- 正常右下水印
- 生成后未调整大小的图像
场景2:图像被调整大小、重新压缩或截图
用户说:
This image keeps getting skipped. Try snap search.
This image was resized. Use snap search to find the watermark.代理行为:
- 技能:添加
--fallback-region ... --snap - MCP:呼叫
remove_watermark_snap(...)
最适合:
- JPEG重新压缩
- 社交媒体转发
- 截图或编辑导出
- 标准检测返回的案例
[SKIP]
场景3:一次通过后水印仍然可见
用户说:
The watermark is mostly gone but the corner still looks dirty.
There are still artifacts in the bottom-right corner. Increase the strength a bit.代理行为:
- 保持相同的检测/自定义区域
- 例如,增加降噪设置
sigma=75, strength=180 - 仅在必要时进一步升级,例如
sigma=100, strength=250
最适合:
- 微弱的边缘残留物
- 部分移除
- 水印光晕或脏角
场景4:非标准水印大小或非标准位置
用户说:
The watermark is not in the normal bottom-right position.
Search the bottom-left 600x600 area with snap.
The watermark size looks unusual. Search the bottom-right 200x200 area.代理行为:
- 使用区域约束搜索而不是整个图像假设
- 技能:使用
--fallback-region br:...或bl:...随着--snap - MCP:呼叫
remove_watermark(...)随着fallback_region,snap,
snap_max_size,以及 snap_threshold
最适合:
- 裁剪图像
- 布局移动水印位置
- 小于或大于预期的水印大小
场景5:用户知道确切的矩形
用户说:
Use custom region 683,1297,52,52 and remove it directly.
Do not use snap. Use custom region 683,1297,52,52 directly.代理行为:
- 跳过广泛搜索
- 将GWT直接应用于提供的区域
- 当人类已经视觉识别出水印时很有用
最适合:
- 来自同一来源的重复图像
- 细粒度清理
- 广泛快速搜索流向错误候选人的情况
场景6:批量处理文件夹
用户说:
Remove Gemini watermarks from every image in this folder.
Batch remove Gemini watermarks from every image in this folder.代理行为:
- 技能:在目录模式下调用GWT
- MCP:呼叫
remove_watermark_batch(input_dir, output_dir)
最适合:
- 下载文件夹
- 从单代会话导出图像
- 只有部分图像包含水印的混合文件夹
用户应如何与客服沟通
最高信号指令为:
- 描述图像是标准的、调整大小的、裁剪的还是重新压缩的
- 说出要搜索的角落:
bottom-right,bottom-left等等。 - 说明水印大小看起来是正常、较小还是较大
- 如果知道,请直接提供一个地区:
x,y,w,h - 如果工件仍然存在,请说明您是想要温和的清理还是更强烈的清理
示例:
Remove the Gemini watermark from this file.
Try snap search in the bottom-right 200x200 area.
Use custom region 683,1297,52,52.
The first pass worked, but increase strength slightly.
Process this whole folder and skip files with no watermark.实践中的技能与MCP
- 当您希望代理从正常情况推断CLI标志时,请使用该技能
在一个有技能的代理人中交谈。
- 当您需要结构化的工具调用、显式的参数和更简单的方法时,请使用MCP
与Cursor、Zed、Codex CLI或任何其他MCP客户端集成。
- 在这两种情况下,面向用户的请求都可以保持自然语言;这
集成层将该请求转换为GWT参数。
______________________________________________________________________
区域语法参考
| 格式 | 含义 |
|---|---|
x,y,w,h | 绝对像素坐标 |
br:mx,my,w,h | 右下角:margin_right、margin_bottor、宽度、高度 |
bl:mx,my,w,h | 左下角相对 |
tr:mx,my,w,h | 右上角相对 |
tl:mx,my,w,h | 左上/绝对 |
br:auto | 此图像大小的Gemini默认位置 |
______________________________________________________________________
故障排除
图像不断得到 [SKIP] --图像在生成后被调整大小/重新压缩。 告诉代理人: *“尝试快照搜索”* 或使用 remove_watermark_snap.
残留的伪影仍然可见 --告诉代理人: *“增强实力”*. 升级: sigma=75, strength=180 → sigma=100, strength=250.
macOS网守:
xattr -dr com.apple.quarantine ~/.codex/skills/gwt/bin/GeminiWatermarkTool
# or:
xattr -dr com.apple.quarantine ~/.claude/skills/gwt/bin/GeminiWatermarkToolWindows智能屏幕:
Unblock-File $env:USERPROFILE\.codex\skills\gwt\bin\GeminiWatermarkTool.exe
# or:
Unblock-File $env:USERPROFILE\.claude\skills\gwt\bin\GeminiWatermarkTool.exe______________________________________________________________________
相关
- 双子座水印工具 --核心C++工具
- Medium上的技术文章 --反向阿尔法混合深潜
- SynthID研究报告 --为什么谷歌的隐形水印无法删除
______________________________________________________________________
许可证
麻省理工学院——见 许可证
