ASCII运动MCP服务器
A. 模型上下文协议(MCP) 服务器,使AI助手能够从 ASCII运动应用程序使用自然语言。
这是什么?
ASCII Motion MCP允许您使用Claude、GitHub Copilot和Cursor等AI助手:
- 🎨 绘制ASCII艺术 -使用字符创建像素艺术和文本图形
- 🎬 动画 -使用洋葱皮构建逐帧动画
- 📥 导入 -完全控制将图像转换为ASCII艺术
- 📤 出口 -另存为PNG、GIF、MP4、HTML、React或CLI组件
- 🌈 应用效果 -添加数字雨、噪音、颜色偏移等
全部通过自然语言提示!
快速开始
先决条件
- Node.js 18+
- MCP兼容的AI客户端(克劳德桌面、VS代码+复制副本、光标等)
安装
npm install -g ascii-motion-mcp验证安装:
ascii-motion-mcp --help客户端设置
重要提示: 这 --live 所有设置都需要标记。没有它,MCP工具就没有视觉输出。配置客户端后,您还必须连接浏览器才能查看AI的工作。克劳德桌面版
添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json\ 窗户: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ascii-motion": {
"command": "ascii-motion-mcp",
"args": ["--live", "--project-dir", "/path/to/your/projects"]
}
}
}保存后重新启动Claude Desktop。
VS代码与GitHub Copilot
- 安装 扩展
- 创建
.vscode/mcp.json在您的工作空间中:
{
"servers": {
"ascii-motion": {
"command": "npx",
"args": [
"ascii-motion-mcp",
"--live",
"--project-dir",
"${workspaceFolder}"
],
"type": "stdio"
}
}
}或者,如果您已全局安装(npm install -g ascii-motion-mcp):
{
"servers": {
"ascii-motion": {
"command": "ascii-motion-mcp",
"args": [
"--live",
"--project-dir",
"${workspaceFolder}"
],
"type": "stdio"
}
}
}- 完全重新启动VS代码(而不仅仅是重新加载窗口)
- 打开副驾驶聊天-MCP工具现在应该可用了!
注: 当Copilot需要时,VS Code会自动生成MCP服务器。您无需手动运行服务器。
连接浏览器(可选)
要实时查看编辑:
- 询问Copilot:“什么是MCP认证令牌?”
- 打开 ascii-motion.app
- 点击☰ → MCP连接
- 粘贴令牌并单击 连接
GitHub Copilot命令行界面
- 安装GitHub CLI和Copilot扩展:
# Install GitHub CLI
brew install gh # macOS
# or: winget install GitHub.cli # Windows
# Install Copilot extension
gh extension install github/gh-copilot
# Login
gh auth login- 创建/编辑
~/.config/gh-copilot/config.yml:
mcpServers:
ascii-motion:
command: ascii-motion-mcp
args:
- --live
- --project-dir
- ~/ascii-art-projects- 在终端中使用:
gh copilot chat "Create an 8-frame animation of a bouncing ball"光标
- 打开光标设置(
Cmd+,/Ctrl+,) - 在设置中搜索“MCP”
- 点击“在settings.json中编辑”并添加:
{
"mcp.servers": {
"ascii-motion": {
"command": "ascii-motion-mcp",
"args": ["--live", "--project-dir", "/path/to/projects"]
}
}
}- 重新启动游标
帆板运动
添加到您的Windsurf MCP配置中:
{
"mcpServers": {
"ascii-motion": {
"command": "ascii-motion-mcp",
"args": ["--live", "--project-dir", "/path/to/projects"]
}
}
}连接浏览器
配置AI客户端后,您必须连接ASCII Motion浏览器应用程序才能看到视觉输出:
- 获取身份验证令牌 -问你的AI:“什么是MCP认证令牌?”
- 打开ASCII运动 首选 ascii-motion.app
- 打开MCP连接 -点击汉堡菜单(☰)→ MCP连接
- 粘贴令牌 -输入身份验证令牌并单击 连接
您应该看到绿色的“已连接”状态。现在,您的AI编辑实时显示!
CLI选项
ascii-motion-mcp [options]
Options:
-d, --project-dir PATH Project directory for file operations (default: cwd)
-l, --live Enable live browser sync via WebSocket (REQUIRED)
-p, --port PORT WebSocket port for live mode (default: 9876)
-h, --help Show help
-v, --version Show version示例提示
配置后,请使用您的AI助手尝试以下提示:
创作艺术:
“用红色像素艺术心创作一幅40x20的画布”
导入和转换:
“将图像导入./photo.jpg,并使用块字符将其转换为ASCII”
使有生气:
“创建拐杖人物的8帧动画”
应用效果:
“添加绿色字符的数字雨效果”
出口:
“将此动画导出为2倍大小的GIF”
CLI组件:
“导出为我的Node.js CLI应用程序的Ink组件”
可用工具(共69个)
画布工具
set_cell, get_cell, clear_cell, set_cells_batch, paste_ascii_block, fill_region, resize_canvas, clear_canvas
框架工具
add_frame, delete_frame, duplicate_frame, go_to_frame, list_frames, set_frame_duration, set_frame_name
动画工具
copy_frame_and_modify, shift_frame_content, flip_region, copy_region_to_frame, interpolate_frames
项目工具
new_project, save_project, load_project, get_project_info, list_project_files, set_project_name
预览工具
get_canvas_summary, get_canvas_preview, get_canvas_ascii, get_frame_diff, describe_animation
选择工具
select_rectangle, select_by_color, get_selection, clear_selection, apply_to_selection, delete_selection_content
调色板工具
list_character_palettes, get_character_palette, list_color_palettes, get_color_palette, get_active_colors, set_foreground_color, set_background_color, set_selected_character, suggest_palette_for_style
导入工具
import_image, import_video, import_ascii_text
效果工具
apply_effect, get_color_stats, batch_recolor, batch_replace_char
发电机工具
run_generator, preview_generator
导出工具
export_text, export_json, export_session, export_html, export_react, export_ansi, export_ink, export_bubbletea, export_opentui, export_image, export_video
历史记录工具
undo, redo, get_history_status
MCP资源
服务器公开这些资源用于状态自检:
project://state-完整项目状态快照project://canvas-当前帧画布数据project://frames-带元数据的帧列表project://selection-当前选择状态project://history-撤消/重做历史记录project://ascii-纯文本ASCII预览
需求
- Node.js 18+ -必填项
- 锋利的 (可选)-对于图像导入:
npm install sharp - FFmpeg (可选)-用于视频导出:
brew install ffmpeg
故障排除
“找不到命令”
确保npm全局bin在你的PATH中:
npm bin -g
# Add the output to your PATH if needed工具未出现
配置更改后重新启动AI客户端。检查配置文件是否为有效的JSON。
直播模式未连接
- 确保端口9876可用
- 检查您是否从本地主机连接
- 验证身份验证令牌是否正确
无视觉输出
确保您正在使用 --live 标志AND已通过MCP连接连接浏览器。
链接
许可证
MIT许可证-请参阅 许可证 了解详情。
