claude-foundry-image
claude-foundry-image
Claude Code 插件,为每个项目和每次对话提供由你自己的 Azure AI Foundry 部署(MAI 图像 API,例如 MAI-Image-2.5-Pro)支持的图像生成器。
MCP 服务器 (
server/server.mjs) — 需要 Node ≥ 18,零依赖。工具:generate_image,edit_image,check_config。技能
generate-image— 教导 Claude 何时使用这些工具,如何将一行提示扩展为可用的提示、有效的尺寸,以及写文件的路径。技能
setup— 一次性配置向导。
图像写入磁盘;只有文件路径进入对话。上下文中不包含 base64。
安装
claude plugin marketplace add jpaarhuis/claude-foundry-imageclaude plugin install foundry-image@jpaarhuis或者在交互式会话中:/plugin → Marketplaces → 添加 jpaarhuis/claude-foundry-image → 安装 foundry-image。
Related MCP server: gpt-image-mcp
配置(一次性)
服务器从环境变量读取其设置。将它们放在 ~/.claude/settings.json 的 env 下 — 一个文件,所有平台,仅 Claude Code 可见:
{
"env": {
"MAI_IMAGE_ENDPOINT": "https://<resource>.services.ai.azure.com/mai/v1/images/generations",
"MAI_IMAGE_DEPLOYMENT": "MAI-Image-2.5-Pro",
"MAI_IMAGE_API_KEY": "<key>",
"MAI_IMAGE_OUTPUT_DIR": "C:/Users/<you>/Pictures/ai"
}
}或者将它们设置为操作系统用户环境变量(Windows 上使用 setx,macOS/Linux 上在 shell 配置文件中使用 export)。无论哪种方式,都需要重启 Claude Code。
然后,在任何会话中:"运行 check_config" 或 /foundry-image:setup 进行引导式配置。
变量 | 必需 | 含义 |
| 是 | 以 |
| 是 | Foundry 中的部署名称 |
| 是 | 资源密钥 |
| 否 | 默认输出文件夹;如果未设置则回退到操作系统临时目录 |
使用
只需询问:"为 README 创建一个英雄图像,深色,等距,无文字"。Claude 会扩展提示,选择尺寸,写入 PNG(如果属于仓库则写入仓库内部)并返回路径。
工具参数,供参考:
工具 | 参数 |
|
|
|
|
| — |
MAI API 的尺寸规则:每边 ≥ 768 像素,且宽度 × 高度 ≤ 1,048,576 像素。因此 1024x1024、1024x768、1280x800 有效;1024x1536 和 1920x1080 无效。
为什么使用环境变量而不是配置文件或设置对话框?
Claude Code 插件没有每个插件的秘密存储或设置 UI。约定 — 与官方 GitHub 插件为其 PAT 使用的约定相同 — 是在插件的 .mcp.json 中使用 ${VAR} 扩展,由用户一次性设置变量。settings.json → env 是阻力最小的位置:它随你的 Claude Code 配置文件一起迁移,适用于每个项目,并在插件更新后仍然存在。
如果希望密钥不在纯文本文件中,可以在登录时从密钥存储(Key Vault、1Password CLI、Windows 凭据管理器)将其加载到环境中 — 服务器不关心变量来自哪里。
开发
npm test运行离线冒烟测试:MCP 握手、工具列表、尺寸保护、缺少配置的错误,并检查 check_config 从不泄露密钥。
许可证
MIT
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
- Alicense-qualityCmaintenanceMCP server that enables Claude Code to generate images using Google's Gemini image generation models.MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables Claude Code and Claude Desktop to generate and edit images using OpenAI's gpt-image-2 model, with results saved to disk.2MIT
- Flicense-qualityCmaintenanceRemote MCP server that exposes a generate_image tool allowing Claude to generate images via the Google Gemini API.
- Flicense-qualityCmaintenanceMCP server for generating and editing images using gpt-image-2. Enables image creation, editing, listing, and retrieval via natural language tools.
Related MCP Connectors
MCP server for Grok Imagine AI video generation
MCP server for Flux AI image generation
MCP server for NanoBanana AI image generation and editing
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/jpaarhuis/claude-foundry-image'
If you have feedback or need assistance with the MCP directory API, please join our Discord server