Krea图像MCP服务器(节点/TS)
本地MCP服务器,用于通过Krea API生成图像。
此服务器提供什么
krea_list_models:列出支持的型号和必填字段。krea_generate_image:为所选模型创建图像生成作业,并可选择等待完成。krea_upscale_image:使用Krea Topaz增强端点升级/增强现有图像URL。
支持的型号密钥:
flux_1_devflux_kontext_maxnano_banana_pronano_bananaflux_1_1_proflux_1_1_pro_ultraideogram_2aideogram_3imagen_3imagen_4imagen_4_fastimagen_4_ultrarunway_gen_4_imagechatgpt_image_1seedream_3seedream_4seededit_3qwen_imagezimage
先决条件
- Node.js
>=20 - Krea API密钥来自 Krea仪表板
安装并运行
npm install
npm run build
KREA_API_KEY=your_key_here npm start发展:
KREA_API_KEY=your_key_here npm run devMCP客户端配置示例(本地路径)
为您的机器使用绝对路径:
{
"mcpServers": {
"krea-images": {
"command": "node",
"args": ["/path/to/krea-ai-mcp/dist/index.js"],
"env": {
"KREA_API_KEY": "your_krea_api_key_here"
}
}
}
}MCP客户端配置示例(直接从GitHub运行)
当您的客户端(Arc)应从存储库URL中提取服务器代码时,这很有用:
{
"mcpServers": {
"krea-images": {
"command": "npx",
"args": ["-y", "github:Urazanev/krea-ai-mcp"],
"env": {
"KREA_API_KEY": "your_krea_api_key_here"
}
}
}
}添加到Codex
- 打开
~/.codex/config.toml. - 添加此块:
[mcp_servers.krea_images]
command = "npx"
args = ["-y", "github:Urazanev/krea-ai-mcp"]
enabled = true
startup_timeout_sec = 30
tool_timeout_sec = 300
env = { KREA_API_KEY = "your_krea_api_key_here", npm_config_cache = "/tmp/.npm-cache" }- 重新启动Codex应用程序/会话,使其重新加载MCP服务器。
工具输入注释
krea_generate_image 主要领域:
model(必填):上述型号钥匙之一prompt(必填):生成提示wait_for_completion(默认值true):如果true,民意调查/jobs/{id}直到终端状态timeout_ms(默认值180000)poll_interval_ms(默认值2000)
常见可选字段:
width,height,seedguidance_scale,num_inference_steps,negative_promptsize,stylesync_mode
特定型号的必填字段:
runway_gen_4_image:需要reference_images(URL数组)seededit_3:需要image_urlflux_1_1_pro,seedream_4,zimage:需要尺寸(width,height)\
如果缺失,服务器将默认为 1024x1024.
krea_upscale_image 主要领域:
mode(可选,默认standard):standard|generative|bloomimage_url(必填):源图像URLwidth,height(必填):输出大小model(可选):
- standard: Standard V2 | Low Resolution V2 | CGI | High Fidelity V2 | Text Refine - generative: Redefine | Recovery | Recovery V2 | Reimagine - bloom:仅 Reimagine
wait_for_completion,timeout_ms,poll_interval_ms:与生成工具的行为相同
常见的高档选择:
batch_size(1-4),output_format(png|jpg|webp),image_scaling_factor(1-32)crop_to_fill,upscaling_activatedsharpen,denoise(标准/生成)subject_detection,face_enhancement,face_enhancement_creativity,face_enhancement_strength(标准/生成)strength,fix_compression(仅标准)creativity,texture,detail(生成;creativity为1-6)face_preservation,color_preservation(仅限开花)
