diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml new file mode 100644 index 0000000..7eeb7f8 --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,47 @@ +name: Publish Docker image 🐳 + +on: + push: + tags: + - "*" + workflow_dispatch: +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v6 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.DOCKER_USERNAME }}/mcp-for-unity-server + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=ref,event=branch + type=sha + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: Server/Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 45bb249..3ddcd0d 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,6 +1,10 @@ -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI +name: Publish Python 🐍 distribution 📦 to PyPI -on: push +on: + push: + tags: + - "*" + workflow_dispatch: jobs: build: @@ -32,7 +36,6 @@ jobs: publish-to-pypi: name: >- Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes needs: - build runs-on: ubuntu-latest @@ -50,27 +53,3 @@ jobs: path: dist/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - - publish-to-testpypi: - name: Publish Python 🐍 distribution 📦 to TestPyPI - needs: - - build - runs-on: ubuntu-latest - - environment: - name: testpypi - url: https://test.pypi.org/p/mcpforunityserver - - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: Download all the dists - uses: actions/download-artifact@v7 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ diff --git a/Server/DOCKER_OVERVIEW.md b/Server/DOCKER_OVERVIEW.md new file mode 100644 index 0000000..303ff56 --- /dev/null +++ b/Server/DOCKER_OVERVIEW.md @@ -0,0 +1,88 @@ +# MCP for Unity Server (Docker Image) + +[![MCP](https://badge.mcpx.dev?status=on 'MCP Enabled')](https://modelcontextprotocol.io/introduction) +[![License](https://img.shields.io/badge/License-MIT-red.svg 'MIT License')](https://opensource.org/licenses/MIT) +[![Discord](https://img.shields.io/badge/discord-join-red.svg?logo=discord&logoColor=white)](https://discord.gg/y4p8KfzrN4) + +Model Context Protocol server for Unity Editor integration. Control Unity through natural language using AI assistants like Claude, Cursor, and more. + +**Maintained by [Coplay](https://www.coplay.dev/?ref=unity-mcp)** - This project is not affiliated with Unity Technologies. + +💬 **Join our community:** [Discord Server](https://discord.gg/y4p8KfzrN4) + +**Required:** Install the [Unity MCP Plugin](https://github.com/CoplayDev/unity-mcp?tab=readme-ov-file#-step-1-install-the-unity-package) to connect Unity Editor with this MCP server. + +--- + +## Quick Start + +### 1. Pull the image + +```bash +docker pull msanatan/mcp-for-unity-server:latest +``` + +### 2. Run the server + +```bash +docker run -p 8080:8080 msanatan/mcp-for-unity-server:latest +``` + +This starts the MCP server on port 8080. + +### 3. Configure your MCP Client + +Add the following configuration to your MCP client (e.g., Claude Desktop config, Cursor settings): + +```json +{ + "mcpServers": { + "UnityMCP": { + "url": "http://localhost:8080/mcp" + } + } +} +``` + +--- + +## Configuration + +The server connects to the Unity Editor automatically when both are running. No additional configuration is needed. + +**Environment Variables:** + +- `DISABLE_TELEMETRY=true` - Opt out of anonymous usage analytics +- `LOG_LEVEL=DEBUG` - Enable detailed logging (default: INFO) + +Example running with environment variables: + +```bash +docker run -p 8080:8080 -e LOG_LEVEL=DEBUG msanatan/mcp-for-unity-server:latest +``` + +--- + +## 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, please visit the GitHub repository: + +📖 **[Full Documentation](https://github.com/CoplayDev/unity-mcp#readme)** + +--- + +## License + +MIT License - See [LICENSE](https://github.com/CoplayDev/unity-mcp/blob/main/LICENSE)