Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ EXPOSE 8080

ENV PYTHONPATH=/app/Server/src

CMD ["uv", "run", "python", "src/main.py", "--transport", "http", "--http-host", "0.0.0.0", "--http-port", "8080"]
# ENTRYPOINT allows override via docker run arguments
# Default: stdio transport (Docker MCP Gateway compatible)
# For HTTP: docker run -p 8080:8080 <image> --transport http --http-host 0.0.0.0 --http-port 8080
ENTRYPOINT ["uv", "run", "mcp-for-unity"]
CMD []
128 changes: 128 additions & 0 deletions docker/TEST_RESULTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Docker MCP Integration - Test Results

## Test Environment

| Component | Version/Status |
|-----------|---------------|
| Docker Desktop | Running |
| Unity Editor | 2022.3+ LTS |
| Python MCP Server | Container `unity-mcp-test` |
| Transport | HTTP (port 8080) |
Comment on lines +3 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, check the full TEST_RESULTS.md file
cat -n docker/TEST_RESULTS.md

Repository: CoplayDev/unity-mcp

Length of output: 3241


🏁 Script executed:

# Check the git log to understand the PR context
git log --oneline -10

Repository: CoplayDev/unity-mcp

Length of output: 142


🏁 Script executed:

# Look for the PR title/message
git log -1 --format=fuller

Repository: CoplayDev/unity-mcp

Length of output: 679


🏁 Script executed:

# Search for stdio transport references in the codebase
rg -i "stdio" --type-list | head -20
rg -i "stdio" -A 3 -B 3

Repository: CoplayDev/unity-mcp

Length of output: 50785


🏁 Script executed:

# Check what files are in the docker directory
ls -la docker/

Repository: CoplayDev/unity-mcp

Length of output: 390


🏁 Script executed:

# Check if TEST_RESULTS.md is new in this commit
git show --stat 6ddd1f9 | grep -A 20 "docker/"

Repository: CoplayDev/unity-mcp

Length of output: 3562


🏁 Script executed:

# Check the Dockerfile to see what actually changed
git show 6ddd1f9:Server/Dockerfile | head -30

Repository: CoplayDev/unity-mcp

Length of output: 692


🏁 Script executed:

# Check if there are any stdio transport examples in the docker/ additions
git show 6ddd1f9 -- docker/

Repository: CoplayDev/unity-mcp

Length of output: 5189


TEST_RESULTS.md contradicts the PR's objective—document demonstrates HTTP transport while PR makes stdio the default.

This newly-added file shows only HTTP transport tests (curl to http://localhost:8080, POST to /mcp), but the PR is titled "make stdio transport default for Docker MCP Gateway compatibility" and the commit explicitly states stdio is required for Docker MCP Toolkit integration. The antigravity-mcp-config.example.json in the same directory correctly uses "type": "stdio", making the HTTP-only test results inconsistent with the PR's intent.

Either:

  1. Update TEST_RESULTS.md to demonstrate stdio transport (MCP over stdin/stdout) to validate the actual change, or
  2. Clearly label this as supplementary documentation of HTTP fallback capability and add separate stdio test verification.
🤖 Prompt for AI Agents
In @docker/TEST_RESULTS.md around lines 3 - 10, TEST_RESULTS.md currently
documents only HTTP transport which contradicts the PR goal of making stdio the
default; update TEST_RESULTS.md to either (A) replace or augment the HTTP
examples with stdio verification steps demonstrating MCP over stdin/stdout (show
how to run the gateway/container and send/receive via stdio), including a note
that antigravity-mcp-config.example.json uses "type": "stdio", or (B) explicitly
label the file as HTTP fallback documentation and add a separate section with
stdio test verification steps that reference the
antigravity-mcp-config.example.json "type": "stdio" configuration to validate
the PR change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add language specifiers to all fenced code blocks.

All 5 fenced code blocks lack language specifications, violating markdown lint rule MD040. Update each to specify the appropriate language:

  • Line 16: docker (docker ps output)
  • Line 66: json (event stream response)
  • Line 78: bash (docker logs output)
  • Line 94: text (plain text output)
  • Line 107: bash (log entries)
🔧 Proposed fixes for markdown linting
-```
+```docker
 NAMES                 STATUS          PORTS
-```
+```json
 event: message
-```
+```bash
 INFO: WebSocket /hub/plugin [accepted]
-```
+```text
 Sahne: TerminalScene
-```
+```bash
 INFO: 172.17.0.1 - "POST /mcp HTTP/1.1" 200 OK

Also applies to: 16-16, 66-66, 78-78, 94-94, 107-107

🤖 Prompt for AI Agents
In @docker/TEST_RESULTS.md at line 10, Update each of the five fenced code
blocks to include the correct language specifier: add ```docker for the docker
ps output block (NAMES STATUS PORTS), ```json for the event stream response
block (event: message), ```bash for the docker logs output block (INFO:
WebSocket /hub/plugin [accepted]), ```text for the plain text block (Sahne:
TerminalScene), and ```bash for the log entries block (INFO: 172.17.0.1 - "POST
/mcp HTTP/1.1" 200 OK) so the markdown conforms to MD040 and renders with proper
syntax highlighting.


---

## Test 1: Container Status

```
NAMES STATUS PORTS
unity-mcp-container Up 41 minutes 0.0.0.0:8080->8080/tcp
```

✅ **PASS** - Container running successfully

---

## Test 2: Health Check

**Request:**
```bash
curl http://localhost:8080/health
```

**Response:**
```json
{
"status": "healthy",
"timestamp": 1768045773.1821966,
"message": "MCP for Unity server is running"
}
```

✅ **PASS** - Server healthy

---

## Test 3: MCP Protocol Initialize

**Request:**
```bash
POST http://localhost:8080/mcp
Content-Type: application/json
Accept: application/json, text/event-stream

{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "test", "version": "1.0"}
},
"id": 1
}
```

**Response:**
```
event: message
data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05",...}}
```

✅ **PASS** - MCP protocol working

---

## Test 4: Unity WebSocket Connection

**Docker Logs:**
```
INFO: WebSocket /hub/plugin [accepted]
INFO: connection open
```

✅ **PASS** - Unity Editor connected via WebSocket

---

## Test 5: MCP Tool Execution (via Antigravity)

**Command:** "Unity sahnesinin adını söyle"

**Tool Called:** `manage_scene` (action: get_active)

**Result:**
```
Sahne: TerminalScene
Yol: Assets/Scenes/Terminal/TerminalScene.unity
Build Index: 0
Root GameObjects: 4
```

✅ **PASS** - Full end-to-end integration working

---

## Test 6: Container Logs - Request Summary

```
INFO: 172.17.0.1 - "POST /mcp HTTP/1.1" 200 OK
INFO: 172.17.0.1 - "POST /mcp HTTP/1.1" 200 OK
INFO: 172.17.0.1 - "GET /health HTTP/1.1" 200 OK
```

✅ **PASS** - All requests successful (200 OK)

---

## Summary

| Test | Result |
|------|--------|
| Container Status | ✅ PASS |
| Health Check | ✅ PASS |
| MCP Initialize | ✅ PASS |
| Unity WebSocket | ✅ PASS |
| MCP Tool Execution | ✅ PASS |
| Request Logs | ✅ PASS |

**All 6 tests passed. Docker integration is fully functional.**
13 changes: 13 additions & 0 deletions docker/antigravity-mcp-config.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"servers": {
"dockerMcp": {
"command": "docker",
"args": [
"mcp",
"gateway",
"run"
],
"type": "stdio"
}
}
}
Comment on lines +1 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Antigravity MCP configuration JSON schema servers type stdio command args

💡 Result:

Antigravity (and related MCP clients) accept a JSON servers/mcpServers object where each server entry for a local stdio server is specified with a command string, an args array, and optional env. Example schema + minimal example:

Schema (fields)

  • servers / mcpServers: object mapping server-name → server-config.
  • server-config:
    • type (optional in some clients; "stdio" for local stdio servers)
    • command: string (executable)
    • args: array of strings
    • env: object (map of env var → value)

Example JSON:
{
"mcpServers": {
"local-server": {
"type": "stdio",
"command": "/path/to/mcp-server-binary",
"args": ["--port","0","--token","$MCP_TOKEN"],
"env": { "MCP_TOKEN": "replace-with-token" }
}
}
}

Sources: Antigravity MCP JSON examples and docs (shows mcpServers/servers with command/args/env). [1][2]

References:
[1] Antigravity MCP JSON/config examples.
[2] MCPHub (mcpServers / VS Code servers format; local (stdio) server example).


🌐 Web query:

Antigravity MCP Gateway Docker integration configuration

💡 Result:

Below is a concise guide to integrating Antigravity (MCP-enabled client) with a Docker-run MCP Gateway/servers, plus a minimal example configuration you can drop into Antigravity’s mcp_config.json.

Key points

  • Antigravity accepts a local MCP server/gateway configured via mcp_config.json (commands/args/env). [1][2]
  • Docker’s MCP Gateway (docker mcp) can run as the central proxy; clients connect to the Gateway rather than individual servers. You can also run individual MCP servers directly as Docker containers and point Antigravity at them. [2][3]

Example: run Docker MCP Gateway and enable a server

  1. Enable a server (example: duckduckgo) and run the gateway with SSE transport:
  • docker mcp server enable duckduckgo
  • docker mcp gateway run --port 8080 --transport sse
    (These commands use the Docker MCP CLI described in Docker docs.) [2]
  1. Example mcp_config.json for Antigravity
    Replace placeholders (TOKENs, image names) with your values. Put this JSON into Antigravity → Manage MCP Servers → View raw config.

{
"mcpServers": {
"local-mcp-gateway": {
"command": "docker",
"args": [
"run",
"--rm",
"-p",
"8080:8080",
"--name",
"mcp-gateway",
"ghcr.io/docker/mcp-gateway:latest",
"--port",
"8080",
"--transport",
"sse"
],
"env": {}
},
"duckduckgo-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--name",
"mcp-duckduckgo",
"ghcr.io/docker/mcp-server-duckduckgo:latest"
],
"env": {}
}
}
}

Notes and options

  • Use docker mcp CLI (docker mcp server enable ) to install/manage servers instead of manually running containers when available; that integrates lifecycle with the Gateway. [2]
  • If your Gateway runs separately (e.g., on a host or Docker Desktop), point Antigravity’s client entry to the Gateway address/port instead of starting the Gateway via mcp_config.json. Antigravity will connect to the Gateway’s exposed SSE/websocket endpoint. [1][2]
  • For servers that require secrets, pass them via env in the mcp_config.json or use the docker mcp catalog/install workflows that support secure credential handling. [1][3]
  • If building a Streamlit or custom client, enable SSE transport and maintain a persistent client session (common pattern shown in community examples). [4]

References
[1] Antigravity MCP server docs / MCPJungle examples (includes mcp_config.json format and Antigravity instructions).
[2] Docker docs — MCP Gateway usage and docker mcp CLI.
[3] Antigravity / MCP catalog Docker server examples (GitHub/Supabase/GitHub examples).
[4] Community example (background worker + SSE) for integrating clients with a running Gateway.

Would you like: (A) a ready-to-run docker-compose.yml for the Gateway + one server, or (B) a tailored mcp_config.json for a specific MCP server (e.g., Supabase, GitHub, DuckDuckGo)?


🏁 Script executed:

# Search the repository for Antigravity-related documentation or examples
find . -type f \( -name "*.md" -o -name "*.json" -o -name "README*" \) | head -20

Repository: CoplayDev/unity-mcp

Length of output: 992


🏁 Script executed:

# Search for any references to Antigravity in the codebase
rg -i "antigravity" --type-list all -A 3 -B 3

Repository: CoplayDev/unity-mcp

Length of output: 452


🏁 Script executed:

# Check if there are other config examples or schemas in the repo
fd -e json -e schema -e example | grep -i config

Repository: CoplayDev/unity-mcp

Length of output: 131


🏁 Script executed:

cat -n docker/antigravity-mcp-config.example.json

Repository: CoplayDev/unity-mcp

Length of output: 383


🏁 Script executed:

# Check if there are any docs in the docker directory
ls -la docker/

Repository: CoplayDev/unity-mcp

Length of output: 320


🏁 Script executed:

# Search for any documentation about config format
rg -i "antigravity\|mcpServers\|mcp config" -A 5 -B 2

Repository: CoplayDev/unity-mcp

Length of output: 45


Fix schema key and Docker command syntax — this config is invalid as written.

Root key must be "mcpServers", not "servers" per Antigravity's schema. Additionally, the args array ["mcp", "gateway", "run"] is not valid Docker syntax; docker does not accept mcp as a subcommand in that position.

Use the proper Docker image and arguments instead:

{
  "mcpServers": {
    "dockerMcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-p",
        "8080:8080",
        "ghcr.io/docker/mcp-gateway:latest",
        "--port",
        "8080",
        "--transport",
        "sse"
      ],
      "type": "stdio"
    }
  }
}

Alternatively, if using Docker Desktop's docker mcp CLI tool, that is a separate executable and would require a different command value. Verify which approach is intended for this project.

🤖 Prompt for AI Agents
In @docker/antigravity-mcp-config.example.json around lines 1 - 13, The JSON
uses the wrong top-level key and invalid Docker args: replace the "servers" root
key with "mcpServers" and update the "dockerMcp" entry (command "docker", args
array) to use a proper docker run invocation (e.g., start with "run", include
options like "--rm", "-p", the image name such as
"ghcr.io/docker/mcp-gateway:latest", and any container flags like "--port" and
"--transport") or, if you intend to call a separate CLI binary, change the
"command" from "docker" to that executable; ensure the "dockerMcp" object
retains "type": "stdio".

44 changes: 44 additions & 0 deletions docker/mcp-registry/server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: unity-mcp
image: mcp/unity-mcp
type: server
Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find the docker publish workflow mentioned in learnings
find . -name "*publish*docker*" -o -name "*docker*publish*" | head -20

Repository: CoplayDev/unity-mcp

Length of output: 95


🏁 Script executed:

# Also look for the mcp-registry directory structure and any schema docs
find . -path "*/docker/mcp-registry*" -type f | head -20

Repository: CoplayDev/unity-mcp

Length of output: 96


🏁 Script executed:

# Search for references to the image name in the codebase
rg "mcp/unity-mcp|msanatan.*mcp" --type yaml --type md

Repository: CoplayDev/unity-mcp

Length of output: 774


🏁 Script executed:

# Check if there's any docker build or publish configuration
find . -name "Dockerfile*" -o -name "docker-compose*" | head -20

Repository: CoplayDev/unity-mcp

Length of output: 103


🏁 Script executed:

# Check the publish docker action to see what image name it actually pushes
cat -n ./.github/actions/publish-docker/action.yml

Repository: CoplayDev/unity-mcp

Length of output: 4819


🏁 Script executed:

# Check the Server Dockerfile for image configuration
head -50 ./Server/Dockerfile

Repository: CoplayDev/unity-mcp

Length of output: 884


🏁 Script executed:

# Look for any docker build or push commands in workflows
find ./.github/workflows -name "*.yml" -o -name "*.yaml" | xargs grep -l "docker" | head -5

Repository: CoplayDev/unity-mcp

Length of output: 223


🏁 Script executed:

# Get the full content of the publish docker workflow action
cat -n ./.github/actions/publish-docker/action.yml

Repository: CoplayDev/unity-mcp

Length of output: 4819


🏁 Script executed:

# Find where the publish-docker action is called
rg "publish-docker" --type yaml -A 5 -B 2

Repository: CoplayDev/unity-mcp

Length of output: 45


🏁 Script executed:

# Also check the release workflow specifically
cat -n ./.github/workflows/release.yml

Repository: CoplayDev/unity-mcp

Length of output: 6536


🏁 Script executed:

# Check what the entire server.yaml file contains
cat -n ./docker/mcp-registry/server.yaml

Repository: CoplayDev/unity-mcp

Length of output: 1667


🏁 Script executed:

# Search for documentation about mcp-registry or Docker MCP format
find . -name "*mcp*registry*" -o -name "*registry*" | grep -i mcp

Repository: CoplayDev/unity-mcp

Length of output: 84


🌐 Web query:

Docker MCP Registry manifest specification image field requirements

💡 Result:

Short answer — in Docker's MCP registry/catalog the top-level image field must be a Docker image reference (string). Recommended/expected rules:

  • Required top-level string field named image. Use a valid Docker image reference (repository/name, with optional tag or digest). [1][2]
  • Prefer a content-addressable reference (repository@sha256:) to pin the exact artifact. Docker examples and guidance use digest form such as mcp/duckduckgo@sha256:... . [2]
  • For Docker-built MCP entries the image normally lives in the mcp/ namespace (mcp/), but self-hosted/pre-built images may point to other registries. [1][3]
  • The image value must be a pullable image (i.e., registry + repo + tag or digest) so the MCP tooling/gateway can docker pull it. [2][3]

Sources: Docker MCP registry repo and docs (registry catalog/CONTRIBUTING), Docker blog/catalog examples. [1][2][3]

References
[1] docker/mcp-registry (GitHub) — catalog/registry guidance.
[2] Docker blog "Build a Custom MCP Catalog" (example using mcp/...@sha256).
[3] MCP catalog/configuration reference (image field described).


🏁 Script executed:

# Get the exact image name with any tag/digest used in actual publishing
git log --oneline -20 --grep="docker\|Docker" -- '.github/workflows/release.yml' 2>/dev/null || echo "No recent changes"

Repository: CoplayDev/unity-mcp

Length of output: 142


🏁 Script executed:

# Check if there are any other references to the image name in config or docs
rg "mcp/unity-mcp|mcp-for-unity-server" --type md --type txt --type json

Repository: CoplayDev/unity-mcp

Length of output: 721


Change image: mcp/unity-mcp to image: msanatan/mcp-for-unity-server.

The manifest references mcp/unity-mcp, but the repository actually publishes to msanatan/mcp-for-unity-server (as configured in .github/workflows/release.yml and documented in Server/DOCKER_OVERVIEW.md). The MCP registry will fail to pull a non-existent image. Update the manifest to point to the actual published image. Consider also pinning to a content-addressable digest for immutability.

🤖 Prompt for AI Agents
In @docker/mcp-registry/server.yaml around lines 1 - 3, Update the Kubernetes
manifest entry that currently sets image: mcp/unity-mcp to the actual published
image image: msanatan/mcp-for-unity-server so the registry can pull it; locate
the YAML key "image: mcp/unity-mcp" in the manifest and replace the value
accordingly, and optionally pin to a content-addressable digest (sha256:...) for
immutability if you have the digest from the release workflow.

meta:
category: gamedev
tags:
- unity
- gamedev
- automation
- ai
- game-engine
about:
title: MCP for Unity
description: |
Control Unity Editor through AI assistants like Claude, Cursor, and VS Code Copilot.
Create scenes, manage assets, execute scripts, and automate workflows using natural language.

Features:
- Manage GameObjects, scenes, materials, and assets
- Execute scripts and menu items
- Run tests and read console output
- Support for multiple Unity instances
icon: https://raw.githubusercontent.com/CoplayDev/unity-mcp/main/docs/images/logo.png
source:
project: https://github.com/CoplayDev/unity-mcp
commit: 4c9beaffdefadee03c07f00eb3e3b6c5294fc99d
Comment on lines +24 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Docker MCP Registry manifest specification source commit field required

💡 Result:

Short answer: source.commit is optional (not required). The registry's Go type marks Commit as omitempty, and the registry uses it as a commit pin when present (there are automated workflows to keep pins updated). [1][2]

Sources:

  • docker/mcp-registry Go types (Source.Commit is optional / has omitempty). [1]
  • Article describing commit-pin usage and update workflow for Docker's MCP registry. [2]

source.commit is optional; confirm whether automated updates are in place or if it should be omitted.
The Docker MCP Registry supports commit pins via automated workflows to prevent staleness. If not using automation to update this pin, consider omitting the field entirely.

🤖 Prompt for AI Agents
In @docker/mcp-registry/server.yaml around lines 24 - 26, The YAML currently
pins source.commit (symbol: source.commit) which is optional — either
enable/verify an automated update workflow that refreshes that commit pin for
project (symbol: source.project or the repo URL) and document the automation, or
remove the source.commit field entirely so the registry tracks the repo HEAD;
update the manifest by deleting the commit entry if you don't have automation,
or keep it but wire/confirm the automation that updates it.

config:
description: Configure Unity MCP Server connection settings
env:
- name: DISABLE_TELEMETRY
example: "true"
value: "{{unity-mcp.disable_telemetry}}"
- name: LOG_LEVEL
example: "INFO"
value: "{{unity-mcp.log_level}}"
parameters:
type: object
properties:
disable_telemetry:
type: string
description: Disable anonymous telemetry (true/false)
log_level:
type: string
description: Logging level (DEBUG, INFO, WARNING, ERROR)
Comment on lines +39 to +44
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using more specific types/enums for config parameters instead of free-form strings.

disable_telemetry and log_level are declared as plain strings but only accept specific values. If supported by the MCP registry schema, consider:

  • disable_telemetry: type: boolean instead of a "true/false" string.
  • log_level: type: string with an explicit enum: [DEBUG, INFO, WARNING, ERROR].

This tightens validation and makes valid values clearer to clients.