SVGR MCP Server
Supports Preact JSX runtime for generating Preact-compatible components from SVG content.
Enables automatic formatting of generated React component code with configurable Prettier options.
Transforms SVG strings into React components with support for React Native, props forwarding, ref support, and React.memo wrapping.
Converts SVG content into React components with configurable options for TypeScript generation, optimization, and formatting.
Provides optional SVG optimization through SVGO integration before converting to React components.
Supports generation of TypeScript React components from SVG content.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SVGR MCP Serverconvert this SVG to a TypeScript React component named LogoIcon"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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"
}
}
}Related MCP server: MCP Figma to React Converter
API Reference
Tools
convert_svg_to_react
Converts an SVG string into a React component.
Input Schema:
Parameter | Type | Description | Default |
|
| Required. The raw SVG content to convert. | - |
|
| Name for the generated React component. |
|
|
| 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 |
|
| 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.
Available Tools
1 toolconvert_svg_to_reactB
Convert SVG content or file to React component using SVGR
| Name | Required | Description | Default |
|---|---|---|---|
| svg | Yes | SVG content as string or file path to SVG file | |
| componentName | No | Name for the React component (default: MyComponent) | |
| options | No | SVGR configuration options |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description bears full responsibility for disclosing behavioral traits. It only states the conversion action but omits critical details such as whether the output is a string or file, error handling for invalid SVG, or any side effects. The agent cannot anticipate the tool's behavior beyond the basic conversion.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence of 10 words. Every word is necessary and the key verb 'Convert' appears first. There is no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (3 parameters, a nested options object with 17 sub-properties), the description is too minimal. It does not explain what SVGR does, what the output looks like, or how the options affect the conversion. The agent lacks sufficient context to effectively use the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides descriptions for all parameters (100% coverage), so the baseline is 3. The description adds minimal additional meaning beyond the schema—e.g., 'SVG content as string or file path' is already in the schema. No extra semantic value is provided.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: converting SVG content or file to a React component using SVGR. It uses a specific verb ('Convert') and identifies the resource and target, leaving no ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives (though no siblings exist). There is no mention of prerequisites, context, or when not to use it, leaving the agent to infer from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Only one tool exists, so there is no possibility of confusion between tools. The tool's purpose is singular and well-defined.
The single tool name follows a clear verb_noun pattern (convert_svg_to_react) and is descriptive of its function.
With only one tool, the server feels minimally scoped. While the tool is not trivial, the server would benefit from additional tools (e.g., for configuration or batch processing) to better serve its domain.
The tool covers the core conversion task for both SVG content and files, but lacks options for customizing SVGR parameters or handling complex workflows. Minor gap in configurability.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate and vectorize clean, editable SVG graphics from text, images, or both.
320K+ open-source SVG icons: 12 tools, anonymous metadata search; SVG, exports, collections via Pro.
Multilingual semantic SVG icon search with previews for AI coding agents. 20,000+ icons.
Browse, create, edit, and export SVGator animated SVG projects via your SVGator account.
Related MCP Servers
- AlicenseCqualityDmaintenanceConverts Figma designs to React Native components, allowing users to extract components from Figma designs and generate corresponding React Native components with proper typing and styling.3318MIT
- AlicenseNot gradedqualityDmaintenanceConverts Figma designs into React components with TypeScript and Tailwind CSS by extracting components from Figma files and transforming them into ready-to-use code.77MIT
- FlicenseNot gradedqualityDmaintenanceEnables creation, validation, rendering, and optimization of SVG images with conversion capabilities to PNG, React components, React Native components, and Data URIs.
- AlicenseAqualityDmaintenanceConverts Figma designs into production-ready React components with design token extraction, widget registry integration, and micro-frontend module generation.3931MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pchalupa/svgr-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server