SVGR
A MCP server that exposes SVGR functionality to convert SVG content into React components
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 withReact.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
}
}
}
Prompts
svg_to_react_native
A convenience prompt that converts SVG to a React Native component with recommended settings.
Title: SVG to React Native Component
Description: Convert SVG to React Native component with TypeScript and named export
Arguments:
| Parameter | Type | Description |
|---|---|---|
svg | string | Required. SVG content or file path to SVG |
Preset Options:
This prompt automatically applies the following options:
native: true- Generates React Native compatible componentstypescript: true- Outputs TypeScript codejsxRuntime: automatic- Uses the automatic JSX runtimeexportType: named- Uses named exports
Usage:
This prompt guides the assistant to use the convert_svg_to_react tool with React Native-specific configurations, making it easier to generate mobile-ready components without manually specifying all options.
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP Front
An OAuth 2.1 proxy for MCP servers that enables single sign-on with Google, domain validation, and per-user tokens.
Script Generator Server
A simple note storage system with tools for adding notes and generating scripts from them.
kemdiCode MCP
kemdiCode MCP is a Model Context Protocol server that gives AI agents and IDE assistants access to 124 specialized tools for code analysis, generation, git operations, file management, AST-aware editing, project memory, cognition & self-improvement, multi-board kanban, and multi-agent coordination.
Ilograph MCP Server
Create and validate Ilograph diagrams with access to documentation and guidance.
CoinAPI MCP Server
Access real-time and historical crypto market data from CoinAPI’s MCP server, built for developers and AI agents needing reliable, unified market coverage.
Repo Map
An MCP server (and command-line tool) to provide a dynamic map of chat-related files from the repository with their function prototypes and related files in order of relevance. Based on the "Repo Map" functionality in Aider.chat
MetaMCP
A self-hostable middleware to manage all your MCPs through a GUI and a local proxy, supporting multiple clients and workspaces.
MCP Tree-sitter Server
A server for code analysis using Tree-sitter, with context management capabilities.
Sentry
Interact with the Sentry API to monitor application errors and performance.
Pulsar Edit MCP Server
An experimental MCP server to control the Pulsar editor, enabling LLM assistance for software development.