Spaces:
Running
A newer version of the Gradio SDK is available: 6.14.0
title: GameSmith AI
emoji: ๐ฎ
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 6.0.1
app_file: app.py
pinned: false
license: mit
short_description: AI-powered 2D sprite generator & animator with Gemini
tags:
- building-mcp-track-creative
- mcp-in-action-track-creative
๐ฎ GameSmith AI: The Intelligent Game Asset Studio
Author: Rohith Raghunathan Nair
๐ Overview
GameSmith AI is a dual-interface Game Asset Generator that functions as both a human-friendly Web App and an AI-accessible MCP Server.
It solves the biggest bottleneck in indie game development: Creating consistent, animated assets in any 2D art style.
By leveraging Google Gemini 2.5 Flash for style-consistent character generation and Google Veo for physics-aware animation, GameSmith allows developers (and AI agents!) to go from a text prompt to a ready-to-use sprite sheet in seconds. Supports pixel art, anime, cartoon, vector, and more.
What's a Sprite? A sprite is a 2D image or animation used in games to represent characters, objects, or effects. A sprite sheet is a single image containing multiple frames of animation arranged in a grid, which game engines use to display smooth animations.
๐ Hackathon Tracks
This project is submitted to:
- Track 1: Building MCP (Creative) -
building-mcp-track-creative - Track 2: MCP in Action (Creative) -
mcp-in-action-track-creative
๐ฃ Social Post: View on X
๐ฌ Demo Video: Watch on YouTube
โจ Features
- Text-to-Character Generation: Creates high-quality, flat 2D game characters (sprites) in any art style (pixel art, anime, cartoon, vector, etc.) using advanced prompting strategies to ensure game-ready assets.
- AI Animation (Veo): Uses Google's Veo model to generate fluid animations (Idle, Walk, Run, Jump) that preserve the original art style of the input character.
- Asset Extraction: Automatically converts the generated video animations into standard sprite sheet frames (PNGs) and ZIP archives, ready for engines like Unity, Godot, or Phaser.
- MCP Native: All functionality is exposed via the Model Context Protocol. You can ask Claude: "Make a cute cat character, animate it walking, and give me the frames" and it will execute the entire pipeline autonomously.
๐ ๏ธ Installation & Usage
Prerequisites
- Python 3.10+
- Google Gemini API Key (with access to Veo and Gemini models)
Setup
Clone the repository:
git clone https://huggingface.co/spaces/YOUR_USERNAME/GameSmith-AI cd GameSmith-AIInstall dependencies:
pip install -r requirements.txtSet your API Key:
export GEMINI_API_KEY="your_google_api_key_here"Run the server:
python app.pyFor Humans: Open
http://localhost:7860in your browser.For Agents (MCP): Connect your MCP client to
http://localhost:7860/gradio_api/mcp/sse.
๐ค MCP Integration Guide
GameSmith AI exposes a remote MCP server via Gradio's built-in SSE endpoint. This means you can connect to it from any MCP-compatible client without running any local code!
Remote MCP Endpoint
http://localhost:7860/gradio_api/mcp/sse # Local
https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse # Hugging Face Spaces
Tools Exposed
| Tool | Description |
|---|---|
generate_pixel_character |
Generate a 2D game character (sprite) from text |
animate_pixel_character |
Animate a character (idle, walk, run, jump) |
extract_sprite_frames |
Extract frames from animation video |
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"gamesmith": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse",
"--transport",
"sse-only"
]
}
}
}
For local development:
{
"mcpServers": {
"gamesmith": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:7860/gradio_api/mcp/sse"
]
}
}
}
GitHub Copilot (VS Code)
Add to your VS Code settings.json:
{
"github.copilot.chat.mcpServers": {
"gamesmith": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse",
"--transport",
"sse-only"
]
}
}
}
Cursor
Add to .cursor/mcp.json in your project or ~/.cursor/mcp.json globally:
{
"mcpServers": {
"gamesmith": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse",
"--transport",
"sse-only"
]
}
}
}
Cline (VS Code Extension)
Add to your Cline MCP settings:
{
"mcpServers": {
"gamesmith": {
"url": "https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse",
"transport": "sse"
}
}
}
Continue (VS Code/JetBrains)
Add to ~/.continue/config.yaml:
mcpServers:
- name: GameSmith AI
command: npx
args:
- "-y"
- "mcp-remote"
- "https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse"
- "--transport"
- "sse-only"
Claude Code (CLI)
claude mcp add gamesmith -- npx -y mcp-remote https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse --transport sse-only
Windsurf
Add to your Windsurf MCP configuration:
{
"mcpServers": {
"gamesmith": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse",
"--transport",
"sse-only"
]
}
}
}
Python Client (Direct SSE)
import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client
async def main():
server_url = "https://YOUR_HF_SPACE.hf.space/gradio_api/mcp/sse"
async with sse_client(server_url) as (read_stream, write_stream):
async with ClientSession(read_stream, write_stream) as session:
await session.initialize()
# List available tools
tools = await session.list_tools()
print("Available tools:", [t.name for t in tools.tools])
# Generate a sprite
result = await session.call_tool(
"generate_pixel_character",
{"prompt": "A cute robot character, pixel art style"}
)
print(result)
asyncio.run(main())
๐ก Winning Ideas for MCP Hackathon
(As requested, here are 5 winning concepts for the MCP Hackathon)
- GameSmith AI (This Project): A creative pipeline that bridges the gap between generative video and usable game assets, solving a real "last mile" problem for developers.
- NPC-GPT (The Living Character Engine): An MCP server that generates not just the visual character (using GameSmith tools) but also the character's stats, dialogue trees, and behavior scripts, packaging them into a JSON file for Godot/Unity.
- RetroRemix (Legacy Game Reskinner): A tool where users upload screenshots of old games, and the AI identifies assets (tiles, enemies) and "remasters" them into a new style (e.g., "Cyberpunk Mario") using the character generation pipeline.
- StoryBoarder (Cinematic Cutscene Gen): An agentic workflow that takes a script, breaks it into scenes, generates keyframes using Gemini, animates short loops using Veo, and assembles a rough animatic video.
- LevelGod (Procedural World Builder): A tool focused on "Tile Connectivity". You generate a center tile, and the MCP server iteratively generates the connecting tiles (top, bottom, corners) to ensure seamless looping textures for infinite runners or RPG maps.
๐ License
MIT License