Favicon 图标 MCP 服务器是一款用 Go 语言编写的实用工具,它能将 SVG 图像轻松转换为.ico 和.png 格式的 favicon 文件。该项目遵循标准的 Go 项目布局,借助 Go 模块进行依赖管理,为开发者提供了便捷、高效的使用体验。
Favicon 图标 MCP 服务器使用起来十分简单。首先要确保你已经安装了 Go 语言环境和 Git,然后按照以下步骤操作,就能快速开启使用之旅。
在开始使用前,你需要进行一些必要的安装操作。请确保已经安装了 Go 语言环境和 Git,然后执行以下命令:
go mod init your_project_module
go mod tidy
go run main.go
{
"command": "convert",
"input": {
"svg_content": ""
}
}
{
"command": "file_convert",
"input": {
"file_path": "/path/to/image.svg"
}
}
{
"output": {
"icon_base64": "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiD... ",
"format": ".ico,.png"
}
}
# 转换 SVG 文件为 PNG 格式
go run main.go convert --input input.svg --output output.png
# 启动服务器进行交互式测试
go run main.go server
favicon-mcp-server/
├── main.go # 主服务实现文件
├── go.mod # Go 模块定义文件
└── README.md # 项目说明文档
go build
如果你想为这个项目贡献代码,可以按照以下步骤进行:
git clone https://github.com/yourusername/favicon-mcp-server.git
git checkout -b feature/amazing-feature
git commit -m '添加出色的功能'
git push origin feature/amazing-feature
~/.codeium/windsurf/mcp_config.json
:"mcpServers": {
"favicon-mcp-server": {
"command": "go",
"args": ["run", "main.go"],
"cwd": "/path/to/favicon-mcp-server"
}
}
go run main.go
本项目采用 MIT 许可证,具体内容请参阅LICENSE
文件。