Docs menu — MCP Server / Cursor Setup Documentation

Getting Started

MCP Server

REST API

MCP Server Updated 2026-11-23

Cursor Setup

Cursor is an AI-first editor with built-in Model Context Protocol support. Connecting SVGForge lets Composer and Agent mode search icons and insert SVG or framework components.

Prerequisites

Method 1: Project-level config (recommended)

Create or edit .cursor/mcp.json at the root of your project:

JSON
{
  "mcpServers": {
    "svgforge": {
      "command": "npx",
      "args": ["-y", "svgforge-mcp"],
      "env": {
        "SVGForge_API_KEY": "sf_xxx",
        "SVGForge_API_BASE": "https://svgforge.dev"
      }
    }
  }
}

Tip: Prefer environment-variable substitution or keep secrets out of git. Do not commit a live sf_… token.

Method 2: Global MCP in Cursor Settings

  1. Open Cursor Settings (Ctrl+, / Cmd+,).
  2. Go to Features → MCP (or Customize → MCPs, depending on your Cursor version).
  3. Add a server:
    • Name: svgforge
    • Type: command
    • Command: npx -y svgforge-mcp
  4. Set env SVGForge_API_KEY to your token (and optionally SVGForge_API_BASE).

Verify connection

In the MCP servers list you should see a healthy indicator for svgforge. Open the server to confirm tools such as search_icons, get_icon, list_icon_sets, sanitize_svg, and svg_to_data_uri.

If the status is yellow/red, confirm Node 18+ is on your PATH and that npx can reach the registry.

Example prompts

React component

Find a Lucide shopping-cart icon via SVGForge and export it as accessible React JSX.

Match a pack

Search SVGForge for navigation icons (home, users, settings) from Heroicons or Lucide.

Sanitize SVG

Sanitize this untrusted SVG with SVGForge MCP before I commit it.

Data URI

Get the Lucide search icon as a URL-encoded Data URI for a CSS background.

Troubleshooting

401 Unauthorized

  • Token must start with sf_ and must not be revoked.
  • Env key name is SVGForge_API_KEY (case-sensitive).

Tool not found / server offline

  • Restart Cursor after editing MCP config.
  • Run npx -y svgforge-mcp once in a terminal to warm the npm cache.

Collections empty / 403 on custom icons

  • Collections require a valid token.
  • Custom icons require a Pro plan.

See also: Tools Reference · Authentication