Image generation in Amp: MCP server setup
Amp namespaces the setting: the key is the dotted string "amp.mcpServers", not a bare mcpServers object — add url and headers under it 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)
- The key it nests under
- amp.mcpServers
- 1
Create an API key. Create a key in the imagemcpserver 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.
{
"amp.mcpServers": {
"imagemcp": {
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "x-api-key": "sk-img-gen-…" }
}
}
}# Committed workspace config, key read from the environment:
{
"amp.mcpServers": {
"imagemcp": {
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "x-api-key": "${IMAGEMCP_API_KEY}" }
}
}
}
# Or add it from the shell:
$ amp mcp add imagemcp https://mcp.imagemcpserver.com/mcpThe 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.
The endpoint and the key are identical in every client. The wrapper around them is not, and that wrapper is where almost every “correct” config that does nothing goes wrong. Checked September 2026 against Amp’s own documentation — see the sources below.
Three ways to send the key
The server resolves your API key from any of these, checked in this order. That matters when a client only gives you a URL field and no way to set a header — you are not stuck, and you do not need a bridge process.
Query parameter
?apikey=sk-img-gen-…Checked first. The fallback for a client whose config is a bare URL field.
x-api-key header
x-api-key: sk-img-gen-…The documented default, and what every client below uses unless noted.
Authorization header
Authorization: Bearer sk-img-gen-…Accepted as a bearer token, which is what a client with only a token field will send.
A key in a query string ends up in shell history, process listings and any log the client keeps, so prefer a header where the client allows one. Where it does not, treat the whole URL as the secret and rotate it as freely as you would a password.
What each tool costs
Wherever Amp lets you approve tools individually, the useful line to draw is not between image tools and other tools — it is between calls with a fixed price and calls that route to a model.
get_user_infolist_modelsfree
Safe to auto-approve wherever the client supports it. These are how the agent finds out what it can afford before it spends anything.
compress_imageconvert_format1 credit
Deterministic and cheap. Auto-approving these makes an optimisation pass over a whole folder painless.
remove_backgroundtext_to_svgupscale_image5–15 credits
Fixed prices, no model routing. Auto-approve once you trust the workflow.
generate_imageedit_imagegenerate_transparent_imagemulticallmodel-priced
These route to an image model and are the ones that can run up a bill in a loop. Keep approval on.
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. Checked September 2026.
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.
Does amp mcp add support custom headers?
The CLI 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