Skip to content

Commit 6ddd1f9

Browse files
committed
feat: make stdio transport default for Docker MCP Gateway compatibility
- Changed Dockerfile CMD to use stdio transport by default - Added docker/ directory with MCP Registry server.yaml and Antigravity config example - stdio is required for Docker MCP Toolkit integration - HTTP transport still available via: --transport http --http-host 0.0.0.0 --http-port 8080
1 parent 4c9beaf commit 6ddd1f9

File tree

4 files changed

+190
-1
lines changed

4 files changed

+190
-1
lines changed

Server/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ EXPOSE 8080
2828

2929
ENV PYTHONPATH=/app/Server/src
3030

31-
CMD ["uv", "run", "python", "src/main.py", "--transport", "http", "--http-host", "0.0.0.0", "--http-port", "8080"]
31+
# ENTRYPOINT allows override via docker run arguments
32+
# Default: stdio transport (Docker MCP Gateway compatible)
33+
# For HTTP: docker run -p 8080:8080 <image> --transport http --http-host 0.0.0.0 --http-port 8080
34+
ENTRYPOINT ["uv", "run", "mcp-for-unity"]
35+
CMD []

docker/TEST_RESULTS.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Docker MCP Integration - Test Results
2+
3+
## Test Environment
4+
5+
| Component | Version/Status |
6+
|-----------|---------------|
7+
| Docker Desktop | Running |
8+
| Unity Editor | 2022.3+ LTS |
9+
| Python MCP Server | Container `unity-mcp-test` |
10+
| Transport | HTTP (port 8080) |
11+
12+
---
13+
14+
## Test 1: Container Status
15+
16+
```
17+
NAMES STATUS PORTS
18+
unity-mcp-container Up 41 minutes 0.0.0.0:8080->8080/tcp
19+
```
20+
21+
**PASS** - Container running successfully
22+
23+
---
24+
25+
## Test 2: Health Check
26+
27+
**Request:**
28+
```bash
29+
curl http://localhost:8080/health
30+
```
31+
32+
**Response:**
33+
```json
34+
{
35+
"status": "healthy",
36+
"timestamp": 1768045773.1821966,
37+
"message": "MCP for Unity server is running"
38+
}
39+
```
40+
41+
**PASS** - Server healthy
42+
43+
---
44+
45+
## Test 3: MCP Protocol Initialize
46+
47+
**Request:**
48+
```bash
49+
POST http://localhost:8080/mcp
50+
Content-Type: application/json
51+
Accept: application/json, text/event-stream
52+
53+
{
54+
"jsonrpc": "2.0",
55+
"method": "initialize",
56+
"params": {
57+
"protocolVersion": "2024-11-05",
58+
"capabilities": {},
59+
"clientInfo": {"name": "test", "version": "1.0"}
60+
},
61+
"id": 1
62+
}
63+
```
64+
65+
**Response:**
66+
```
67+
event: message
68+
data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05",...}}
69+
```
70+
71+
**PASS** - MCP protocol working
72+
73+
---
74+
75+
## Test 4: Unity WebSocket Connection
76+
77+
**Docker Logs:**
78+
```
79+
INFO: WebSocket /hub/plugin [accepted]
80+
INFO: connection open
81+
```
82+
83+
**PASS** - Unity Editor connected via WebSocket
84+
85+
---
86+
87+
## Test 5: MCP Tool Execution (via Antigravity)
88+
89+
**Command:** "Unity sahnesinin adını söyle"
90+
91+
**Tool Called:** `manage_scene` (action: get_active)
92+
93+
**Result:**
94+
```
95+
Sahne: TerminalScene
96+
Yol: Assets/Scenes/Terminal/TerminalScene.unity
97+
Build Index: 0
98+
Root GameObjects: 4
99+
```
100+
101+
**PASS** - Full end-to-end integration working
102+
103+
---
104+
105+
## Test 6: Container Logs - Request Summary
106+
107+
```
108+
INFO: 172.17.0.1 - "POST /mcp HTTP/1.1" 200 OK
109+
INFO: 172.17.0.1 - "POST /mcp HTTP/1.1" 200 OK
110+
INFO: 172.17.0.1 - "GET /health HTTP/1.1" 200 OK
111+
```
112+
113+
**PASS** - All requests successful (200 OK)
114+
115+
---
116+
117+
## Summary
118+
119+
| Test | Result |
120+
|------|--------|
121+
| Container Status | ✅ PASS |
122+
| Health Check | ✅ PASS |
123+
| MCP Initialize | ✅ PASS |
124+
| Unity WebSocket | ✅ PASS |
125+
| MCP Tool Execution | ✅ PASS |
126+
| Request Logs | ✅ PASS |
127+
128+
**All 6 tests passed. Docker integration is fully functional.**
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"servers": {
3+
"dockerMcp": {
4+
"command": "docker",
5+
"args": [
6+
"mcp",
7+
"gateway",
8+
"run"
9+
],
10+
"type": "stdio"
11+
}
12+
}
13+
}

docker/mcp-registry/server.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: unity-mcp
2+
image: mcp/unity-mcp
3+
type: server
4+
meta:
5+
category: gamedev
6+
tags:
7+
- unity
8+
- gamedev
9+
- automation
10+
- ai
11+
- game-engine
12+
about:
13+
title: MCP for Unity
14+
description: |
15+
Control Unity Editor through AI assistants like Claude, Cursor, and VS Code Copilot.
16+
Create scenes, manage assets, execute scripts, and automate workflows using natural language.
17+
18+
Features:
19+
- Manage GameObjects, scenes, materials, and assets
20+
- Execute scripts and menu items
21+
- Run tests and read console output
22+
- Support for multiple Unity instances
23+
icon: https://raw.githubusercontent.com/CoplayDev/unity-mcp/main/docs/images/logo.png
24+
source:
25+
project: https://github.com/CoplayDev/unity-mcp
26+
commit: 4c9beaffdefadee03c07f00eb3e3b6c5294fc99d
27+
config:
28+
description: Configure Unity MCP Server connection settings
29+
env:
30+
- name: DISABLE_TELEMETRY
31+
example: "true"
32+
value: "{{unity-mcp.disable_telemetry}}"
33+
- name: LOG_LEVEL
34+
example: "INFO"
35+
value: "{{unity-mcp.log_level}}"
36+
parameters:
37+
type: object
38+
properties:
39+
disable_telemetry:
40+
type: string
41+
description: Disable anonymous telemetry (true/false)
42+
log_level:
43+
type: string
44+
description: Logging level (DEBUG, INFO, WARNING, ERROR)

0 commit comments

Comments
 (0)