
Nakkas
io.github.arikusi由 GitHub 帳號 arikusi 發布v0.5.0更新於 Oct 24, 2026
MCP server that turns AI into an SVG artist. One rendering engine, AI decides everything.
概覽
本機 MCP 伺服器,讓助理用 JSON 設定產生動畫 SVG 圖形,並透過 PNG 預覽反覆修改。
- 可以做什麼
- 把宣告式 JSON 設定算繪成動畫 SVG,回傳 PNG 預覽、產物 id 與設計警告
- 將已存產物或原始 SVG 以任意寬度重新算繪為 PNG,可用多格膠捲圖檢查動畫
- 把產物或原始內容存到磁碟為 SVG 文字或 PNG 點陣圖,遇到同名檔案自動加序號而不覆寫
- 用形狀、文字、群組、圖樣群組與參數曲線建立設計,支援漸層、濾鏡、裁剪路徑與標記
- 用 CSS keyframes 或 SMIL 做動畫,並取得溢出、重疊、低對比文字等版面與對比度警告
- 適用情境
- 適合需要產生標誌、圖示、載入動畫、徽章、README 橫幅或生成藝術等自帶動畫的 SVG,尤其是 JavaScript 會被移除的 GitHub README。先預覽再修改的循環也適合反覆調整的視覺設計。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行,通常以 npx 啟動;需要 Node.js 18 以上版本。不需要 API 金鑰、帳號或雲端服務。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Nakkas,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
MCP server that turns AI into an SVG artist.
One rendering engine. AI decides everything.
[npm version] [downloads] [license] [Marketplace]
Officially listed on the MCP Registry, Glama, LobeHub, and PulseMCP.
[Official MCP Registry] [LobeHub] [Ask DeepWiki]
[Orbital system: rings of dots rotating at different speeds around a breathing sun, with a comet trailing its tail] [Lissajous curve drawing itself stroke by stroke over a dot grid]
Both drawn by an AI through nakkas, one JSON config each, iterated against its own PNG previews. Pure CSS animation, no JavaScript.
Nakkas is an MCP (Model Context Protocol) server that lets AI assistants like Claude create animated SVG graphics from a declarative JSON config: logos, icons, loading spinners, GitHub README banners, badges, and generative art. It renders CSS @keyframes and SMIL animations with no JavaScript, so the output works inside GitHub READMEs and anywhere an <img> tag renders SVG. Every render comes back as a PNG preview plus a server-side artifact id, so the AI sees its own work immediately and iterates without the SVG text ever passing through its context window.
nakkaş means painter/artist in Turkish (old).
Why
- One tool, infinite designs.
render_svgtakes a JSON config. AI fills in everything. - The AI sees its own work. Every render returns a PNG preview, so the model critiques and revises instead of designing blind.
- Token-cheap iteration. The SVG stays on the server as an artifact; preview and save address it by id, so revision loops don't pay for the SVG text.
- Pure declarative SVG. CSS @keyframes + SMIL animations, no JavaScript. Survives GitHub's camo proxy.
- Zero external deps. No cloud API, no API keys. Runs locally.
Install
Claude Desktop
Add to your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Claude Code (CLI)
Cursor / Zed / Other MCP clients
Local Development
Quick Start
Ask your AI (with Nakkas connected):
"Make an animated SVG: dark terminal frame (800×200), glowing cyan text 'NAKKAS', neon glow filter, fade-in on load."
"Create a loading spinner: a circle with a draw-on stroke animation that loops every 1.5 seconds."
"Data visualization: animated bar chart, 5 bars, each fading in with a staggered delay, gradient fills."
"Profile badge (400×120): blue-to-purple gradient, white username text, drop shadow, subtle pulse animation."
Tools
Nakkas provides three tools:
The intended workflow: render → look at the returned preview → revise the config → render again → save. The rendered SVG stays on the server as an artifact: render_svg answers with the preview image and an id like art-1, and preview/save accept that id directly. The SVG text never has to travel back through the model's context window, which cuts the token cost of an iteration loop to a fraction of pasting SVG around. Artifacts live for the server process lifetime (capped at 32, oldest evicted).
The save Tool
Pass either artifact (id from render_svg, preferred) or content (raw string). Formats: auto (infers from extension), svg (text file), png (renders to raster first). If the file exists, a numeric counter is appended to prevent overwriting. The actual saved path is returned.
The render_svg Tool
Input: SVGConfig JSON object
Output: PNG preview image + a summary naming the artifact id, plus optional design analysis notes
The response shape is controlled by an optional output block in the config:
svg: trueincludes the full SVG text in the response (off by default; the artifact id covers preview and save)preview: falseskips the PNG imagepreviewWidthscales the previewminify: truecollapses whitespace in the stored and saved SVGframes: N(2 to 10) replaces the static preview with one filmstrip image sampling the CSS animations at N points in time — the way to verify motion, since a single preview only shows the starting state
With frames, nakkas evaluates the @keyframes math itself (duration, delay, iteration count, direction, fill mode, easing per segment) and bakes each sampled state into a static frame. Transform origins declared as transform-box: fill-box are resolved numerically from the element's geometry. SMIL animations are not sampled.
After rendering, the response may include design warnings about common issues such as too many concurrent animations, missing transformBox, group-level scale transforms, content extending past the viewport (measured from the real rendered bounding box, with the overflow in pixels), or low-contrast text against the canvas background (WCAG ratios). Text gets its own layout audit: every text element's ink bounding box is measured through an isolated render, so text escaping the viewport is named with its exact overflow, and two texts printed over each other come back as an overlap warning naming both.
SVGConfig Structure
Element Types
Two field names differ from raw SVG on purpose: the string of a text element goes in content (on textPath it is text), and validation errors will point you to the exact field if you mix them up. Pattern groups rotate each copy to face outward by default; set rotateChildren: false when the child is text or any shape that should stay upright.
All Visual Elements (Shared Fields)
Filter Presets
Reference as filter: "url(#myId)" on any element after defining in defs.filters:
CSS Animations
CSS property keys: camelCase (strokeDashoffset) or kebab-case (stroke-dashoffset). Both work.
Animatable CSS properties: opacity, fill, stroke, transform, filter, clip-path, stroke-dasharray, stroke-dashoffset, font-size, letter-spacing and more.
SMIL Animations
Three SMIL types, defined inline on each element via smilAnimations: []:
Path morphing (attributeName: "d"): from/to paths must have identical command types and counts. Only coordinates can differ.
Fonts
Prefer the CSS generic families: sans-serif, serif, monospace. They resolve to a real font on every platform, both in browsers and in nakkas previews. Named fonts like Arial or Helvetica only exist on some systems (not on most Linux machines), so a design that depends on them will render differently elsewhere. The safe pattern is a named font with a generic fallback: "Georgia, serif".
In preview and PNG save, generic families are resolved through the operating system's own font mapping (fontconfig on Linux), so what the AI sees matches what a browser on that machine would show. Custom font families are accepted and work when the font is available in the rendering environment.
Use Cases & Compatibility
Troubleshooting
"MCP error -32602: Input validation error"
This means the MCP SDK rejected the input before it reached the handler. It usually happens on the first attempt and works on retry. The most common triggers:
- Gradient type typo. Use
"linearGradient"or"radialGradient", not"linear"or"radial". This is the single most frequent mistake. - Keyframe offset as string. Write
0or100(numbers) or"from"/"to". Writing"0%"or"100%"will fail. - Colors in gradients and filters. Gradient stop and filter colors must be hex:
"#ff0000", not"red"orrgb(). Elementfill/strokeaccept any paint string ("#ff0000","none","url(#id)"), with hex being the safest choice across renderers. - Missing
typeon elements. Every element object needs atypefield.
Validation errors that reach the handler name the exact failing field (for example elements.1.content: Required) and append a field reference for the failing element type, so a retry usually succeeds on the first correction. Numeric strings on number fields (letterSpacing: "6") are coerced automatically instead of failing.
The handler also checks reference integrity before rendering: a dangling url(#id) in fill/stroke/filter/clipPath/mask, a use.href pointing nowhere, a textPath.pathId missing from defs.paths, or a duplicate ID all come back as errors with the exact field path and the list of defined IDs, instead of rendering silently broken output.
If you're building an MCP client integration and seeing this consistently, the issue is likely in how your client serializes arguments. See anthropics/claude-code#29104 for context on known serialization quirks.
Preview shows a blank or unexpected image
A single preview renders a static snapshot at t=0, before any animation starts. To see the motion, render with output: { frames: 4 } (or up to 10): nakkas samples the CSS animations at N points in time and returns one labeled filmstrip image. SMIL animations are the exception; they are not sampled and always show their base state.
If the image is completely blank:
- Check that your elements have
fillorstrokeset. A shape without fill on a transparent canvas is invisible. - Check coordinates. An element at
x: 2000on an800pxwide canvas is simply off-screen. - If using
filter: "url(#myFilter)", make suremyFilteris actually defined indefs.filters.
Animations not working on GitHub
GitHub READMEs render SVG through <img> tags, which strips JavaScript but keeps CSS and SMIL. If your animation works locally but not on GitHub:
- Avoid
<script>or event handlers (onclick,onmouseover). These are removed. - External fonts won't load. Stick to generic families (
monospace,sans-serif,serif) or named fonts with a generic fallback. - CSS
@importfor fonts is blocked. If you need a specific font, use inline<text>with a system fallback.
Large SVG output
If render_svg returns a warning about file size (over 50kb), the parametric curves are probably sampling too many points; reduce steps. Pattern groups are cheap: the child is defined once and instanced with <use>, so a grid-group with cols: 50, rows: 50 costs one child definition plus 2500 one-line <use> tags. For the smallest possible file, add output: { minify: true }.
How It's Tested
Every release ships only after a dogfood run: a design produced through the real MCP stdio layer against the freshly built server, iterated render → preview → critique → revise until it holds up. The test design is tailored to the change under test, so the run proves the new feature works under realistic use, not just that nothing broke. The full log, with prompts, iteration counts and the resulting assets, lives in dogfooding.md.
This ritual catches real bugs. The v0.3.0 easing dogfood found that CSS axis shorthands like translateX were baked verbatim into the SVG transform attribute, where they are invalid and silently freeze the element; the fix shipped in the same release. The animation frame sampler behind output.frames is verified against a real browser: randomized animations (seeded, including random cubic-bezier curves) are frozen in headless Chromium via the negative animation-delay trick and must match nakkas's sampled positions within a pixel. That cross-check runs in CI as tests/browser-truth.test.ts; the original manual harness remains at scripts/easing-browser-truth.sh.
Alongside the dogfood runs there are 397 unit and integration tests, including MCP stdio end-to-end coverage.
Tech Stack
- TypeScript + Node.js 18+
@modelcontextprotocol/sdk(MCP server)zod(schema validation and AI type guidance)- No external SVG libraries, pure XML construction
- Vitest (397 tests)
License
MIT. Built by arikusi.
來源:README.md,提交 de074a4
工具
0版本歷史
1- v0.5.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分