Skip to main content
Glama

text2d — 2D 复古像素艺术纹理 MCP 服务器

一个高性能的模型上下文协议(MCP)服务器,使 AI 助手能够程序化生成、操作并导出用于游戏开发的 2D 复古像素艺术纹理和瓦片集。


功能特性

  • 图像转复古像素艺术: 通过 pixelize_image 摄取外部 PNG 文件,自动缩小尺寸、量化为复古调色板,并应用 Bayer 抖动。

  • 程序化纹理合成: 确定性地生成 woodstone(鹅卵石/岩石)、brickgrassmetal(带铆钉的拉丝金属板)和 water 焦散效果。

  • 像素级图元: 通过 set_pixelset_pixel_batchdraw_shape(直线、矩形、圆形)和 flood_fill 实现完全控制。

  • 复古调色板与量化: 内置真实色彩调色板,包括 PICO-8DawnBringer 32 (DB32)Endesga 32GameBoyNES ClassicCyberpunk Neon

  • 像素艺术后处理: Bayer 有序抖动(2x2、4x4、8x8)和 1px 内/外像素完美轮廓。

  • 导出选项: 支持最近邻整数缩放的 PNG 文件、Base64 Data URI、ASCII Unicode 块预览以及 2D JSON 颜色网格。

Related MCP server: Piskel MCP Server

视觉示例与图库

1. 图像像素化(pixelize_image

将高分辨率写实照片或素材转换为地道的复古像素艺术,并自动进行调色板量化和 Bayer 抖动。

原始输入

Endesga 32 (32x32)

PICO-8 (32x32)

GameBoy (32x32)

DawnBringer 32 (48x48)

Cyberpunk Neon (64x64)

2. 程序化纹理合成(generate_texture

无需外部素材,即可在数秒内生成无缝、确定性的复古纹理。

木材(wood

石材(stone

砖块(brick

草地(grass

金属(metal

水(water


MCP 工具矩阵

工具名称

描述

关键参数

pixelize_image

摄取外部 PNG 并转换为 2D 复古像素艺术

file_path, target_width, target_height, palette, sampling, dither, export_output_path

create_canvas

初始化一个新的内存像素画布

width, height, palette, mode, backgroundColor

generate_texture

合成程序化复古纹理

canvas_id, texture_type, seed, palette, options

set_pixel

在 (x, y) 处设置单个像素

canvas_id, x, y, color

set_pixel_batch

批量更新多个坐标

canvas_id, pixels: [{x, y, color}]

draw_shape

绘制栅格化的直线、矩形或圆形

canvas_id, shape, x1, y1, x2, y2, color, filled

flood_fill

连续区域泛洪填充

canvas_id, x, y, color

apply_dither

应用 Bayer 有序抖动

canvas_id, matrix_size, spread

apply_outline

绘制 1px 像素完美轮廓

canvas_id, color, mode

export_texture

将画布导出为 PNG、Data URI、ASCII 或 JSON

canvas_id, format, file_path, scale

list_palettes

列出所有内置复古调色板

list_canvases

列出内存中的活动画布

get_canvas_info

检查画布元数据和尺寸

canvas_id

delete_canvas

从内存中释放画布

canvas_id


安装与使用

您可以直接从 GitHub 安装并运行 text2d,而无需发布到 npm:

1. 全局安装(推荐)

直接从 GitHub 仓库全局安装:

npm install -g github:al3duc/text2d-mcp

安装后,text2d 命令可在系统范围内使用。


MCP 客户端配置

text2d 添加到您的 MCP 客户端配置中(例如 claude_desktop_config.jsonmcp_config.json 或 Cursor):

选项 A:使用全局安装(最简单)

{
  "mcpServers": {
    "text2d": {
      "command": "text2d"
    }
  }
}

选项 B:通过 npx 直接执行(无需永久安装)

{
  "mcpServers": {
    "text2d": {
      "command": "npx",
      "args": [
        "-y",
        "github:al3duc/text2d-mcp"
      ]
    }
  }
}

选项 C:Claude Code CLI 命令

如果使用 Claude Code,可通过单条终端命令注册:

claude mcp add text2d -- npx -y github:al3duc/text2d-mcp

选项 D:本地克隆(开发)

git clone https://github.com/al3duc/text2d-mcp.git
cd text2d-mcp
npm install
npm run build
{
  "mcpServers": {
    "text2d": {
      "command": "node",
      "args": [
        "<PATH_TO_TEXT2D_REPOSITORY>/dist/index.js"
      ]
    }
  }
}

注意:将 <PATH_TO_TEXT2D_REPOSITORY> 替换为您克隆仓库的绝对路径。


构建与测试

# Install dependencies
npm install

# Run unit & integration tests
npm test

# Build TypeScript to dist/
npm run build

# Generate procedural texture samples (wood, stone, brick, grass, metal, water)
npx tsx examples/generate_samples.ts

# Test converting realistic images from examples/input/ to pixel art
npx tsx examples/test_car_pixelize.ts

许可证

本项目基于 MIT 许可证授权 - 有关详细信息,请参阅 LICENSE 文件。

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Generate game assets with AI: sprites, 3D models, animations, sound effects, music, and voices.

  • Generate authentic pixel art - sprites, animations, and tilesets - from any MCP client

  • Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/al3duc/text2d-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server