Image generation in Zed: MCP server setup
Zed calls them context servers, not MCP servers: add a context_servers entry with url and headers to settings.json and the tools are live as soon as you save. Zed reloads the server process the moment you save settings.json — no restart, no reconnect step. It is the fastest of these clients to set up, provided you look for the right config key.
Add the server
- Where the config lives
- ~/.config/zed/settings.json (macOS/Linux) · %APPDATA%\Zed\settings.json (Windows)
- The key it nests under
- context_servers
- 1
Create an API key. Create a key in the imagemcpserver dashboard.
- 2
Open settings.json. Use the command palette, or edit ~/.config/zed/settings.json directly.
- 3
Add a context_servers entry. Set url to the endpoint and pass the key as an x-api-key header.
- 4
Save and watch the dot. Zed restarts the connection on save. Settings → AI → MCP Servers shows a green dot when it is live.
{
"context_servers": {
"imagemcp": {
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "x-api-key": "sk-img-gen-…" }
}
}
}Settings → AI → MCP Servers → Add Remote Server
Name imagemcp
URL https://mcp.imagemcpserver.com/mcp
Header x-api-key: sk-img-gen-…
The indicator dot next to the name turns green and its
tooltip reads "Server is active" once it has connected.It is context_servers, not mcpServers
Pasting a config from any other client into Zed does nothing, because Zed nests MCP servers under context_servers. The inner shape is otherwise familiar — url and headers for a remote server, command and args for a local one. If you leave the Authorization header out entirely, Zed assumes the server speaks OAuth and prompts you to authenticate, which is not what you want here.
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 Zed’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 Zed 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.
Zed questions
How do I add an MCP server to Zed?
Either Settings → AI → MCP Servers → Add Remote Server, or add a context_servers entry to settings.json by hand. The two are equivalent — the UI writes the same JSON.
Why does my Zed MCP config do nothing?
Check the key name. Zed nests servers under context_servers, so a block copied from a client that uses mcpServers is ignored silently. Checked September 2026.
Do I need to restart Zed after editing settings.json?
No. Zed restarts the context server process automatically when you save the file, so the tools are available in the next message.
Why is Zed asking me to authenticate?
A remote context server with no Authorization header configured makes Zed fall back to the standard MCP OAuth flow. Add the x-api-key header and it connects directly instead.
How do I know the server is actually running?
Settings → AI → MCP Servers shows an indicator dot per server. Green with a "Server is active" tooltip means it connected and the tools are loaded.
Sources & references