
Prompt To Asset
io.github.MohamedAbdallah-14由 GitHub 帳號 MohamedAbdallah-14 發布v0.4.2更新於 Oct 24, 2026
Generate app icons, favicons, OG images, and logos by routing across 30+ image models.
概覽
一個本機 MCP 伺服器,把簡短需求轉成應用程式圖示、favicon、OG 圖片、標誌和平台資源包,並在免費與付費影像模型間路由。
- 可以做什麼
- 對需求分類、改寫提示詞並路由到模型,附上選擇或排除模型的依據,並可列出可用模式與供應商或檢視模型登錄表(唯讀)。以行內 SVG、僅貼上或 API 三種模式產生標誌、應用程式圖示、favicon、OG 圖片、插畫、啟動畫面與主視覺圖。儲存助理撰寫的 SVG 或匯入外部產生的圖片,再去背、向量化與放大。驗證輸出的尺寸、透明度、安全區、調色盤偏移、對比度與字標拼字。把主圖離線展開為 iOS、Android、PWA、visionOS、Flutter 和 favicon 資源包,並產生精靈圖與九宮格設定。初始化品牌設定並偵測專案類型。
- 適用情境
- 當你需要圖示、favicon、標誌或社群圖片等可用於正式產品的軟體資源,並希望助理挑選合適模型並做後處理時適用。也適合希望優先使用免費額度路線,或想從一張主圖離線產生各平台資源的團隊。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行,需要 Node.js 20.11 或更新版本(建議 24);支援 macOS、Linux,Windows 需 WSL2 以修復原生相依套件。行內 SVG、僅貼上和零金鑰路線無需金鑰;選用的免費或付費供應商金鑰透過環境變數提供,部分原生相依套件可能需要安裝。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Prompt To Asset,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[prompt-to-asset demo — one prompt becomes a full favicon bundle in 20 seconds. Works with Claude Code, Cursor, Windsurf, VS Code. Zero API key required.]
prompt‑to‑asset
Free image generation for developers, from the CLI or your AI assistant.
Turn one brief into app icons, favicons, OG images, logos, splash screens, SVG, and platform bundles using the best zero-cost routes first.
Built for Cloudflare Workers AI, NVIDIA NIM, HF Inference, Stable Horde, Pollinations, free trials, and offline SVG.
[npm] [downloads] [CI] [license] [node] [MCP] [Glama score] [zero-key] [stars]
[Install in Cursor] [Install in VS Code] [Claude Desktop] [Smithery]
Quickstart · Free paths · Usage · Modes · Free APIs · MCP tools · Full guide · Changelog30-second start
Pick one. Run it. You're done. The recommended path is first.
Runtime: Node ≥ 20.11 (24 recommended). macOS, Linux, Windows (WSL2 for --fix native deps).
Free paths at a glance
You don't need a paid API key. Ranked best-first:
Details + quotas: Free paths beyond Pollinations. Run p2a doctor or ask your assistant for asset_doctor() to see what's live right now.
[!TIP] Stuck? Click Install in Cursor or Install in VS Code above, restart the editor, and say: "make a favicon for my app, dark-mode aware."
Highlights
- Free CLI-first generation —
p2a doctor,p2a pick, and the MCP tools rank free API routes before paid models, so developers can generate inside the CLI without enabling billing. - Three execution modes —
inline_svg(host LLM authors SVG),external_prompt_only(paste into any web UI),api(server calls a free or paid provider). Pick what fits. All three can finish on $0. - 60+ models, free-first routing — Cloudflare Workers AI, NVIDIA NIM, HF, Horde, Pollinations, free trials, plus optional paid OpenAI / Ideogram / Recraft / BFL / Gemini. Each rule cites a research source.
- Refuses to do the wrong thing — the
Nevercolumn. No wordmarks past 3 words through a diffusion sampler. No transparent PNG through Imagen. Nonegative_prompton Flux. - Offline platform fan-out — one 1024² master → iOS AppIconSet, Android adaptive + monochrome, PWA 192/512/512-maskable, favicon bundle, visionOS parallax, Flutter launcher. Zero network.
- Validates before shipping — tier-0 checks on every output: dims, alpha presence, checkerboard FFT, safe-zone bbox, ΔE2000 palette drift, WCAG contrast, OCR Levenshtein on wordmarks.
- Sprite sheets + 9-slice — pack PNG frames into TexturePacker-compatible atlases (Phaser, PixiJS, Godot, Unity); emit 9-slice numbers + CSS
border-image+ Android.9.png.
Table of contents
Click to expand
- 30-second start
- Usage — what to say to your assistant
- The three modes — inline_svg · external_prompt_only · api
- The router — which model for which job, and what never
- Free paths beyond Pollinations
- Install
- Models covered — 60+
- MCP tools — 25 tools
- CLI surface
- Brand bundle (
brand.json) - Platform support
- Architecture
- Comparison
- Security
- Research-backed decisions
- Development
- Community · License
Usage
You just talk to your assistant. Example from a new chat:
Make me a transparent logo for a developer-tools company called Forge. Flat vector, two-tone warm orange on neutral.
Behind the scenes:
asset_doctor()— check what modes and providers are live.asset_init_brand({ app_name: "Forge", palette: ["#EA580C", "#F5F5F4"] })if nobrand.jsonexists.asset_enhance_prompt({ brief })returns anAssetSpec: classification, rewritten prompt,modes_available[], optionalsvg_brief, optionalpaste_targets, and arouting_tracepointing at the research file that backed the decision (plusnever_models— why Imagen or DALL·E got rejected).- Assistant offers you
inline_svg/external_prompt_only/api. - If
inline_svg: it writes<svg>inline and callsasset_save_inline_svg→ writesmaster.svg,favicon.ico, apple-touch, AppIconSet, PWA bundle to disk. - If
external_prompt_only: assistant shows the refined prompt and the best paste target (free first). You generate, save, then say "ingest this file" →asset_ingest_external. - If
api: assistant calls the routed provider. Server mattes, vectorizes, exports, validates. - Follow-up: "also fan this out for iOS and Android" →
asset_export_bundlewith the saved master.
Zero CLI typing. The CLI is still first-class for CI, shell scripts, and non-MCP environments — both surfaces hit the same core.
Why this exists
Two facts shape everything here.
Producing production-grade software assets is a routing and post-processing problem, not a prompt-engineering problem.
Imagen 3/4 and Gemini Flash Image can't produce real RGBA PNGs — their VAE is RGB-only, so asking for a transparent background renders the grey-and-white checkerboard as pixels. SDXL can't spell past ~8 characters. Only Recraft emits native SVG. Flux errors on negative_prompt. None of that is visible in the model UI. All of it silently breaks one-shot "prompt → asset" tools.
You may not have an image-model API key. The plugin works anyway.
Every one of the three modes can finish on $0.
The three modes
The host LLM picks the mode, or you do. The server surfaces modes_available so the assistant offers them to you. Free paths first — always.
The router
Router decisions live in data/routing-table.json. Capability matrix in data/model-registry.json. Every rule cites its research source.
The Never column matters. It's why prompt-to-asset refuses to render wordmarks past 3 words in any diffusion sampler, and why asking for a transparent PNG never goes to Imagen.
Free paths beyond Pollinations
Google Gemini / Imagen — verified pricing (Apr 2026)
Verified 2026-04-26 against public Gemini API pricing:
- Imagen 4 image output is paid API. The pricing table lists Free Tier as "Not available" and prices Fast / Standard / Ultra at $0.02 / $0.04 / $0.06 per image.
- Nano Banana family is paid API.
gemini-3.1-flash-image-preview(Nano Banana 2),gemini-3-pro-image-preview(Nano Banana Pro), andgemini-2.5-flash-image(original Nano Banana) list image output only in the paid tier. Billing must be enabled on the GCP project to use these via API. - Free for text, multimodal understanding, and embeddings. The Gemini text-out models still have
Free of chargeinput + output on the free tier. - Free interactive image generation is also via the AI Studio web UI at aistudio.google.com. Community-observed limit 500–1,000 images/day, dynamic. Use
external_prompt_only+asset_ingest_externalif you want Nano Banana quality without billing. - Free image generation via the Gemini consumer app at gemini.google.com: Basic 20/day, AI Plus 50/day, AI Pro 100/day, Ultra 1,000/day.
- Paid API pricing (per image, standard): Nano Banana (
gemini-2.5-flash-image) $0.039; Nano Banana 2 Flash (gemini-3.1-flash-image-preview) $0.045/0.5K, $0.067/1K, $0.101/2K, $0.151/4K; Nano Banana Pro (gemini-3-pro-image-preview) $0.134/1K-2K, $0.24/4K (+ $0.0011 per input image); Imagen 4 Fast $0.02, Standard $0.04, Ultra $0.06. Batch API is 50% off.
Run
p2a doctor(or ask your assistant forasset_doctor()) to see what's live in your environment right now.
Install
Every command works via npx — no install required.
Register with your AI assistant
Once registered, your assistant has the full 24 asset_* tool surface.
Models covered
Paid direct APIs: gpt-image-1, gpt-image-1.5, dall-e-3 (deprecated 2026-05-12), imagen-3, imagen-4, gemini-3-flash-image (Nano Banana), gemini-3-pro-image, sd-1.5, sdxl, sd3-large, playground-v3, flux-schnell, flux-dev, flux-pro, flux-2, flux-kontext-pro, ideogram-3, ideogram-3-turbo, recraft-v3, leonardo-phoenix, leonardo-diffusion-xl, fal-flux-pro, fal-flux-2, fal-sdxl.
Free-tier / zero-key: pollinations-flux, pollinations-turbo, pollinations-kontext, pollinations-sd, horde-sdxl, horde-flux, hf-sdxl, hf-sd3, hf-flux-schnell, hf-flux-dev.
Paste-only surfaces: midjourney-v6, midjourney-v7, firefly-3, krea-image-1. Calling asset_generate_* with mode: "api" against a paste-only primary soft-falls-back to the first API-reachable model in the chain and surfaces a warning. If the whole chain is paste-only, you get an ExternalPromptPlan rather than an error.
🛠 MCP tool surface (25 tools)
Tools are annotated readOnlyHint / idempotentHint so Cursor auto-approves without prompting.
⌨️ CLI surface
Used by the LLM over Bash when MCP isn't registered yet, and by CI. Every read-only command accepts --json.
🎨 Brand bundle — brand.json
p2a init writes this for you, detecting the framework and suggesting an assets directory. Once present, every generator reads from it automatically.
📱 Platform support
🏗 Architecture
Content-addressed storage: assets/<hash[0:2]>/<hash>/<variant>.<ext>. The MCP server is synchronous and stateless. prompt_hash and params_hash in every AssetBundle are designed to drop straight into a BullMQ / SQS / Cloudflare Queues jobId for a hosted pipeline. Reference design: docs/research/18-asset-pipeline-tools/18e-production-pipeline-architecture.md.
Design thesis
You own the API keys. The LLM owns everything else.
The only thing that happens in a terminal is installing the package and putting keys in .env. Secrets shouldn't pass through chat. Every other verb — doctor checks, model inspection, platform fan-out, brand scaffolding, sprite sheets, 9-slice configs — is an MCP tool the assistant calls when you ask in natural language.
Comparison
Security
This tool handles API keys for up to 15 providers. Non-negotiables:
- Keys live in env vars only. Never written to disk, never logged, never echoed in MCP responses. Provider error bodies go through
redact()(packages/mcp-server/src/security/redact.ts) before reaching the host LLM. - Path access is allow-listed.
image_path/output_dir/existing_mark_svgresolve through symlinks and reject anything escaping project cwd + configured output dir + cache dir + OS tempdir. Widen withP2A_ALLOWED_PATHS=/path1:/path2. - SVG is XSS-sanitized before any write.
<script>,<foreignObject>,on*=handlers,javascript:URIs, external<image href>/<use href>, CSS@importover the network — all rejected. The check runs unconditionally; SVGO is not required. - Cost guardrail. Set
P2A_MAX_SPEND_USD_PER_RUN=5.00to cap any single tool call. Pre-flight estimate refuses to call if over. Free-tier routes are always $0. - Data integrity at boot.
assertDataIntegrityAtBoot()runs on start. If a routing rule points at a model id not in the registry, the server refuses to boot with a clear error. Check in CI withp2a doctor --data. - No telemetry. No remote calls unless the routed provider explicitly requires one.
Full policy: SECURITY.md.
Research-backed decisions
Every routing rule, dialect switch, safe-zone size, and text ceiling that's implemented is backed by a file under docs/research/. asset_enhance_prompt returns a routing_trace.research_sources array on every call. The angle → code pointer map, plus an honest ledger of what's wired and what's deferred, lives in docs/RESEARCH_MAP.md.
Development
SSOTs live in skills/*/SKILL.md, rules/*.md, .claude-plugin/, and data/*.json. Don't edit .cursor/, .claude/, .windsurf/ directly — they're regenerated by scripts/sync-mirrors.sh and CI byte-verifies them.
- Contribution flow: CONTRIBUTING.md
- User on-ramp: GETTING_STARTED.md
- Common snags: TROUBLESHOOTING.md
- Release notes: CHANGELOG.md
Community
- Issues + feature requests: GitHub Issues
- Security disclosures: SECURITY.md
- Code of Conduct: CODE_OF_CONDUCT.md
- Star history:
If this repo saved you from hand-crafting another AppIconSet, a star helps it reach other developers fighting the same fight.
Read more
The thinking behind the design, in long-form:
- Why I stopped picking image models and built a router instead — the case for routing across 30+ image models.
- MCP server architecture: what's inside prompt-to-asset — architecture deep-dive.
Cross-posted on Medium and dev.to.
License
MIT © prompt-to-asset contributors.
來源:README.md,提交 1e66880
工具
0版本歷史
1- v0.4.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分