# Trace images to SVG from an AI agent. pic2svg-mcp gives AI agents and scripts the same tracing engine as this website: an MCP server with one tool, trace_image_to_svg, a command-line tool, and the public trace API both of them call. It needs Node 20 or newer and no account. Text of . The page itself also carries the working image converter. > **How do you use pic2svg from an AI agent?** > > Add pic2svg-mcp to your MCP client as a local (stdio) server — the configuration is below — and ask the agent to trace an image file. The tool uploads the file to pic2svg's server, writes the SVG next to it and reports the trace mode, path count and size. Tracing is free within a daily allowance per client, and only SVG is produced; PDF, EPS, AI and DXF are downloads on the website's [plans](https://pic2svg.com/pricing/). ## How do you set it up? Three steps. Nothing to sign up for. 1. **Add the server to your MCP client:** Paste the configuration below into your client's MCP settings (for example its mcpServers file). Any client that can launch a local stdio server works; npx downloads the package on first use. 2. **Ask the agent to trace a file:** For example: "Trace ~/Desktop/logo.png to SVG with the compact preset." The agent calls trace_image_to_svg with the file's path, and optionally a preset, an output path, and whether to return the SVG text itself. 3. **Open the SVG:** By default the SVG is written beside the image as ``.pic2svg.svg, so an existing ``.svg is never overwritten. Check it in a browser or a vector editor before using it. ## Configuration and commands ### MCP client configuration ```json { "mcpServers": { "pic2svg": { "command": "npx", "args": ["-y", "pic2svg-mcp"] } } } ``` ### Command line ```sh npx -y pic2svg-mcp trace logo.png --preset compact --out logo.svg ``` Prints one line: the path count, trace mode, canvas, size and where the SVG was written. ### The API directly ```sh curl -s https://api.pic2svg.com/api/v1/trace \ -H 'content-type: application/json' \ -d "{\"fileName\":\"logo.png\",\"preset\":\"balanced\",\"imageBase64\":\"$(base64 < logo.png | tr -d '\n')\"}" ``` imageBase64 may be raw base64 or a data URL. The response is JSON: svgText, mode, canvas { w, h, paths } and sizeKB. ## What are the limits? The trace API has its own daily allowance, counted per UTC day and separate from the free converter on this website, so agents never use up what visitors share. The current figures are in every response's X-RateLimit-Limit and X-RateLimit-Remaining headers. | Limit | Value | When it is reached | | --- | --- | --- | | Traces per client per day | 50 by default | HTTP 429 with a message and a Retry-After header until midnight UTC; the tool returns the message | | Traces per day for all API callers together | 500 by default | HTTP 429, as above | | Request size | About 45 MB | HTTP 413; the file is not traced | | Trace resolution | About 600,000 pixels | Larger images are scaled down before tracing, never refused for size alone | ## What happens to your image? - **It is uploaded to pic2svg:** The file goes to pic2svg's own server (api.pic2svg.com), where the engine traces it. It is not sent to any third-party AI service or vectorizer. Temporary trace files are deleted when the trace finishes; the [Privacy Policy](https://pic2svg.com/privacy/) has the details. Tell your agent not to send files that must stay on your machine. - **It is sent as it is:** The website's converter scales an image in the browser and re-encodes it before uploading it, as a lossless PNG for flat artwork or a JPEG for photos; the MCP server and CLI send the file itself, so a photo can trace a little differently than it does on the website. - **What the trace does and does not do:** Transparency becomes a white background shape, lettering becomes outlined shapes, and only SVG is produced. The [guides](https://pic2svg.com/logo-to-vector/) on this site describe how traces behave in detail. ## MCP server and API questions ### Is it free? Yes, within the daily allowance: 50 traces per client by default, with no account. It produces SVG only; the other formats are downloads on the website's plans. ### Does it use up the website's free converter? No. The API keeps its own daily count, separate from the pool the website's anonymous visitors share. ### Which MCP clients does it work with? Any client that can start a local MCP server over stdio. The server answers initialize, tools/list and tools/call, and has no dependencies beyond Node 20. ### Can I get PDF, EPS, AI or DXF through the API? No. Those exports are part of the paid plans on the website, which work in the browser. The API returns the traced SVG.