@icogene/mcp
](https://www.npmjs.com/package/@icogenie/mcp) ](https://www.npmjs.com/package/@icogenie/mcp)  
IcoGenie的MCP(模型上下文协议)服务器。使像Claude这样的AI代理能够以编程方式生成生产就绪的SVG图标。
安装
npm install -g @icogenie/mcp
# or use directly with npx
npx @icogenie/mcp配置
克劳德桌面版
添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"icogenie": {
"command": "npx",
"args": ["-y", "@icogenie/mcp"]
}
}
}克劳德代码
全局安装或通过npx安装时,服务器会自动工作。
认证
首次使用时,MCP服务器将:
- 打开浏览器进行身份验证
- 请求您批准访问
- 将会话令牌保存到
~/.icogenie/config.json
后续使用是自动的-令牌与 IcoGenie命令行界面.
CI/CD环境
集 ICOGENIE_SESSION_TOKEN 跳过浏览器身份验证的环境变量:
export ICOGENIE_SESSION_TOKEN="your-session-token"可用工具
generate_icon
从文本描述生成单个图标预览。
成本: 1学分
generate_icon({
prompt: "home icon",
style: "solid", // or "outline"
variations: 1, // 1, 2, or 4
referenceImagePath: "/path/to/reference.png" // optional
})退货: { sessionId, preview, previews, creditsRemaining, sessionData, suggestions }
再生图标
重新生成特定的图标变体。返回4个候选预览--使用 confirm_regeneration 以最终确定您的选择(两相流)。
成本: 1学分
regenerate_icon({
sessionId: "abc123", // for single icons
bundleId: "xyz789", // for bundles (use one or the other)
index: 0, // which variation (0-based)
prompt: "Make it more 3D" // optional refinement
})退货: { candidates, regenToken, creditsRemaining }
confirm_regeneration
通过从4个候选者中选择一个来完成再生。
成本: 免费(包含在regenerate_icon中)
confirm_regeneration({
regenToken: "tok_abc123",
selectedIndex: 2 // 0-3, which candidate to keep
})退货: { success, preview, creditsRemaining }
检查信用
检查您当前的信用余额。
成本: 自由
check_credits()退货: { credits, team, user }
download_icon
下载图标或捆绑包的最终SVG+PNG包。
成本: 5学分(单)或4学分/图标(捆绑)
download_icon({
generationId: "abc123", // or bundleId
outputPath: "./icons.zip" // optional, returns base64 if omitted
})normalize_bundle
通过根据描述生成AI增强的图标列表来规划图标包。
成本: 免费(价格有限)
normalize_bundle({
description: "food delivery app",
targetCount: 10,
style: "solid"
})退货: { bundleId, icons, bundleType, styleRecommendation, reasoning }
generate_bundle
从图标列表生成一组图标。
成本: 每个图标1个积分
generate_bundle({
icons: [
{ name: "home", description: "Home navigation icon" },
{ name: "cart", description: "Shopping cart icon" }
],
style: "solid",
bundleId: "bundle_abc123" // optional, from normalize_bundle
})退货: { bundleId, iconCount, icons: [{ name, description, preview }], pricing, creditsUsed, creditsRemaining }
save_to_库
将生成的图标保存到您的个人库中。
成本: 自由
save_to_library({
generationId: "abc123",
name: "notification-bell", // optional display name
tags: ["ui", "alerts"] // optional tags
})退货: { success, libraryItemId }
list_library
列出保存在库中的图标。
成本: 自由
list_library({
page: 1, // optional, default 1
limit: 20, // optional, default 20
tag: "ui" // optional filter
})退货: { items: [{ id, name, tags, preview, createdAt }], total, page }
download_from_library
从您的库中下载一个图标,格式为SVG+PNG。
成本: 自由
download_from_library({
libraryItemId: "lib_abc123",
outputPath: "./bell-icon.zip" // optional, returns base64 if omitted
})退货: { savedTo } 或 { base64, filename }
索赔_日常信贷
申请2个免费积分,每24小时一次。
成本: 自由
claim_daily_credits()退货: { credited, creditsRemaining, nextClaimAt }
工作流示例
- 检查学分:
check_credits()
→ { credits: 50, team: { name: "Personal" } }- 生成单个图标:
generate_icon({ prompt: "notification bell icon", style: "outline" })
→ { sessionId: "abc123", preview: "...", creditsRemaining: 49 }- 必要时进行优化(两阶段):
regenerate_icon({ sessionId: "abc123", index: 0, prompt: "Add a dot indicator" })
→ { candidates: ["...", "...", "...", "..."], regenToken: "tok_xyz", creditsRemaining: 48 }
confirm_regeneration({ regenToken: "tok_xyz", selectedIndex: 1 })
→ { success: true, preview: "...", creditsRemaining: 48 }- 下载最终包:
download_icon({ generationId: "abc123", outputPath: "./bell-icon.zip" })
→ { savedTo: "./bell-icon.zip" }捆绑工作流
- 计划捆绑包(免费):
normalize_bundle({ description: "e-commerce app icons", targetCount: 8 })
→ { icons: [{ name: "cart", ... }, ...], styleRecommendation: "outline" }- 审查和生成(通过bundleId进行可追溯性):
generate_bundle({ icons: [...], style: "outline", bundleId: "bundle_abc" })
→ { bundleId: "bundle_abc", icons: [...], credits: { previewUsed: 8 } }- 下载捆绑包:
download_icon({ bundleId: "xyz789", outputPath: "./ecommerce-icons.zip" })环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
ICOGENIE_API_URL | API终点 | https://www.icogenie.xyz |
ICOGENIE_SESSION_TOKEN | 会话令牌(用于CI/CD) | - |
ICOGENIE_CONFIG_DIR | 配置目录 | ~/.icogenie |
信贷定价
| 行动 | 成本 |
|---|---|
| 预览(单曲) | 1学分 |
| 预览(捆绑) | 1学分/图标 |
| 下载(单曲) | 5学分 |
| 下载(捆绑包) | 4学分/图标 |
| 重新生成 | 1学分 |
| 每日索赔 | 2个免费积分/天 |
| 图书馆运营 | 免费 |
购买积分 www.icogenie.xyz.
何时使用MCP、CLI和Web
| 用例 | 最佳选择 |
|---|---|
| 在Claude/Cursor中生成图标 | 主控程序 |
| 在CI/CD管道中实现自动化 | 命令行界面 |
| 快速一次性发电 | 网络 |
| 批量生成图标包 | 命令行界面 或 主控程序 |
| 浏览和管理图标库 | 网络 |
相关
- @icogene/cli -命令行界面
- IcoGenie网站 -Web应用程序
- AI代理文档 -机器可读文档
- 开发人员文档 -集成指南
许可证
麻省理工学院
