Image generation in Zed: MCP server setup
Zed calls them context servers, not MCP servers: add the Image MCP Server under context_servers in settings.json with its url and the key in an Authorization: Bearer header. Zed shows every configured server under Settings → AI → MCP Servers with a status dot, so you can tell whether it connected without sending a prompt. The config is short, provided you use the right key and the right header.
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 Image MCP Server dashboard.
- 2
Open settings.json. Run zed: open settings file, or edit ~/.config/zed/settings.json directly.
- 3
Add a context_servers entry. Set url to the endpoint and pass the key as an Authorization: Bearer header.
- 4
Watch the dot. Settings → AI → MCP Servers shows a green dot and "Server is active" once it connects.
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.
{
"context_servers": {
"imagemcp": {
"url": "https://mcp.imagemcpserver.com/mcp",
"headers": { "Authorization": "Bearer sk-img-gen-…" }
}
}
}Settings → AI → MCP Servers → Add Server → Add Remote Server
Name imagemcp
URL https://mcp.imagemcpserver.com/mcp
Header Authorization: Bearer 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. Zed starts an OAuth flow whenever a remote server has no Authorization header, so send the key there as a Bearer token rather than as x-api-key.
Check it connected in Zed
Open Settings → AI → MCP Servers. The dot next to imagemcp is green with the tooltip "Server is active" once Zed has connected; other colours and tooltips say what went wrong. 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 Zed
An icon set from inside the editor
- 1
Wait for the green dot
Settings → AI → MCP Servers shows "Server is active" once Zed has connected.
- 2
Prove the key
Ask for your credit balance; get_user_info is free and is the first call that checks the key.
- 3
Ask for vectors, not pixels
Have the agent call text_to_svg once per icon, with the same style words in every prompt. It costs a flat 5 credits a call and returns SVG markup you can put straight into a component.
When Zed will not connect
| Symptom | Usual cause | Fix |
|---|---|---|
| Zed opens an OAuth sign-in | The entry has no Authorization header; x-api-key alone does not stop Zed starting OAuth, and this server has no OAuth flow to finish. | Send the key as "Authorization": "Bearer sk-img-gen-…". |
| The server is not in the MCP Servers list | The entry sits under mcpServers, which Zed ignores. | Move it under context_servers. |
| Green dot, but every call fails | The key is wrong or revoked; the server lists its tools before it ever checks the key. | Replace the key from the dashboard and ask for the credit balance again. |
Once Zed is connected
Zed 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, AI SVG generator API and Background removal 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 Zed finds these tools and calls them.
- generate_image · 8–30 creditsAI image generation APIText-to-image and image-to-image, any live model
- text_to_svg · 5 creditsAI SVG generator APIGenerate editable vector SVG from a prompt
- remove_background · 8 creditsBackground removal APICut the subject out in one call
- Use caseFavicons and app iconsThe complete workflow, with the calls in order and what each one costs.
Setting up another client too? The Cursor MCP setup and Windsurf MCP setup guides use the same endpoint and key in a different config shape.
Zed questions
How do I add an MCP server to Zed?
Either Settings → AI → MCP Servers → Add Server → Add Remote Server, or add a context_servers entry to settings.json by hand. The UI writes the same entry into your settings file.
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.
Why is Zed asking me to authenticate?
Zed falls back to MCP OAuth whenever no Authorization header is configured. Send the key as Authorization: Bearer sk-img-gen-…, which this server accepts, and Zed connects without prompting.
Can I send x-api-key instead of a Bearer token?
Not on its own. Zed decides whether to start OAuth by looking for an Authorization header, so an entry with only x-api-key still triggers the sign-in prompt. The server reads the key from Authorization: Bearer just as it does from x-api-key, so use that.
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