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
- Node.js 18+ (
node -v) - An SVGForge API token from Dashboard → API tokens (
sf_…)
Method 1: Project-level config (recommended)
Create or edit .cursor/mcp.json at the root of your project:
{
"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
- Open Cursor Settings (
Ctrl+,/Cmd+,). - Go to Features → MCP (or Customize → MCPs, depending on your Cursor version).
- Add a server:
- Name:
svgforge - Type: command
- Command:
npx -y svgforge-mcp
- Name:
- Set env
SVGForge_API_KEYto your token (and optionallySVGForge_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-mcponce 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