Roo Code · mcp_settings.json · streamable-http

Image generation in Roo Code: MCP server setup

Add a mcpServers entry with "type": "streamable-http" — omitting type, or writing "http", fails — to Roo Code’s global mcp_settings.json or a project .roo/mcp.json. Roo Code plans a change and then executes it mode by mode. Image tools slot into that plan the same way an edit does, so the asset arrives with the markup rather than after it.

By the imagemcpserver.com teamPublished Roo Code docs checked September 2026

Add the server

Where the config lives
mcp_settings.json (global) · .roo/mcp.json (project, wins on conflict)
The key it nests under
mcpServers
  1. 1

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

  2. 2

    Open MCP settings. Use the MCP panel in Roo Code, or edit mcp_settings.json directly.

  3. 3

    Add the entry with an explicit type. Set "type": "streamable-http" — Roo will not guess it from the url.

  4. 4

    Auto-approve the cheap tools. Put the free and single-credit tools in alwaysAllow and keep approval on for model-priced ones.

roo code · recommendeduse this
{
  "mcpServers": {
    "imagemcp": {
      "type": "streamable-http",
      "url": "https://mcp.imagemcpserver.com/mcp",
      "headers": { "x-api-key": "sk-img-gen-…" },
      "alwaysAllow": [
        "get_user_info", "list_models",
        "compress_image", "convert_format"
      ],
      "disabled": false
    }
  }
}
Project-scoped, committed with the repo
// .roo/mcp.json — takes precedence over the global file
// for any server name that appears in both.
{
  "mcpServers": {
    "imagemcp": {
      "type": "streamable-http",
      "url": "https://mcp.imagemcpserver.com/mcp",
      "headers": { "x-api-key": "${env:IMAGEMCP_API_KEY}" }
    }
  }
}

The type field is not optional

Roo Code will not infer the transport from the presence of a url. Writing "http", or leaving type out entirely, fails rather than falling back. It has to be "streamable-http", hyphenated. If a server name exists in both the global file and .roo/mcp.json, the project file wins.

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 Roo Code’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 Roo Code 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.

Roo Code questions

How do I add an MCP server to Roo Code?

Through the MCP panel, or by editing mcp_settings.json for a global server and .roo/mcp.json for a project-scoped one. The project file takes precedence when a server name appears in both.

Why does my Roo Code MCP server fail to connect?

The type field. Roo Code requires "type": "streamable-http" for a remote HTTP server; "http" or an omitted type will not work and does not silently fall back. Checked September 2026.

What does alwaysAllow actually do?

It is a per-tool list of calls Roo can make without stopping to ask. The useful split is by cost: auto-approve the free lookups and the single-credit conversions, keep approval on for anything that calls an image model.

Can I commit the project config?

Yes, as long as the key is not in it. Reference an environment variable in the headers object rather than pasting the key, and .roo/mcp.json is safe to check in.

Does this work in Kilo Code too?

The config shape is nearly identical — Kilo Code is a fork and uses the same streamable-http type — but the file lives elsewhere. See the Kilo Code page for its own paths.