wrmmax-criativo-mcp
Officialwrmax-criativo
WRMax 的图像生成与编辑流水线。 Claude Code 是大脑;这个仓库是手。
代码对营销一无所知——它接收参数并返回文件。 决定格式、角度和提示词的是 Claude,之后它会查看生成的成品, 并决定接受还是重做。正是这个闭环构成了编排的特征。
代码、注释和消息均为英文。文档和与团队的对话使用葡萄牙语。
设置(5 分钟)
npm install
export OPENAI_API_KEY="sua-chave" # https://platform.openai.com/api-keys重要提示: ChatGPT Pro 或 Gemini 应用的订阅不提供 API 访问权限。 它们是分开计费的。需要具有有效计费的 API 密钥。
引擎 B(尚未实现):
export IMAGE_PROVIDER=gemini
export GEMINI_API_KEY="sua-chave"Related MCP server: MCP OpenAI Image Generation Server
结构
每个文件夹都有一个职责,没有文件承担两个职责。
bin/ entradas executáveis
cli.js CLI
mcp-server.js servidor MCP (só escolhe o transporte)
src/
bootstrap/ carga do .env e resolução de caminhos
config/ ÚNICO ponto que lê process.env; tabelas de modelo,
formato e qualidade
brands/ brand kit, compliance e montagem do prompt
media/ entrada, redução e saída de imagem (Drive, download,
arquivo local, preview, upload)
providers/ motores de imagem, por registro
core/ regra de negócio: artwork-service, artifact-store,
delivery
mcp/ servidor MCP, tools e transportes
http/ app Express, middleware, rotas e views
auth/ OAuth com Google
cli/ args, ajuda e orquestração do CLI
test/ node --test, sem chave e sem custo
scripts/ smoke — gasta crédito ou precisa de rede viva
brand/ um JSON por cliente
out/ saída local (só com PERSIST_OUTPUT=true)核心设计:src/core/artwork-service.js 不知道什么是 MCP,也不知道什么是 CLI。
它接收一个简单的请求并返回一个简单的结果。格式化 content block 的是
src/mcp/tool-result.js;在 stdout 上写 JSON 的是 src/cli/run.js。
因此,两个前端共享同一条路径。
所有依赖(配置、工件存储、品牌目录)都是注入的, 而不是作为单例导入——这使得在不触及环境的情况下测试路由、工具和服务成为可能。
用法
从零生成:
node bin/cli.js --brand forno-paulista --format feed \
--prompt "Studio product shot of a rustic pizza on a wooden board, steam rising"编辑客户真实照片(保留产品的同时更换背景):
node bin/cli.js --brand forno-paulista --format square \
--ref fotos/produto.jpg \
--prompt "Change only the background to a clean warm studio gradient. Keep the product, its label and the lighting on it exactly unchanged."在花费最终费用之前先做廉价草稿:
node bin/cli.js --quality draft --prompt "..."始终先做草稿再做最终版。成本只是零头,避免昂贵的返工。
MCP 服务器
npm run mcp # stdio — é o que o Claude Code fala
npm run mcp:http # Streamable HTTP em :8787/mcp — é o que conector remoto exige暴露的工具:list_brands、generate_image、edit_image。
服务器上没有列出、搜索或浏览图像的工具,这是有意为之:选择文件的是用户。 搜索工具会把注入的提示词变成对客户照片的环境扫描。
传输、认证和完整分辨率目标的细节在 CLAUDE.md 中。
Claude Code 如何使用 CLI
该命令在 stdout 上打印 JSON,在 stderr 上打印日志。这是有意为之: Claude 运行、读取 JSON、打开 PNG、评估并链接下一次调用。每次迭代之间没有人工介入。
{"ok":true,"file":"out/1755777.png","seconds":6.2,"aspectRatio":"4:5"}退出代码:0 成功 · 1 技术故障 · 2 被合规性阻止——2 的存在是为了让 hook 区分这两种情况。
合规性
brand/*.json 有一个 forbidden_terms 数组。assertPromptAllowed() 在调用之前运行并阻止——节省积分,更重要的是,不依赖模型遵守指令。
{
"name": "Forno Paulista",
"visual": {
"style": "appetizing food photography, rustic warmth, artisanal",
"colors": ["wood brown", "tomato red", "warm cream"],
"lighting": "warm golden light, natural window light",
"avoid": ["cold blue tones", "plastic-looking food"]
},
"forbidden_terms": [],
"compliance_reason": ""
}品牌 | 阻止内容 |
| 患者、之前/之后、身体、手术结果 — CFM 2.336/2023 |
快速测试护栏,无需密钥且无成本:
node bin/cli.js --brand cliente-medico --prompt "before and after of a patient"
# x BLOCKED by compliance rules for "Cliente médico (template CFM)"测试
npm test # 110 testes, sem chave de API, sem rede externa, sem custo涵盖:合规性、品牌套件、配置、工件存储、Drive 链接转换、所有下载失败模式、缩减、上传、尺寸表、完整的 OAuth 流程(使用模拟的 Google)、claude.ai 进行的发现,以及两个 MCP 传输的端到端测试。
消耗积分或依赖实时网络的测试不在套件中,位于 scripts/:
npm run probe # ~US$ 0,005 — separa "chave ruim" de "pipeline ruim"
npm run smoke:drive # ~US$ 0,01 — link do Drive de ponta a ponta
npm run smoke:edit # ~US$ 0,02 — o modelo edita ou só regenera?
npm run smoke:stateless # ~US$ 0,01 — não deixa um byte para trás环境变量
变量 | 默认值 | 用途 |
| — | 使用 |
|
| 切换图像引擎 |
|
|
|
|
| HTTP 模式的端口 |
|
| MCP 端点的路径 |
| — | 固定 Bearer(脚本和测试;claude.ai 不接受) |
| — | 使用 OAuth 时必填:它是 issuer,并且必须是固定的 |
| — | 启用 OAuth |
| — | 谁可以授权。有效的 Google 账户不是权限 |
|
| 将完整分辨率保存到 |
|
| 下载链接的有效期 |
|
| 工件存储的内存上限 |
托管(EasyPanel,或任何容器主机)
服务器有意将状态保存在内存中——OAuth 客户端、令牌和工件存储都是 Map()。
这要求一个存活且唯一的进程,这正是排除无服务器平台的原因:在那里,POST /register 会落在一个实例上,而 GET /authorize 会落在另一个实例上,后者不知道客户端。登录会间歇性失败,症状看起来与原因不符。
因此,部署是容器,规则适用于任何主机:仅一个副本。 要扩展到更多,请先将三个内存存储替换为 Redis。
根目录中的 Dockerfile 适用于任何容器平台。以下步骤来自 EasyPanel;在其他主机上,界面不同,但内容相同。
域名先行
Google 不接受 IP 地址作为 OAuth 重定向,并且要求 HTTPS。也就是说,域名是前提条件,而不是收尾工作。
将子域名的 A 记录指向服务器的 IP。没有域名的人可以使用通配符 DNS——mcp.<带连字符的IP>.sslip.io 会自动解析到名称中嵌入的 IP,只要端口 80 开放,Let's Encrypt 就会正常签发。
服务
创建服务 → 应用,源为本仓库,分支为
main。构建:Dockerfile,位于根目录。
环境变量:
变量
值
PORT8787MCP_BASE_URLhttps://<你的域名>— 末尾无斜杠OPENAI_API_KEYOpenAI 密钥
GOOGLE_CLIENT_ID来自 OAuth 客户端(Web 应用)
GOOGLE_CLIENT_SECRET来自同一个客户端
MCP_EMAILS谁可以授权,用逗号分隔
MCP_TRANSPORT=http已从Dockerfile中提供——不要定义。域名: 指向端口
8787的子域名,并启用 HTTPS。部署。
Google Cloud Console → 凭据 → 你的 OAuth 客户端,添加授权重定向,确切为:
https://<seu-dominio>/oauth/google/callbackclaude.ai → 连接器:
https://<你的域名>/mcp。
MCP_BASE_URL 成为 OAuth 的 issuer,并与客户端发现的内容逐字符比较。与配置不同的域名,或多余的斜杠,会导致绑定失败且没有有用的消息。
检查
curl https://<seu-dominio>/health重要的字段是 "auth":"oauth"。如果出现 "none",则某个 Google 变量未到达——那么服务器以开放状态启动,接受任何调用并消耗托管者的密钥。
节省调试时间的 API 注意事项
image_size中的K是大写。2k会被拒绝。gpt-image-2接受任何可被 16 整除的 WxH;较小的只接受三个固定尺寸。最终的故事/卷轴需要gpt-image-2。在编辑中,图像在输入数组中位于文本之前。
openai提供程序中没有链式编辑:previous_interaction_id属于 Gemini 的 Interactions API。要调整,请将图像作为参考重新发送。通过 URL 输入会发送自定义
User-Agent:许多来源(包括 Wikimedia)会对没有可识别 UA 的请求返回 400/403。带文本的成品:先定义文案,然后使用该文案请求图像。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides tools for generating and editing images using OpenAI's gpt-image-1 model via an MCP interface, enabling AI assistants to create and modify images based on text prompts.15Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to generate and edit images through OpenAI's DALL-E models via MCP tools. Supports text-to-image generation and image-to-image editing with configurable parameters for size, quality, and style.
- AlicenseNot gradedqualityNot gradedmaintenanceEnables image generation, editing, and blending using Gemini 2.5 Flash capabilities, plus text generation for AI-powered creative workflows through MCP tools.
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered image generation and editing using Gemini and Imagen models, supporting text-to-image, image editing, and multi-image composition through MCP tools.MIT
Related MCP Connectors
Generate on-brand images from your AI agent: design, edit, and render templates over MCP.
Generate images with any major model — one API key, one prepaid balance, one MCP.
Generate and manage AI UGC video ads through eleven typed MCP tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/WrMaxMarketing/wrmmax-criativo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server