SVG MCP server for Codex

One codex mcp add command gives OpenAI Codex the SVG.new tools: vectorize images to SVG, recolor, simplify, remove backgrounds and batch convert.

Free account includes 3 vectorizations a day.

Add SVG.new to Codex

Needs the Codex CLI and Node.js.

1

Create an API key

Sign in at svg.new/account and create a key. It starts with svk_ and is shown once.

2

Add the server

codex mcp add svg-new \
  --env SVG_NEW_API_KEY=svk_your_key_here \
  -- npx -y @svgnew/mcp

Then check it was saved:

codex mcp list
3

Ask Codex to vectorize

Start a new Codex session and ask, for example, “Vectorize assets/logo.png and save it as assets/logo.svg”.

Prefer editing config.toml?

codex mcp add writes this table to ~/.codex/config.toml. You can add it by hand instead:

[mcp_servers.svg-new]
command = "npx"
args = ["-y", "@svgnew/mcp"]
env = { SVG_NEW_API_KEY = "svk_your_key_here" }

What Codex can do with it

Vectorize images

PNG, JPG or WebP to SVG with the vectorize tool. 1 credit each.

Batch convert

Up to 10 images per batch with batch_vectorize, then poll with get_batch_status.

Recolor and simplify

recolor_svg swaps hex colors; simplify_svg cuts the palette to 1 to 256 colors. Both free.

Remove backgrounds

remove_background drops the background from an SVG using the original image. 1 credit.

Full tool reference on the MCP server page.

Example prompts

  • “Vectorize assets/logo.png and commit logo.svg next to it”
  • “Convert every PNG in public/icons to SVG”
  • “Reduce badge.svg to 3 colors”
  • “Vectorize mascot.jpg and remove the background”

Common questions

How do I add the SVG MCP server to Codex?

Run codex mcp add svg-new --env SVG_NEW_API_KEY=svk_your_key_here -- npx -y @svgnew/mcp. Codex saves the server to ~/.codex/config.toml and starts it in new sessions. Run codex mcp list to confirm it is there.

Can OpenAI Codex vectorize an image?

Yes, with the SVG.new MCP server added. Ask OpenAI Codex to vectorize an image in your repo and it calls the vectorize tool, which sends the PNG, JPG or WebP to SVG.new and returns SVG markup for Codex to save.

Where does Codex keep MCP settings?

In ~/.codex/config.toml, under an [mcp_servers.svg-new] table. You can edit that file directly instead of running codex mcp add.

What does it cost?

The MCP server is free to install. Vectorizing uses SVG.new credits: a free account includes 3 vectorizations a day, and Pro is $9.99 a month for 1,000. Recolor and simplify are free; vectorize and background removal cost 1 credit.

The server will not start. What should I check?

Make sure Node.js is installed so npx can run, and that the key was passed with --env. The server exits on start when SVG_NEW_API_KEY is missing. Keep source images under roughly 3 MB, since requests are capped at about 4.5 MB of base64.