Image generation in Amp: MCP server setup
Amp namespaces the setting: put the Image MCP Server under the dotted key "amp.mcpServers", not a bare mcpServers object, with url and headers in settings.json. Amp is built around long agentic runs across a real codebase, and it commits what it produces. Images are one of the few things it cannot make on its own, which makes this a short but worthwhile config.
Add the server
- Where the config lives
- ~/.config/amp/settings.json (user) · .amp/settings.json (workspace, wins)
- The key it nests under
- amp.mcpServers
- 1
Create an API key. Create a key in the Image MCP Server dashboard.
- 2
Open Amp settings. Edit ~/.config/amp/settings.json, or .amp/settings.json to scope it to one repository.
- 3
Add the dotted key. Put the server under "amp.mcpServers" with url and headers.
- 4
Reference the key by variable. Use ${IMAGEMCP_API_KEY} rather than the literal key if the file is committed.
- 5
Or add it from the shell. Run amp mcp add imagemcp https://mcp.imagemcpserver.com/mcp, then add the headers object in settings.json.
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.
{
"amp.mcpServers": {
"imagemcp": {
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "x-api-key": "sk-img-gen-…" }
}
}
}{
"amp.mcpServers": {
"imagemcp": {
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "x-api-key": "${IMAGEMCP_API_KEY}" }
}
}
}The key is dotted, and it is a string
Amp reads "amp.mcpServers" as a single dotted key — the same convention VS Code uses for extension settings — rather than a nested amp object containing mcpServers. Written as nested objects it will not be found. Environment variables are expanded with ${VAR} syntax, so a workspace .amp/settings.json can be committed safely, and Amp asks you to approve a workspace server before it runs.
Check it connected in Amp
Start an Amp thread and ask which image tools it has. A server in .amp/settings.json waits for your approval first. 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 Amp
Images committed with the code
- 1
Commit the workspace config
Add .amp/settings.json with "amp.mcpServers" and ${IMAGEMCP_API_KEY}; each teammate approves the server once.
- 2
Name the directory
Tell Amp where assets belong, because it commits what it writes to the working tree.
- 3
Generate, then compress
generate_image bills the model’s rate, 15 credits on the default model; compress_image is 1 credit and keeps the committed files small.
When Amp will not connect
| Symptom | Usual cause | Fix |
|---|---|---|
| Amp does not pick the server up | The settings are nested as { "amp": { "mcpServers": … } }. | Use the literal dotted key "amp.mcpServers". |
| The workspace server never runs | Servers in .amp/settings.json need explicit approval before they start. | Approve it when Amp asks. |
| Your user entry is overridden | A workspace entry with the same name takes precedence over ~/.config/amp/settings.json. | Rename one of them, or remove the workspace copy. |
Once Amp is connected
Amp 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, Transparent PNG generator API and Image compression 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 Amp finds these tools and calls them.
- generate_image · 8–30 creditsAI image generation APIText-to-image and image-to-image, any live model
- generate_transparent_image · 16–38 creditsTransparent PNG generator APIGenerate and cut out in one call
- compress_image · 1 creditImage compression APIRe-encode smaller with a quality dial
- Use caseAI Open Graph 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.
Amp questions
How do I add an MCP server to Amp?
Add it under the "amp.mcpServers" setting in settings.json, or run amp mcp add <name> <url> from the shell. Workspace-level config lives in .amp/settings.json and can be committed with the repository.
Why is Amp not picking up my server?
Check that the key is the literal dotted string "amp.mcpServers". A nested { "amp": { "mcpServers": … } } object is valid JSON and will be ignored.
Can I commit the Amp config to the repo?
Yes, that is what .amp/settings.json is for. Reference the key as ${IMAGEMCP_API_KEY} rather than pasting it, and Amp expands it at load time. Each teammate approves the workspace server once before it runs.
Does amp mcp add support custom headers?
The command takes a name and URL; header configuration is done in settings.json. Adding the server from the CLI and then editing in the headers object is a reasonable order of operations.
Will Amp commit the images it generates?
It commits what it writes to the working tree, images included. Worth pointing it at the right directory in your prompt if you care where assets land.
Sources & references