Skip to content

elad12390/unity-vibe-link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

VibeLink - Unity Agentic Bridge

Enable AI agents to see, manipulate, and verify Unity projects autonomously.

VibeLink is a hybrid Unity Package + MCP Server that gives CLI-based AI agents (Claude Code, Cursor, etc.) direct access to Unity's Editor through the Model Context Protocol.

Status: โœ… Working! See CURRENT_STATUS.md for latest test results and known issues.

Quick Test: After Unity restart, run ./test-after-restart.sh to verify all features work.

๐ŸŽฏ Core Capabilities ("The Superpowers")

๐Ÿ”ด Power 1: The Eyes (Visual Verification)

  • Capture Game View or Scene View screenshots
  • See what the agent creates in real-time
  • Visual feedback loop for iterative development

๐Ÿ”ต Power 2: The Hands (Direct Manipulation)

  • Execute C# code directly in Unity Editor
  • No need to create files for quick operations
  • Instant iteration and testing

๐ŸŸข Power 3: The Brain (State Querying)

  • Query GameObject state using CSS-like selectors
  • Get actual runtime values, not just code
  • Verify scene configuration programmatically

๐ŸŸก Power 4: The Time Machine (Test Running)

  • Enter Play Mode for specified duration
  • Capture all logs and errors automatically
  • Automated regression testing

๐Ÿš€ Quick Start

Prerequisites

  • Unity 2021.3 or later (.NET Standard 2.1 support)
  • Node.js 18+ (for MCP server)
  • AI agent that supports MCP (Claude Code, Cursor, etc.)

Installation

1. Install Unity Package

Copy the unity-package folder into your Unity project's Packages directory:

cd YourUnityProject/Packages
git clone https://github.com/vibelink/unity-vibe-link.git com.vibelink.unity

Or add via Package Manager:

  1. Open Unity
  2. Window โ†’ Package Manager
    • โ†’ Add package from disk
  3. Select unity-package/package.json

2. Install MCP Server

cd mcp-server
npm install
npm run build

3. Configure Your AI Agent

Add to your MCP config (e.g., ~/.config/opencode/mcp.json or Claude Desktop config):

{
  "mcpServers": {
    "vibelink-unity": {
      "command": "node",
      "args": ["/path/to/unity-vibe-link/mcp-server/build/index.js"]
    }
  }
}

4. Start Unity with VibeLink

  1. Open your Unity project
  2. Go to Tools โ†’ VibeLink โ†’ Start Host
  3. The VibeLink window will show "Connected: Yes" when your agent connects

๐Ÿ“– Usage Examples

Example 1: Visual Verification

User: "The button looks off-center"

Agent:

1. unity_capture_view(viewType: "game")
2. [Analyzes screenshot]
3. unity_query_state(selector: "Button")
4. unity_execute_script(code: "GameObject.Find('Button').GetComponent<RectTransform>().anchoredPosition = Vector2.zero;")
5. unity_capture_view(viewType: "game")
6. [Verifies fix]

Example 2: Procedural Generation

User: "Create 50 cubes in a spiral pattern"

Agent:

unity_execute_script({
  code: `
    for (int i = 0; i < 50; i++) {
      float angle = i * 0.5f;
      float radius = i * 0.2f;
      Vector3 pos = new Vector3(
        Mathf.Cos(angle) * radius,
        i * 0.1f,
        Mathf.Sin(angle) * radius
      );
      GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
      cube.transform.position = pos;
    }
  `
})

Example 3: Automated Testing

User: "Does the game crash when I start?"

Agent:

unity_run_playmode({ duration: 5.0 })
// Returns all logs/errors from 5-second playtest

๐Ÿ› ๏ธ Available Tools

Tool Description Use Case
unity_capture_view Screenshot Game/Scene view Visual verification
unity_execute_script Run C# code in Editor Quick iterations
unity_query_state Query GameObject state State inspection
unity_run_playmode Run game with logging Automated testing
unity_ping Check connection Health check

๐Ÿ”’ Safety Features

Sandboxing

  • All agent-created assets go to Assets/_AgentScratchpad/
  • Prevents corruption of core project files

Watchdog (Coming Soon)

  • Script execution timeout
  • Infinite loop protection
  • Resource usage monitoring

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         Named Pipe          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Unity Editor   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚   MCP Server     โ”‚
โ”‚  (C# Package)   โ”‚      <5ms latency           โ”‚   (Node.js)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ–ฒ                                                 โ–ฒ
        โ”‚                                                 โ”‚
        โ”‚ EditorWindow                           MCP Protocol
        โ”‚ Direct API Access                      (JSON-RPC)
        โ”‚                                                 โ”‚
        โ–ผ                                                 โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Unity Scene    โ”‚                              โ”‚   AI Agent       โ”‚
โ”‚  GameObjects    โ”‚                              โ”‚ (Claude/Cursor)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Development Status

  • Core transport layer (Named Pipes)
  • Visual capture (Game/Scene views)
  • Script execution framework
  • State querying with selectors
  • Play Mode automation
  • MCP server implementation
  • Dynamic C# compilation (Roslyn)
  • Advanced selector syntax
  • Watchdog protection
  • Performance profiling tools
  • Asset modification tracking

๐Ÿค Contributing

This is an open-source project! Contributions welcome.

Development Setup

  1. Clone repository
  2. Open Unity package in Unity 2021.3+
  3. Run npm install in mcp-server/
  4. Make changes and test with your AI agent

๐Ÿ“„ License

MIT License - See LICENSE file for details

๐Ÿ”— Links

โš ๏ธ Disclaimer

VibeLink is in alpha. Use in production projects at your own risk. Always backup your project before enabling agent automation.


Built for the future of AI-assisted game development ๐ŸŽฎ๐Ÿค–

About

Unity Agentic Bridge - Enable AI agents to see, manipulate, and verify Unity projects through MCP

Resources

License

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors