Skip to content
Merged
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
76 changes: 76 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./Server

steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: true
cache-dependency-glob: "Server/uv.lock"

- name: Build a binary wheel and a source tarball
run: uv build

- name: Store the distribution packages
uses: actions/upload-artifact@v6
with:
name: python-package-distributions
path: Server/dist/
Comment on lines +26 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Artifact upload/download paths likely produce an extra nested directory, which will break gh-action-pypi-publish defaults.

upload-artifact preserves the Server/dist/ directory, but the publish jobs download into dist/ and rely on the default packages-dir: dist/. This will likely place wheels under dist/Server/dist/..., so gh-action-pypi-publish won’t see them.

To fix this, either:

  • upload with path: Server/dist/*, or
  • download into Server/dist/ and set packages-dir: Server/dist/ in the publish steps.


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
environment:
name: pypi
url: https://pypi.org/p/mcpforunityserver
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v7
with:
name: python-package-distributions
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/
21 changes: 21 additions & 0 deletions Server/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 CoplayDev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 29 additions & 1 deletion Server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
[project]
name = "MCPForUnityServer"
name = "mcpforunityserver"
version = "8.2.3"
description = "MCP for Unity Server: A Unity package for Unity Editor integration via the Model Context Protocol (MCP)."
readme = "README.md"
license = "MIT"
authors = [
{name = "Marcus Sanatan", email = "msanatan@gmail.com"},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dsarno @Scriptwonder is it OK to list you all as authors here?

{name = "David Sarno", email = "david.sarno@gmail.com"},
{name = "Wu Shutong", email = "martinwfire@gmail.com"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Games/Entertainment",
"Topic :: Software Development :: Code Generators",
]
keywords = ["mcp", "unity", "ai", "model context protocol", "gamedev", "unity3d", "automation", "llm", "agent"]
requires-python = ">=3.10"
dependencies = [
"httpx>=0.27.2",
Expand All @@ -20,6 +44,10 @@ dev = [
"pytest-asyncio>=0.23",
]

[project.urls]
Repository = "https://github.com/CoplayDev/unity-mcp.git"
Issues = "https://github.com/CoplayDev/unity-mcp/issues"

[project.scripts]
mcp-for-unity = "main:main"

Expand Down
4 changes: 2 additions & 2 deletions Server/src/core/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
HAS_HTTPX = False

logger = logging.getLogger("unity-mcp-telemetry")
PACKAGE_NAME = "MCPForUnityServer"
PACKAGE_NAME = "mcpforunityserver"


def _version_from_local_pyproject() -> str:
Expand All @@ -60,7 +60,7 @@ def _version_from_local_pyproject() -> str:
version = project_table.get("version") or poetry_table.get("version")
if version:
return version
raise FileNotFoundError("pyproject.toml not found for MCPForUnityServer")
raise FileNotFoundError("pyproject.toml not found for mcpforunityserver")


def get_package_version() -> str:
Expand Down