A Model Control Protocol (MCP) server that converts SVG images into various favicon formats (ICO and PNG) for web applications.
github.com/mark3labs/mcp-go v0.13.0
github.com/sergeymakinen/go-ico
github.com/tdewolff/canvas
git clone https://github.com/elliotxx/favicon-mcp-server.git
cd favicon-mcp-server
go mod download
go run main.go
svg_data
: SVG icon content provided as a string.output_formats
: Array of strings specifying the desired output formats (ico
, png
). Default: ["ico", "png"]
.The server returns base64 encoded favicon data in the requested formats:
{
"content": [
{
"type": "text",
"text": "Successfully generated favicons"
}
],
"meta": {
"ico": "base64_encoded_ico_data",
"png": "base64_encoded_png_data"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "svg_to_favicon",
"arguments": {
"svg_data": "<svg width=\"32\" height=\"32\"><rect width=\"32\" height=\"32\" fill=\"red\"/></svg>"
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "svg_to_favicon",
"arguments": {
"svg_file": "path/to/your/icon.svg"
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "svg_to_favicon",
"arguments": {
"svg_data": "<svg width=\"32\" height=\"32\"><rect width=\"32\" height=\"32\" fill=\"red\"/></svg>",
"output_dir": "path/to/output/directory",
"output_formats": ["ico", "png"]
}
}
}
When using file output:
- ICO file will be saved as favicon.ico
.
- PNG files will be saved as favicon-{size}x{size}.png
(e.g., favicon-32x32.png
).
The simplest way to test with direct SVG input:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"svg_to_favicon","arguments":{"svg_data":"<svg width=\"32\" height=\"32\"><rect width=\"32\" height=\"32\" fill=\"red\"/></svg>"}}}' | go run main.go
If you prefer using a test file:
test.json
with your test case.echo $(tr -d '\n' < test/test.json) | go run main.go
svg_data
: SVG content as a string.svg_file
: Path to an SVG file.output_dir
: Directory to save the output files.output_formats
: Array of desired formats (["ico", "png"]
).The project follows standard Go project layout and uses Go modules for dependency management.
favicon-mcp-server/
├── main.go # Main server implementation
├── go.mod # Go module definition
├── go.sum # Go module checksums
└── README.md # This file
go build
git checkout -b feature/amazing-feature
).git commit -m 'Add some amazing feature'
).git push origin feature/amazing-feature
).To integrate this MCP server with Windsurf, follow these steps:
~/.codeium/windsurf/mcp_config.json
file by clicking the hammer icon and selecting "Configure"."mcpServers": {
"favicon-mcp-server": {
"command": "go",
"args": ["run", "main.go"],
"cwd": "/path/to/favicon-mcp-server",
"env": {}
}
}
Replace /path/to/favicon-mcp-server
with the actual path to your project directory.
To integrate this MCP server with Cursor, follow these steps:
go run main.go
This project is licensed under the MIT License - see the LICENSE file for details.
A MCP server for converting input images into favicon.