Trae · .trae/mcp.json · Add Manually

Image generation in Trae: MCP server setup

Agents settings → MCP → Add Manually, paste the JSON, or create .trae/mcp.json in the project root — Trae uses the conventional mcpServers / url / headers shape. Trae is one of the more forgiving clients on this list: the config is the shape most people already have in their clipboard. The setup is correspondingly short.

By the imagemcpserver.com teamPublished Trae docs checked September 2026

Add the server

Where the config lives
.trae/mcp.json (project) · Agents → MCP → Add Manually (global)
The key it nests under
mcpServers
  1. 1

    Create an API key. Create a key in the imagemcpserver dashboard.

  2. 2

    Open Agents → MCP. In Trae’s Agents settings, pick MCP and choose Add Manually.

  3. 3

    Paste the JSON. Use the mcpServers block, or create .trae/mcp.json in the project root.

  4. 4

    Attach the server to an agent. Trae scopes tools per agent, so add the server to the agent you actually use.

trae · recommendeduse this
{
  "mcpServers": {
    "imagemcp": {
      "url": "https://mcp.imagemcpserver.com/mcp",
      "headers": { "x-api-key": "sk-img-gen-…" }
    }
  }
}
If the header field is unavailable
// Some Trae builds expose only a URL field in the
// Add Manually dialog. This server also reads the key
// from a query parameter, so the URL alone is enough:

https://mcp.imagemcpserver.com/mcp?apikey=sk-img-gen-…

// Treat that URL as a secret — it carries the key.

The Raw Config button is the fast path

Trae has an explicit import route for configs written for another editor: the Raw Config (JSON) button opens the underlying mcp.json and takes a pasted block directly. If you already have this server working in Cursor or Cline, that is a copy and paste rather than a retype — the url and headers keys mean the same thing in all three.

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 Trae’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 Trae 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_models

free

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_format

1 credit

Deterministic and cheap. Auto-approving these makes an optimisation pass over a whole folder painless.

remove_backgroundtext_to_svgupscale_image

5–15 credits

Fixed prices, no model routing. Auto-approve once you trust the workflow.

generate_imageedit_imagegenerate_transparent_imagemulticall

model-priced

These route to an image model and are the ones that can run up a bill in a loop. Keep approval on.

Trae questions

How do I add an MCP server to Trae?

In the Agents settings, select MCP and choose Add Manually, then paste the JSON configuration. Alternatively create an mcp.json in a .trae/ directory at the project root.

Can I reuse a config from another IDE?

Yes — that is what the Raw Config (JSON) button is for. Trae uses the conventional mcpServers, url and headers keys, so a block from Cursor or Cline transfers unchanged.

What if I can only enter a URL, with no headers?

Append the key as a query parameter: the endpoint accepts ?apikey=… and checks it before the headers. The resulting URL contains your key, so treat it like a password.

Do the tools appear for every agent?

No — Trae scopes MCP servers to agents. Adding the server is only half the job; it also has to be attached to the agent you are actually talking to.

Is there a tool limit?

Nothing this server will run into. It exposes eleven tools in total, which is a small addition to any agent’s surface.