Skip to main content

MCP for Unity Server: A Unity package for Unity Editor integration via the Model Context Protocol (MCP).

Project description

MCP for Unity Server

MCP python License Discord

Model Context Protocol server for Unity Editor integration. Control Unity through natural language using AI assistants like Claude, Cursor, and more.

Maintained by Coplay - This project is not affiliated with Unity Technologies.

💬 Join our community: Discord Server

Required: Install the Unity MCP Plugin to connect Unity Editor with this MCP server. You also need uvx (requires uv) to run the server.


Installation

Option 1: PyPI

Install and run directly from PyPI using uvx.

Run Server (HTTP):

uvx --from mcpforunityserver mcp-for-unity --transport http --http-url http://localhost:8080

MCP Client Configuration (HTTP):

{
  "mcpServers": {
    "UnityMCP": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

MCP Client Configuration (stdio):

{
  "mcpServers": {
    "UnityMCP": {
      "command": "uvx",
      "args": [
        "--from",
        "mcpforunityserver",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}

Option 2: From GitHub Source

Use this to run the latest released version from the repository. Change the version to main to run the latest unreleased changes from the repository.

{
  "mcpServers": {
    "UnityMCP": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/CoplayDev/unity-mcp@v8.7.0#subdirectory=Server",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ]
    }
  }
}

Option 3: Docker

Use Pre-built Image:

docker run -p 8080:8080 msanatan/mcp-for-unity-server:latest --transport http --http-url http://0.0.0.0:8080

Build Locally:

docker build -t unity-mcp-server .
docker run -p 8080:8080 unity-mcp-server --transport http --http-url http://0.0.0.0:8080

Configure your MCP client with "url": "http://localhost:8080/mcp".

Option 4: Local Development

For contributing or modifying the server code:

# Clone the repository
git clone https://github.com/CoplayDev/unity-mcp.git
cd unity-mcp/Server

# Run with uv
uv run src/main.py --transport stdio

Configuration

The server connects to Unity Editor automatically when both are running. No additional configuration needed.

Environment Variables:

  • DISABLE_TELEMETRY=true - Opt out of anonymous usage analytics
  • LOG_LEVEL=DEBUG - Enable detailed logging (default: INFO)

Example Prompts

Once connected, try these commands in your AI assistant:

  • "Create a 3D player controller with WASD movement"
  • "Add a rotating cube to the scene with a red material"
  • "Create a simple platformer level with obstacles"
  • "Generate a shader that creates a holographic effect"
  • "List all GameObjects in the current scene"

Documentation

For complete documentation, troubleshooting, and advanced usage:

📖 Full Documentation


Requirements

  • Python: 3.10 or newer
  • Unity Editor: 2021.3 LTS or newer
  • uv: Python package manager (Installation Guide)

License

MIT License - See LICENSE

Project details


Release history Release notifications | RSS feed

This version

8.7.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpforunityserver-8.7.0.tar.gz (94.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpforunityserver-8.7.0-py3-none-any.whl (121.6 kB view details)

Uploaded Python 3

File details

Details for the file mcpforunityserver-8.7.0.tar.gz.

File metadata

  • Download URL: mcpforunityserver-8.7.0.tar.gz
  • Upload date:
  • Size: 94.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpforunityserver-8.7.0.tar.gz
Algorithm Hash digest
SHA256 b6d0881bd184e1976cb5fa94c3ee2282f4253b9c78f149b16fa071eb42d5d1b7
MD5 4633246aab14639247a7fb8d73df19cc
BLAKE2b-256 c3d9a8f17ab93519814cad1eede0454160bb72b6ab9433f713fcc269405cac27

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpforunityserver-8.7.0.tar.gz:

Publisher: publish-pypi.yml on CoplayDev/unity-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpforunityserver-8.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcpforunityserver-8.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0d75d5f72eab90380c2e1d2687b7569279ae2549175a703135c7b57dd881c47
MD5 e033e5bc3ffa2685042b49b427779e44
BLAKE2b-256 fb5d4f29188abf12edcdb756773198fb05ae3c8cfe7d35a0faf759149e76a09b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpforunityserver-8.7.0-py3-none-any.whl:

Publisher: publish-pypi.yml on CoplayDev/unity-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page