npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

svgr-mcp

v1.2.4

Published

MCP server for converting SVG to React components using SVGR

Readme

SVGR MCP Server

A Model Context Protocol (MCP) server that exposes SVGR functionality to convert SVG content into React components.

Features

  • SVG to React Conversion: Transforms raw SVG strings into valid React components.
  • Configurable Output: Supports extensive SVGR configuration options including TypeScript generation, React Native support, and Prettier formatting.
  • Optimization: Optional SVGO integration for optimizing SVG content before conversion.
{
  "mcpServers": {
    "svgr": {
      "command": "npx",
      "args": ["svgr-mcp@latest"],
      "type": "stdio"
    }
  }
}

API Reference

Tools

convert_svg_to_react

Converts an SVG string into a React component.

Input Schema:

| Parameter | Type | Description | Default | | :-------------- | :------- | :-------------------------------------------- | :-------------- | | svg | string | Required. The raw SVG content to convert. | - | | componentName | string | Name for the generated React component. | "MyComponent" | | options | object | Configuration options for SVGR. | {} |

Options Object:

The options parameter supports the following keys:

  • icon (boolean | string | number): Replace SVG width and height with a custom value.
  • native (boolean): Modify all SVG nodes for React Native.
  • typescript (boolean): Generate TypeScript component.
  • dimensions (boolean): Keep width and height attributes from the root SVG tag.
  • expandProps ("start" | "end" | boolean): Forward properties to the SVG tag.
  • prettier (boolean): Format output with Prettier.
  • prettierConfig (object): Specify custom Prettier configuration.
  • svgo (boolean): Use SVGO to optimize SVG code.
  • ref (boolean): Add ref support to the component.
  • memo (boolean): Wrap component with React.memo.
  • replaceAttrValues (object): Map of attribute values to replace.
  • svgProps (object): Add props to the root SVG tag.
  • titleProp (boolean): Add title prop support.
  • descProp (boolean): Add description prop support.
  • jsxRuntime ("classic" | "automatic" | "classic-preact"): Specify the JSX runtime to use.
  • exportType ("named" | "default"): Specify export type (named or default).

Return Value:

Returns a text content block containing the generated React component code.

Example Usage:

{
  "name": "convert_svg_to_react",
  "arguments": {
    "svg": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\"><circle cx=\"24\" cy=\"24\" r=\"20\"/></svg>",
    "componentName": "CircleIcon",
    "options": {
      "typescript": true,
      "icon": true
    }
  }
}