genart-mcp

genart-mcp

MCP server for creating and manipulating generative art with p5.js, Three.js, GLSL, Canvas2D, and SVG, featuring workspace management, parameter control, and screenshot capture.

Category
访问服务器

README

@genart-dev/mcp-server

Model Context Protocol server for genart.dev — 33 tools, 4 resources, and 3 prompts for creating and manipulating generative art with AI agents.

Works with any MCP client: Claude Code, Claude Desktop, Codex CLI, Cursor, and more.

Install

npm install -g @genart-dev/mcp-server

For screenshot/export capture, also install Puppeteer:

npm install -g puppeteer

Quick Start

Claude Code

claude mcp add genart-mcp -- genart-mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "genart": {
      "command": "genart-mcp"
    }
  }
}

Codex CLI

Add to .codex/config.toml:

[mcp_servers.genart]
command = "genart-mcp"

Then ask your AI agent to create generative art:

"Create a workspace with a p5.js sketch that draws a grid of rotating squares using the golden ratio"

Tools (33)

Workspace (5)

Tool Description
create_workspace Create a new .genart-workspace with optional initial sketches
open_workspace Open an existing .genart-workspace and load all sketches
add_sketch_to_workspace Add an existing .genart file to the active workspace
remove_sketch_from_workspace Remove a sketch from workspace (optionally delete file)
list_workspace_sketches List all sketches with metadata summaries

Sketch Lifecycle (7)

Tool Description
create_sketch Create a new .genart sketch — supports all 5 renderers
open_sketch Open a sketch by ID and set selection
update_sketch Update metadata, parameters, colors, canvas
update_algorithm Replace algorithm source code with optional validation
save_sketch Persist in-memory state to disk
fork_sketch Create a variant with new ID and optional modifications
delete_sketch Delete sketch file and remove from workspace

Selection & Context (4)

Tool Description
get_selection Full context for selected sketch(es) — algorithm, params, colors, philosophy
select_sketch Set canvas selection to one or more sketches
get_editor_state Full snapshot of workspace, sketches, and selection
set_working_directory Set base directory for sandboxed file operations

Parameters (5)

Tool Description
set_parameters Update runtime parameter values
set_colors Update runtime color palette values
set_seed Set random seed (or generate random)
set_canvas_size Change dimensions via preset or explicit W/H
randomize_parameters Generate random values for all/specific parameters

Arrangement (3)

Tool Description
arrange_sketches Move sketches to explicit canvas positions
auto_arrange Auto-layout with grid, row, column, or masonry
group_sketches Create/update named groups of sketches

Gallery (2)

Tool Description
list_sketches Scan a directory for .genart files with metadata
search_sketches Search loaded sketches by title, renderer, params, skills

Merge (1)

Tool Description
merge_sketches Combine parameters, colors, and philosophies from 2+ sketches

Capture (3)

Tool Description
capture_screenshot Headless capture of a sketch — returns metadata + inline JPEG for AI viewing
capture_batch Capture multiple sketches in parallel
snapshot_layout Structural summary of workspace layout for spatial reasoning

Export (1)

Tool Description
export_sketch Export as standalone HTML, PNG, SVG, raw algorithm, or ZIP bundle

Knowledge (3)

Tool Description
list_skills List available design knowledge skills by category
load_skill Load a skill with full theory, principles, and examples
get_guidelines Design guidelines for composition, color, parameters, animation, performance

Resources (4)

URI Description
genart://skills Available design knowledge skills
genart://presets/canvas Canvas dimension presets (18 built-in)
genart://gallery Loaded sketches with metadata summaries
genart://renderers Available renderer types and metadata

Prompts (3)

Prompt Description
create-generative-art Guided workflow: concept → sketch → algorithm → capture → iterate
explore-variations Fork and explore parameter/seed space across multiple variants
apply-design-theory Apply Gestalt, color theory, composition, rhythm, or contrast principles

Supported Renderers

Type Runtime Algorithm
p5 p5.js function sketch(p, state) { ... }
three Three.js function sketch(THREE, state, container) { ... }
glsl WebGL2 Fragment shader source
canvas2d Native function sketch(ctx, state) { ... }
svg Native function sketch(state) { ... }

Library API

For programmatic use (e.g., building a custom MCP host):

import { createServer, EditorState } from "@genart-dev/mcp-server/lib";

const state = new EditorState();
const server = createServer(state);

// Connect to any MCP transport
// ...

Exports from @genart-dev/mcp-server/lib

Export Description
createServer(state) Create a configured McpServer instance
EditorState Server-scoped mutable state (workspace, sketches, selection)
LoadedSketch Type — sketch definition + file path + dirty flag
EditorMutationType Type — mutation event names (sketch:created, workspace:loaded, etc.)
EditorMutationEvent Type — mutation event payload
EditorStateSnapshot Type — serializable snapshot of all state

EditorState

const state = new EditorState();

// Load from disk
await state.loadWorkspace("/path/to/project.genart-workspace");

// Access loaded sketches
state.sketches;               // Map<string, LoadedSketch>
state.selection;              // Set<string>
state.workspace;              // WorkspaceDefinition | null

// Sandbox file operations (for hosted environments)
state.basePath = "/safe/dir";
state.remoteMode = true;      // Return file content instead of writing to disk

// Listen for mutations
state.on("mutation", (event) => {
  console.log(event.type);    // "sketch:created", "workspace:loaded", etc.
});

// Serializable snapshot
const snapshot = state.getSnapshot();

Modes

stdio (default)

Standard MCP transport for CLI agents:

genart-mcp

Sidecar

Stdio transport + IPC mutation bridge for Electron app integration:

genart-mcp --mode sidecar

Mutations are forwarded to the parent process via Node IPC, enabling real-time UI updates when AI agents modify sketches.

Agent Attribution

Most mutation tools accept optional agent and model parameters for provenance tracking:

{
  "agent": "claude-code",
  "model": "claude-opus-4-6"
}

Stored in sketch metadata to track which AI agent created or modified each sketch.

Related Packages

Package Purpose
@genart-dev/format File format types, parsers, presets
@genart-dev/core Renderer adapters, skill registry (dependency)

Support

Questions, bugs, or feedback — support@genart.dev or open an issue.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选