Use Levni
MCP server
Connect Levni to your assistant and it can search the library, draw, read the critic and save files on its own. The server runs on your machine over stdio: no account, no key, no cost per image.
Set it up
You need Node.js 20 or newer. The client starts the server with npx the first time it needs it, so there is nothing to install by hand.
Claude Code
claude mcp add levni -- npx -y @levni/levni mcpClaude Desktop
Open Settings, Developer, Edit Config (the file is claude_desktop_config.json), add the server, then restart the app.
{
"mcpServers": {
"levni": {
"command": "npx",
"args": [
"-y",
"@levni/levni",
"mcp"
]
}
}
}Cursor
Put the same block in .cursor/mcp.json in your project, or in ~/.cursor/mcp.json for every project. Windsurf, Cline and other clients that run local stdio servers take the same mcpServers block in their own settings file.
Codex
codex mcp add levni -- npx -y @levni/levni mcpOr edit ~/.codex/config.toml yourself:
[mcp_servers.levni]
command = "npx"
args = ["-y", "@levni/levni", "mcp"]From a checkout
If you cloned the repository (or want the 0.3.0 posters before they reach npm), point the client at the file:
{
"mcpServers": {
"levni": {
"command": "node",
"args": [
"/path/to/levni/bin/levni.mjs",
"mcp"
]
}
}
}Files from render_scene, render_board and render_poster are written relative to the working directory of your client. Start the client inside the project where the images should land.
How an agent works with it
- Read the format once.
scene_guidereturns the scene reference. Most agents call it first and keep it in context. - Find drawings.
list_propswith a word, thenshow_propsto choose a variant by eye. Real names, no guessing. - Draw.
render_scenereturns critic notes and a preview.critique_sceneis the cheap check between attempts. - Fix and save. The agent moves what the critic flagged, then renders again with
outset. For brand work it starts withrender_boardorrender_posterinstead.
Tools
Seven tools, all running locally. Inputs marked required must be given; everything else is optional.
scene_guide
Returns the whole scene format as text: canvas, every element type and its fields, colours, style packs, formats, the critic and recipes. It is long, so the agent reads it once per session.
- Input
- None.
- Output
- The text of the scene reference.
list_props
Searches the Levni Folio by word, tag (English or Turkish), old name or variant note.
- Input
query: words such as "cat" or "film camera". Empty lists everything.category: one shelf, for example food or tech.limit: maximum results; default 40, up to 500.
- Output
- The number of matches, then each drawing with its name, variant count, shelf, tags and what every variant shows, and the line to paste into a scene.
show_props
Draws a contact sheet so the agent can choose a drawing by eye.
- Input
names: up to 12 drawing names from list_props (required).
- Output
- An image of up to 18 variants, each labelled "name number". Unknown names are reported, not fatal.
render_scene
Draws a scene.
- Input
scene: the scene JSON (required).out: a .png, .webp or .svg path, relative to the working directory of the client.preview: return a 560 px preview; default true. Set false for agents that cannot see images.
- Output
- The critic’s notes, the preview image, and with out the full-size file. The preview includes the scene’s screen print pass, so a gameboy or blueprint scene previews as it will be saved. WebP output stays under a size budget.
critique_scene
Only the critic’s notes, no image. Quick and cheap while iterating.
- Input
scene: the scene JSON (required).
- Output
- Notes such as an element cut by the frame, or "critic: no layout problems found".
render_board
Makes a brand board.
- Input
spec: a brand shortcut { brand: { name, tagline, mark, inks } } or a board of your own tiles.out: a PNG path.preview: a 900 px preview; default true.guide: true returns the board format instead of rendering.
- Output
- A line with the board size, the preview and, with out, the PNG. The shortest spec makes nine tiles.
render_poster
Makes a series of eight branding posters (1200 by 1600). Needs Levni 0.3.0.
- Input
spec: { brand: { name, tagline, mark, inks, words }, only?, count? }.out_dir: a folder for poster-01-split.png and so on, plus series.png.scenes: true also returns each poster as editable scene JSON.preview: a contact sheet of the series; default true.guide: true returns the poster format instead.
- Output
- The poster count, the contact sheet and, with out_dir, the files.
The guide for boards and posters is also available as guide: true on their tools, so an agent can read the format it needs without loading the whole scene reference.
A sample session
An illustration of the loop, shortened; the details will differ every time. The assistant calls the tools; you only talk to it.
Make a 1200 by 630 cover for my article “Why every newsroom wants a data desk”. Leave room on the left for the title.
Returns the scene format. The assistant reads it once.
{ "query": "data chart newsroom" }
N of 1628 props match.
…each with its name, shelf, tags and what every variant shows
Place one with { "type": "prop", "name": "<name>", "variant": <n>, "x": 600, "y": 336, "size": 300 }.The assistant gets a contact sheet image and picks a variant by eye.
The first attempt puts the drawing too far right:
- draw "…" (ink box …) is cut by the frame, 71% shows: pull it in, or set "crop": true if the cut is deliberateSecond attempt with the object pulled in, out: "cover.webp".
- critic: no layout problems foundSaved cover.webp. I used the chart drawing in coral on a blue panel and left the left third empty for your title.
Prompts to start with
Paste any of these and swap in your own words. The MCP page has thirteen prompts, from sticker sheets to etched posters.
- Brand board.
Make a brand board for [product], [one line about what it does]. Pick a mark from the library that suits it, use these inks: [four hex colours], and a serif wordmark. Render it with render_board, save board.png, then tell me which tile you would change.
- Poster series.
Make a poster series for my brand [name], [one line]. Pick a mark from the library, use these inks: [three or four hex colours] and these headline words: [four words]. Render it with render_poster into a folder called posters and tell me which two posters work best and why.
- Article cover.
Draw a cover for my article “[title]”. Search the library for two or three fitting drawings, show me a contact sheet, then compose a riso scene with room on the left for a title. Fix every critic note and save it as cover.webp.
- Fix without redrawing.
Run critique_scene on scene.json and fix each note by moving or resizing elements, not by changing the look. Tell me what you changed.
Ghost tools
If you publish with Ghost, add your Admin API credentials to the server’s env and three more tools appear. Without both variables they do not exist.
{
"mcpServers": {
"levni": {
"command": "npx",
"args": [
"-y",
"@levni/levni",
"mcp"
],
"env": {
"GHOST_ADMIN_API_URL": "https://your-site.com",
"GHOST_ADMIN_API_KEY": "<id>:<secret>"
}
}
}
}ghost_drafts: read-only. Drafts without images, their h2 headings and, for one draft, the full text.ghost_preview: a dry run. Renders the cover and inline images, shows where each goes and returns a token. Nothing changes.ghost_apply: writes, only with the token from a preview of the same plan on the unchanged draft.
Drafts only: nothing is published or emailed, a draft that already has images is skipped, and there is at most one image per section. The key stays in your MCP config. The same flow works from the terminal with levni ghost; see the CLI page.
Troubleshooting
- The tools do not show up. Restart the client after editing its config, and check that
npx -y @levni/levni mcpstarts when you run it in a terminal. Node.js 20 or newer is required. render_posteris missing or errors. Posters arrived in 0.3.0, which is not on npm yet. Use the checkout config above, ornpm install github:Levni-Dev/levniand point the client atnode_modules/@levni/levni/bin/levni.mjs.- Files land in the wrong folder. Paths are relative to the client’s working directory. Use absolute paths in
outif in doubt. - The agent cannot see images. Ask it to pass
preview: falseand rely oncritique_scene, or onlevni checkfor drawings.