Skip to content

muammar-yacoob/unity-mcp

Repository files navigation

⚡ Unity MCP: AI-Powered Game Development

🎮 Automate Unity development • 🤖 AI-powered workflows • 🚀 Natural language game creation

npm version License: MIT GitHub Sponsors Report Bug GitHub Stars

✨ What It Does

Control the Unity game engine through natural language using AI coding assistants like Claude Desktop. This Model Context Protocol (MCP) server enables you to rapidly prototype, build, and manage Unity projects by simply describing your game ideas.

Feature Description
🎮 Project Creation Initialize new Unity projects with templates
🏃 Player Movement Create player controllers with customizable inputs
🔫 Shooting Mechanics Implement projectile systems and combat interactions
📊 Level System Build progressive level systems with difficulty scaling
🎨 UI System Generate game HUDs, menus, and screens
🔧 Component Setup Add and configure Unity components via natural language
🎭 3D Character Import Search and import rigged 3D models from Sketchfab
📹 Cinemachine Camera Automatic camera follow system for 3D characters
🎬 Scene Management Create and configure game scenes programmatically

🚀 Quick Setup

📋 Prerequisites

  • Node.js >= 18.0.0
  • Unity 2022.3 LTS or later
  • AI Coding Assistant (e.g., Claude Desktop, Cursor, VS Code with MCP support)

📥 Installation

npm install -g @spark-apps/unity-mcp

⚙️ Configure Your AI Assistant

  1. Locate your AI assistant's MCP configuration file (e.g., claude_desktop_config.json for Claude Desktop, .cursor/mcp.json for Cursor):

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json or ~/.cursor/mcp.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json or %APPDATA%/Cursor/.cursor/mcp.json
    • Linux: ~/.config/Claude/claude_desktop_config.json or ~/.config/cursor/.cursor/mcp.json
  2. Add Unity MCP server to the configuration:

{
  "mcpServers": {
    "unity-mcp": {
      "command": "npx",
      "args": ["-y", "@spark-apps/unity-mcp"]
    }
  }
}
  1. Restart your AI assistant for changes to take effect.

  2. Verify installation: Look for the 🔌 icon or a similar indicator in your AI assistant. Click it to see "unity-mcp" listed as a connected server.

🛠️ Available Tools

Tool Description
🎮 create_unity_project Create new Unity projects with specified templates
🏃 setup_player Create player character with movement, shooting, health
🔫 create_projectile_system Add weapon and projectile mechanics
👾 create_enemy Generate enemy prefabs with AI behavior and attributes
📊 setup_level_system Create wave-based level progression and difficulty
🎨 create_game_ui Build HUD, menus, and other game screens
🎯 setup_collision_system Configure physics layers, collision matrix, damage
🎭 import_3d_character Import rigged 3D models from Sketchfab with animations
🎬 setup_scene_structure Create organized scene hierarchy with camera & lighting

💬 Example Commands in Your AI Assistant

🎮 Project Creation

"Create a new 2D shooter game project called 'Space Invaders Clone'"

"Initialize a basic top-down shooter"

"Set up a side-scrolling shooter project"

🏃 Player Setup

"Create a player that can move with WASD and shoot with spacebar"

"Add a player controller with 5 units per second movement speed"

"Set up player with health system and shooting mechanics"

👾 Enemy System

"Create an enemy that moves toward the player and has 3 health"

"Add a boss enemy with 50 health and special attacks"

"Generate 5 different enemy types with varying behaviors"

📊 Level Progression

"Create a 5-level progression system with increasing difficulty"

"Add a level manager that spawns more enemies each level"

"Set up level transitions with victory screens"

🎭 3D Character Import

"Import a 3D character from Sketchfab with walk animation"

"Search Sketchfab for a female character and set up controls"

"Create a 3D character controller with Cinemachine camera"

"Add a robot character with WASD movement and jump"

---

🌱 Support & Contributions

Star the repo & I power up like Mario 🍄
Devs run on coffee - [Buy me one?][coffee-link]
💰 Crypto tips welcome - Tip in crypto
🤝 Contributions are welcome - [🍴 Fork][fork-link], improve, PR!
🎥 Need help? YouTube [Setup Tutorial][vid-link] • Discord Join Discord

💖 Sponsor

Your support helps maintain and improve the tool. please consider [sponsoring the project][stars-link].


Built with ❤️ for the Unity and AI automation community

About

Control Unity game engine through natural language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •