Skip to content

Commit 12e1b62

Browse files
authored
Publish to pypi (#466)
* Lowercase project name for server * Update metadata for project * Add GitHub Actions workflow for PyPI package publishing
1 parent df3a493 commit 12e1b62

File tree

4 files changed

+128
-3
lines changed

4 files changed

+128
-3
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
working-directory: ./Server
12+
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v7
18+
with:
19+
version: "latest"
20+
enable-cache: true
21+
cache-dependency-glob: "Server/uv.lock"
22+
23+
- name: Build a binary wheel and a source tarball
24+
run: uv build
25+
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v6
28+
with:
29+
name: python-package-distributions
30+
path: Server/dist/
31+
32+
publish-to-pypi:
33+
name: >-
34+
Publish Python 🐍 distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/mcpforunityserver
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v7
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution 📦 to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
publish-to-testpypi:
55+
name: Publish Python 🐍 distribution 📦 to TestPyPI
56+
needs:
57+
- build
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: testpypi
62+
url: https://test.pypi.org/p/mcpforunityserver
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v7
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to TestPyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/

Server/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 CoplayDev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Server/pyproject.toml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
[project]
2-
name = "MCPForUnityServer"
2+
name = "mcpforunityserver"
33
version = "8.2.3"
44
description = "MCP for Unity Server: A Unity package for Unity Editor integration via the Model Context Protocol (MCP)."
55
readme = "README.md"
6+
license = "MIT"
7+
authors = [
8+
{name = "Marcus Sanatan", email = "msanatan@gmail.com"},
9+
{name = "David Sarno", email = "david.sarno@gmail.com"},
10+
{name = "Wu Shutong", email = "martinwfire@gmail.com"}
11+
]
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Environment :: Console",
15+
"Intended Audience :: Developers",
16+
"Natural Language :: English",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
23+
"Programming Language :: Python :: Implementation :: CPython",
24+
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
25+
"Topic :: Software Development :: Libraries :: Python Modules",
26+
"Topic :: Games/Entertainment",
27+
"Topic :: Software Development :: Code Generators",
28+
]
29+
keywords = ["mcp", "unity", "ai", "model context protocol", "gamedev", "unity3d", "automation", "llm", "agent"]
630
requires-python = ">=3.10"
731
dependencies = [
832
"httpx>=0.27.2",
@@ -20,6 +44,10 @@ dev = [
2044
"pytest-asyncio>=0.23",
2145
]
2246

47+
[project.urls]
48+
Repository = "https://github.com/CoplayDev/unity-mcp.git"
49+
Issues = "https://github.com/CoplayDev/unity-mcp/issues"
50+
2351
[project.scripts]
2452
mcp-for-unity = "main:main"
2553

Server/src/core/telemetry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
HAS_HTTPX = False
3535

3636
logger = logging.getLogger("unity-mcp-telemetry")
37-
PACKAGE_NAME = "MCPForUnityServer"
37+
PACKAGE_NAME = "mcpforunityserver"
3838

3939

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

6565

6666
def get_package_version() -> str:

0 commit comments

Comments
 (0)