Favicon MCP 服务器
一个将输入图像转换为网站图标的MCP服务器。
快速入门
前置条件
- 安装 Go 1.20 或更高版本
- 确保安装了以下依赖:
- 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数据作为输入,或指定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"/>" } } }
- 输出支持ICO和PNG格式,默认返回Base64编码结果。
测试
推荐直接通过命令行测试: 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"/>"}}}' | go run main.go