Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@enhancor/mcp-gpt-image-2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@enhancor/mcp-gpt-image-2
Official MCP server for the Enhancor GPT Image 2 text-to-image and image-editing API.
Plug Enhancor into Claude (or any MCP-compatible client) and let the model generate, edit, or remix images natively — no middleware, no glue code.
What's in the box
Three tools, mapping 1:1 to the GPT Image 2 API:
| Tool | What it does |
|---|---|
gpt_image_2_submit_job |
Submit a generation/edit job. Returns a requestId immediately. |
gpt_image_2_check_status |
Poll a single job's status. Returns the result image URL when COMPLETED. |
gpt_image_2_submit_and_wait |
Submit and wait for completion in one call. Blocks for up to 5 min. Returns the result URL. Use this in 95% of cases. |
Each accepts the standard GPT Image 2 parameters (prompt, input_images, aspect_ratio, resolution). The MCP does not expose webhook_url — it manages that internally (see How it works below).
Install
Requires Node.js 18+.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"enhancor-gpt-image-2": {
"command": "npx",
"args": ["-y", "@enhancor/mcp-gpt-image-2"],
"env": {
"ENHANCOR_API_KEY": "sk_your_key_here"
}
}
}
}Restart Claude Desktop.
Claude Code
claude mcp add enhancor-gpt-image-2 \
--env ENHANCOR_API_KEY=sk_your_key_here \
-- npx -y @enhancor/mcp-gpt-image-2Cursor, Cline, Continue, or any MCP client
Point it at npx -y @enhancor/mcp-gpt-image-2 as the command, set ENHANCOR_API_KEY in env.
Getting an API key
- Sign up at https://app.enhancor.ai/api-dashboard
- Create an API key
- Per-product pricing lives inline in each product's docs on the dashboard. The actual per-job cost also comes back in every
/statusresponse — no hardcoded pricing table needed.
Example prompts
Once installed, ask Claude things like:
Generate a square 1K image of a friendly golden retriever wearing mirrored aviator sunglasses, studio lighting.
Take this photo [URL] and make the sky more dramatic, keep everything else the same.
Combine these three product shots [URL1] [URL2] [URL3] into a hero image for a landing page.
Claude will pick the right tool, fill the params, call Enhancor, and return the output image URL.
Pricing
Flat rate across all resolutions — 1K, 2K, and 4K all cost 51 credits ($0.051) per image.
| Resolution | Credits | Public price (USD) |
|---|---|---|
| 1K | 51 | $0.051 |
| 2K | 51 | $0.051 |
| 4K | 51 | $0.051 |
The actual per-job cost is also returned in every /status response (cost field). For live per-plan pricing and credit balance, see the dashboard: https://app.enhancor.ai/api-dashboard.
Configuration
| Environment variable | Required | Default | Notes |
|---|---|---|---|
ENHANCOR_API_KEY |
yes | — | Your Enhancor API key |
NGROK_AUTHTOKEN |
no | — | If set, the MCP uses ngrok (free tier is fine) for the webhook tunnel instead of localtunnel. More reliable for production. Get a token at https://dashboard.ngrok.com/get-started/your-authtoken |
ENHANCOR_AUTO_DOWNLOAD |
no | 1 (on) |
When on, the MCP downloads result images to a local folder and includes a local_path in the response. Critical for sandboxed MCP clients (Claude Code, Cowork) where Cloudfront URLs are blocked. Set to 0 to disable. |
ENHANCOR_DOWNLOAD_DIR |
no | ./enhancor-downloads |
Folder for auto-downloaded result files. Defaults to a subfolder of the current working directory so the file is reachable from sandboxed clients. |
ENHANCOR_GPT_IMAGE_2_BASE_URL |
no | https://apireq.enhancor.ai/api/gpt-image-2/v1 |
Override for staging / self-host |
How it works
The GPT Image 2 API delivers results via webhook. Since an MCP server runs locally on the user's machine with no public URL, this package does the webhook setup for you:
- On the first tool call, it spins up a local HTTP listener on a random loopback port.
- It exposes that listener publicly: ngrok if
NGROK_AUTHTOKENis set, otherwiselocaltunnel(no signup needed). - Every
/queuerequest sends that public URL aswebhook_urlautomatically. gpt_image_2_submit_and_waitraces the webhook against a 15-second/statuspoll — whichever reports completion first wins. That means you always get your result, even if the tunnel is flaky or a webhook is delayed for a particular request.
No configuration is required. The tunnel lifecycle is transparent. For best webhook latency and reliability (e.g. in production or long-running sessions), set NGROK_AUTHTOKEN — ngrok's free tier is sufficient.
Support & community
https://www.skool.com/publicai
License
MIT