개발/unity

[MCP] MCP Unity 적용

yun000 2025. 4. 25. 16:36

🍏 목적

MCP 서버, claude desktop을 사용해서 Unity 게임 개발에 도움을 받아보자

 

예를들면 특정 역할을 하는 gameObject를 만들어 달라고 할 수도 있고

파일 분석을 맡길 수도 있을 것이다.

 

🍏 사용한 MCP 서버

readme에 설치법 잘 설명되어 있으니 그거 참고해도된다.

https://github.com/CoderGamester/mcp-unity

 

GitHub - CoderGamester/mcp-unity: MCP Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude

MCP Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor) - CoderGamester/mcp-unity

github.com

 

 

🍏 사용하기

 

1️⃣ Unity에 "MCP Unity" 설치

Window → Package Manager → + 버튼 → Add package from git URL...

https://github.com/CoderGamester/mcp-unity.git

위의 링크 입력하여 설치

 

 

 

2️⃣ Node.js 설치

cmd에서 아래 명령어를 통해 설치 되었는지 확인. (node는 버전 18 이상이 필요)

node -v
npm -v

설치 되어 있지 않으면 설치 필요

 

3️⃣ "MCP Unity" 서버 실행

🔷 Tools → MCP Unity → Server Window

 

🔷 "MCP Unity"에서 Start Server로 서버를 실행한다.

그리고 Copy to Clipboard를 눌러 아래의 코드들을 복사해두자.

 

 

4️⃣ Claude Desktop과 연결

🔷 Claude Desktop설치

https://claude.ai/download

 

🔷 파일 → 설정 → 개발자 → 설정 편집

 

🔷 claude_desktop_config.json에 들어간다.

 

아까 복사해 두었던 코드를 아래와 같이 입력한다.

여러개를 입력할 수도 있고 처음 들어갔을 경우 {} 만 있다면 그냥 통째로 복붙해도 된다. 

 
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:/"
      ]
    },
    "mcp-unity": {
      "command": "node",
      "args": [
        "C:/"
      ]
    }
  }
}

 

🔷 Claude를 완전히 종료했다가 다시 실행한다.

그냥 종료가 아니라 작업 관리자에서 "작업 끝내기" 를 눌러서 완전히 종료시켜야한다.

재실행시 망치 모양이 있으면 잘 된 것!

 

 

5️⃣ 사용 Test

MCP Unity Server가 실행되고 있는 상태에서 예시로 아래와 같이 명령어를 보내보면

실제로 Cube GameObject가 생성되는 것을 볼 수 있다 우와!