使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 logo

使用 MCP 和 Hugging Face Spaces 的游戏资产生成器

Community
sato942

An MCP server for creating 2D/3D game assets from text using Hugging Face AI models.

Publishersato942
Repositorygame-asset-mcp
LanguageJavaScript
Forks
41
Stars
158
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    158 stars and 41 forks from the linked repository.

Project owner will look into this repository soon, expect an update in JUNE 2026

Game Asset Generator using MCP and Hugging Face Spaces

This project is an innovative tool that simplifies game asset creation by leveraging AI-powered generation. Whether you're a game developer seeking rapid prototypes or an AI enthusiast exploring generative models, this tool enables you to create 2D and 3D game assets from text prompts effortlessly. It integrates AI models from Hugging Face Spaces—powered by "gokaygokay/Flux-2D-Game-Assets-LoRA", "gokaygokay/Flux-Game-Assets-LoRA-v2", and one of three 3D model generation spaces (InstantMesh, Hunyuan3D-2, or Hunyuan3D-2mini-Turbo, which you must duplicate to your account)—and uses the Model Context Protocol (MCP) for seamless interaction with AI assistants like Claude Desktop.


Table of Contents

  1. Project Overview
  2. Features
  3. How It Works
  4. Prerequisites
  5. Installation
  6. Usage
  7. Configuration
  8. File Management
  9. MCP Integration
  10. Troubleshooting
  11. Advanced
  12. Contributing
  13. License

Project Overview

The Game Asset Generator (version 0.3.0) harnesses AI to streamline the creation of game assets. It supports generating 2D assets (e.g., pixel art sprites) and 3D assets (e.g., OBJ and GLB models) from text prompts, integrating with Hugging Face Spaces and the Model Context Protocol (MCP). This release introduces support for multiple 3D model generation spaces—InstantMesh, Hunyuan3D-2, and Hunyuan3D-2mini-Turbo—offering flexibility and enhanced performance. Built with Node.js and the MCP TypeScript SDK (v1.7.0), it provides a robust, cross-platform solution for asset generation.


Features

  • 2D Asset Generation: Create pixel art, sprites, or other 2D assets from text prompts (e.g., "pixel art sword").
  • 3D Asset Generation: Generate 3D models (OBJ and GLB formats) from text descriptions, with automatic image-to-model conversion.
  • Multiple 3D Model Spaces: Supports InstantMesh, Hunyuan3D-2, and Hunyuan3D-2mini-Turbo for varied 3D generation workflows.
  • MCP Integration: Seamlessly interact with the tool via MCP-compatible clients like Claude Desktop.
  • File Management: Automatically saves and organizes assets in a local assets directory with resource URIs (e.g., asset://{type}/{id}).
  • Robust Input Validation: Uses Zod for secure and reliable input processing.
  • Multi-Client Support: Handles multiple simultaneous connections via SSE transport.
  • Secure Remote Access: Optional HTTPS support for safe remote communication.
  • Extensible Backend: Modular design for easy integration of new models or features.
  • Cross-Platform: Compatible with Windows, macOS, and Linux using Node.js.
  • Configurable 3D Generation: Customize parameters like inference steps, guidance scale, and turbo mode via environment variables.

How It Works

The Game Asset Generator transforms text prompts into game-ready assets through an automated pipeline:

  1. User Input: Submit a text prompt (e.g., "pixel art sword" or "isometric 3D castle").
  2. MCP Server: Routes the prompt to the appropriate tool (generate_2d_asset or generate_3d_asset).
  3. AI Model Interaction:
    • 2D Assets: Utilizes the Hugging Face Inference API with "gokaygokay/Flux-2D-Game-Assets-LoRA" (50 steps).
    • 3D Assets:
      • Generates an initial image using "gokaygokay/Flux-Game-Assets-LoRA-v2" (30 steps).
      • Converts the image to a 3D model using one of:
        • InstantMesh: Multi-step process (/preprocess, /generate_mvs, /make3d).
        • Hunyuan3D-2: Single-step process (/generation_all).
        • Hunyuan3D-2mini-Turbo: Single-step process (/generation_all) with configurable turbo modes.
  4. File Output: Saves assets (PNG for 2D, OBJ/GLB for 3D) in the assets directory.
  5. Response: Returns resource URIs (e.g., asset://3d_model/filename.glb) for immediate use.

Workflow Diagram

User Prompt → MCP Server → AI Model(s) → Local File → Resource URI Response

Prompts are automatically enhanced with "high detailed, complete object, not cut off, white solid background" for optimal quality.


Prerequisites

  • Node.js: Version 16+ (includes npm).
  • Git: For cloning the repository.
  • Internet Access: Required for Hugging Face API connectivity.
  • Hugging Face Account: Needed for API access; obtain your token from huggingface.co/settings/tokens.
  • NPM Packages:
    • @gradio/client: Interacts with Hugging Face Spaces.
    • @huggingface/inference: For direct model inference.
    • @modelcontextprotocol/sdk: Implements the MCP server.
    • dotenv: Loads environment variables.
    • express: Enables SSE transport.
    • zod: Ensures input validation.
    • sharp: Handles image processing.
  • Optional: Claude Desktop (or another MCP client) for enhanced interaction.

Installation

  1. Clone the Repository:

    bash
    git clone https://github.com/yourusername/game-asset-mcp.git
    cd game-asset-mcp
  2. Install Dependencies:

    bash
    npm install
  3. Configure Environment:

    • Copy the example .env file:
      bash
      cp .env.example .env
    • Edit .env with your Hugging Face API token and duplicated MODEL_SPACE. See Configuration for details.
  4. Run the Server:

    • Local (stdio transport):
      bash
      npm start
    • Custom Working Directory:
      bash
      node src/index.js /path/to/directory
    • Remote (SSE transport):
      bash
      node src/index.js --sse
    • Remote with HTTPS:
      bash
      node src/index.js --sse --https
      Requires ssl/key.pem and ssl/cert.pem (see ssl/README.md).

Note: Uses ES modules ("type": "module" in package.json). Ensure Node.js 16+ is installed (node --version).


Usage

Interact with the server via an MCP client (e.g., Claude Desktop) or programmatically:

  • Generate a 2D Asset:

    • Command: generate_2d_asset prompt:"pixel art sword"
    • Output: Saves a PNG file (e.g., 2d_asset_generate_2d_asset_1698765432.png) and returns its URI.
  • Generate a 3D Asset:

    • Command: generate_3d_asset prompt:"isometric 3D castle"
    • Output: Saves OBJ/GLB files and intermediate images, returning their URIs. Provides an operation ID for long-running tasks.

Prompt Examples

  • Natural Interaction:
    • generate_2d_sprite prompt:"pixel art sword"
    • generate_3d_model prompt:"isometric 3D castle"

With Claude Desktop

After configuring (see Configuration), type commands directly in the interface.


Configuration

Customize the server via the .env file:

Required Settings

  • HF_TOKEN: Hugging Face API token.
    plaintext
    HF_TOKEN=your_hf_token
  • MODEL_SPACE: Your duplicated 3D model space (e.g., your-username/InstantMesh).
    plaintext
    MODEL_SPACE=your-username/InstantMesh

Optional 3D Model Settings

VariableDescriptionValid Range/Default
MODEL_3D_STEPSInference stepsVaries by space (see below)
MODEL_3D_GUIDANCE_SCALEHow closely the model follows the prompt0.0-100.0 (default: 5.0-5.5)
MODEL_3D_OCTREE_RESOLUTIONDetail level of the 3D modelVaries by space (see below)
MODEL_3D_SEEDRandomness control0-10000000 (default: varies)
MODEL_3D_REMOVE_BACKGROUNDRemove image backgroundtrue/false (default: true)
MODEL_3D_TURBO_MODEGeneration mode (Hunyuan3D-2mini-Turbo only)Turbo, Fast, Standard (default: Turbo)
MODEL_SPACE_TYPEOverride space type detectioninstantmesh, hunyuan3d, hunyuan3d_mini_turbo

Space-Specific Defaults

  • InstantMesh:
    • Steps: 30-75 (default: 75)
    • Seed: Default 42
  • Hunyuan3D-2:
    • Steps: 20-50 (default: 20)
    • Guidance Scale: Default 5.5
    • Octree Resolution: 256, 384, 512 (default: 256)
    • Seed: Default 1234
  • Hunyuan3D-2mini-Turbo:
    • Steps: 1-100 (default: 5 for Turbo, 10 for Fast, 20 for Standard)
    • Guidance Scale: Default 5.0
    • Octree Resolution: 16-512 (default: 256)
    • Seed: Default 1234

Transport Settings

  • PORT: SSE transport port (default: 3000).
    plaintext
    PORT=3000

Claude Desktop Setup

Edit the config file:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{
  "mcpServers": {
    "game-asset-generator": {
      "command": "node",
      "args": ["/full/path/to/game-asset-mcp/src/index.js"]
    }
  }
}

Restart Claude Desktop after editing.


File Management

  • Storage Location: Assets are saved in ./assets within the working directory.
  • Naming Convention: Files use a prefix, tool name, timestamp, and unique ID (e.g., 2d_asset_generate_2d_asset_1698765432_abcd1234.png).
  • Customization: Set a custom directory:
    bash
    node src/index.js /path/to/custom/directory
  • Resource Access: Use MCP URIs (e.g., asset://2d_asset/filename.png) to list or read assets.

MCP Integration

The Model Context Protocol (MCP) enables this tool to serve AI clients securely:

  • Tools: generate_2d_asset, generate_3d_asset.
  • Resources: Managed via asset:// URIs.
  • Prompts: generate_2d_sprite, generate_3d_model.
  • Compatibility: Works with Claude Desktop and other MCP clients.

Troubleshooting

  • API Errors: Check network connectivity or rate limits; review ./logs/server.log.
  • Authentication Issues: Verify HF_TOKEN and MODEL_SPACE in .env.
  • ES Modules Error: Ensure Node.js 16+ (node --version).
  • Logs: Inspect detailed logs:
    bash
    tail -f ./logs/server.log

Advanced

API Endpoints and Integration

  • 2D Asset Generation: Uses "gokaygokay/Flux-2D-Game-Assets-LoRA" (50 steps).
  • 3D Asset Image Generation: Uses "gokaygokay/Flux-Game-Assets-LoRA-v2" (30 steps).
  • 3D Model Conversion:
    • InstantMesh: Multi-step (/check_input_image, /preprocess, /generate_mvs, /make3d).
    • Hunyuan3D-2: Single-step (/generation_all).
    • Hunyuan3D-2mini-Turbo: Single-step (/generation_all) with turbo modes.

Versioning

  • Current Version: 0.3.0 (Added Hunyuan3D-2mini-Turbo support).
  • MCP SDK Version: 1.7.0.
  • Format: MAJOR.MINOR.PATCH (SemVer).

Backend Architecture

  • Core File: src/index.js.
  • Dependencies: See package.json.
  • Security: Zod validation, path traversal prevention, HTTPS support, rate limiting.
  • Performance: Async processing, retry with backoff, GPU quota handling.

Contributing

We welcome contributions! To participate:

  1. Fork the Repository: Create your copy on GitHub.
  2. Make Changes: Add features, fix bugs, or enhance docs.
  3. Submit a Pull Request: Detail your changes.
  4. Open Issues: Report bugs or suggest improvements.

Follow standard coding conventions and include tests where applicable.


License

Licensed under the MIT License. See the LICENSE file for details.

Installation

TypingMind
{
  "mcpServers": {
    "game-asset-mcp": {
      "command": "npm",
      "args": [
        "start"
      ]
    }
  }
}

Use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "game-asset-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "game-asset-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 to help me with this task?
使用 MCP 和 Hugging Face Spaces 的游戏资产生成器
Sure. I read it.
Here is what I found using 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器.

Option 2: Add an MCP server URL

Use this when 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 to help me with this task?
使用 MCP 和 Hugging Face Spaces 的游戏资产生成器
Sure. I read it.
Here is what I found using 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器.

Frequently asked questions

What is the 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP server used for?

使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP to TypingMind?

使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP provide in TypingMind?

使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If 使用 MCP 和 Hugging Face Spaces 的游戏资产生成器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇