Image generation in Droid: MCP server setup
Run droid mcp add imagemcp <endpoint> --type http with the key in --header and --no-oauth, and Droid writes the Image MCP Server into ~/.factory/mcp.json, reloading as soon as the file changes. Droid is built for delegated work: you describe an outcome and it goes away and does it. Image tools mean the outcome can include the images, rather than a note explaining which ones are missing.
Add the server
- Where the config lives
- ~/.factory/mcp.json (user) · .factory/mcp.json (project, committed)
- The key it nests under
- mcpServers
- 1
Create an API key. Create a key in the Image MCP Server dashboard.
- 2
Run droid mcp add. Pass --type http, the key with --header, and --no-oauth.
- 3
Or edit mcp.json. Write the entry into ~/.factory/mcp.json yourself; servers added from the CLI always land there.
- 4
Check /mcp. The /mcp manager lists the server and the file it came from.
The server reads the key from an x-api-key header, an Authorization: Bearer header or a ?apikey= query parameter — see authentication. What each tool costs is on the credits page.
$ droid mcp add imagemcp https://mcp.imagemcpserver.com/mcp \
--type http \
--header "x-api-key: sk-img-gen-…" \
--no-oauth
# Written to ~/.factory/mcp.json. Droid reloads when
# the file changes, so there is no restart step.{
"mcpServers": {
"imagemcp": {
"type": "http",
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "x-api-key": "${IMAGEMCP_API_KEY}" },
"oauth": false
}
}
}Header auth means turning OAuth off
Droid tries OAuth discovery on remote servers by default. This server has no authorization server to find — it authenticates with a key header only — which is what --no-oauth, stored as "oauth": false, is for. Keep the key out of .factory/mcp.json: that file is committed, and Factory’s docs say header tokens belong in ~/.factory/mcp.json or the environment. ${VAR} references in headers are expanded in memory at connection time, so the resolved value never lands on disk.
Check it connected in Droid
Open the /mcp manager: imagemcp should be listed, along with which mcp.json it came from. Then ask for your image credit balance: get_user_info is free, and it is the first call that actually checks the key, because the server lists its tools without one.
Example workflow in Droid
Delegate the product shots
- 1
Keep the key off disk
Add the server with droid mcp add and --no-oauth, and reference ${IMAGEMCP_API_KEY} in the header of ~/.factory/mcp.json.
- 2
Decide what loads
Use enabledTools on the entry to load only the tools the job needs, so a long unattended run cannot reach anything else.
- 3
Describe the outcome
Ask for cut-out, upscaled product images: remove_background is 8 credits and upscale_image 15 per image. The free lookups let Droid check the balance itself.
When Droid will not connect
| Symptom | Usual cause | Fix |
|---|---|---|
| Droid asks you to sign in | OAuth is still on for the entry. | Re-add it with --no-oauth, or set "oauth": false. |
| The connection fails naming a missing variable | IMAGEMCP_API_KEY is not set in the shell Droid started from. | Export it. Only the ${NAME} form is expanded, with no default-value syntax. |
| droid mcp remove cannot remove it | The server is defined in the project .factory/mcp.json. | Edit that file directly; project servers cannot be removed from the CLI or /mcp. |
Once Droid is connected
Droid gets the server’s 8 image tools, plus 3 utility tools for the credit balance, the model list and batching: 11 MCP tools in all. The ones most setups reach for first are the AI image generation API, Background removal API and AI image upscaler API; each page covers what the tool does and what a call costs. If the protocol itself is new to you, what is MCP explains how a client like Droid finds these tools and calls them.
- generate_image · 8–30 creditsAI image generation APIText-to-image and image-to-image, any live model
- remove_background · 8 creditsBackground removal APICut the subject out in one call
- upscale_image · 15 creditsAI image upscaler APICrisp super-resolution in one call
- Use caseEcommerce product imagesThe complete workflow, with the calls in order and what each one costs.
Setting up another client too? The Claude Code MCP setup and Codex CLI MCP setup guides use the same endpoint and key in a different config shape.
Droid questions
How do I add an MCP server to Droid?
droid mcp add <name> <url> --type http is the quickest route, with --header for the key and --no-oauth for a header-authenticated server like this one. Editing ~/.factory/mcp.json by hand does the same thing.
Where should the key live?
In ~/.factory/mcp.json or the environment, never in the project .factory/mcp.json, which is committed. Droid expands ${NAME} in header values from your shell environment at connection time and never writes the resolved value back to the file.
Do I need to restart after adding a server?
No. Droid reloads automatically when an mcp.json file changes, so a new server is available straight away.
Why --no-oauth?
It stores "oauth": false, which Factory documents for header- or API-key-authenticated remote servers. Without it Droid looks for an OAuth authorization server, and this one has none.
Can Droid run image generation unattended?
It can, which is the reason to think about budget before you start. The free lookups let it check the balance itself, and enabledTools or disabledTools on the entry decide which tools load at all, which keeps the model-priced ones out of a long unattended run.
Sources & references