Skip to content

Conversation

@msanatan
Copy link
Contributor

@msanatan msanatan commented Oct 22, 2025

This way, we don't have to bundle the server for people to use it. No need for downloading either

Summary by CodeRabbit

  • Release Process

    • Simplified GitHub release generation with auto-generated release notes
  • Installation & Configuration

    • Added executable entry point for direct server operation
    • Expanded package distribution to include additional modules and resources
    • Enhanced version detection across release and development environments

@msanatan msanatan self-assigned this Oct 22, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

This PR restructures the MCP for Unity project's packaging, distribution, and initialization pipeline. It simplifies the CI/CD release workflow, consolidates distributed modules into the package configuration, introduces a public entry point function for the server, and enhances telemetry with resilient version lookup.

Changes

Cohort / File(s) Summary
CI/CD Workflow Simplification
.github/workflows/bump-version.yml
Consolidated two steps (packaging and release creation) into a single create release step using auto-generated notes; removed explicit server artifact packaging and storage.
Package Distribution Configuration
MCPForUnity/UnityMcpServer~/src/pyproject.toml
Added executable entry point mcp-for-unity = "server:main", expanded py-modules list from 3 to 9 modules, and packages list from 1 to 3 packages (added "resources" and "registry").
Server Entry Point
MCPForUnity/UnityMcpServer~/src/server.py
Introduced new public main() function wrapping mcp.run(transport='stdio') and updated __main__ entry to invoke the new entry point.
Telemetry Resilience
MCPForUnity/UnityMcpServer~/src/telemetry.py
Refined import specificity (importing import_module and metadata directly), implemented multi-stage version lookup with fallback from installed package metadata to pyproject.toml file reading, defaulting to "unknown" on failure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes span multiple concerns (CI/CD, packaging, entry points, resilience logic) with varying complexity. While most modifications are straightforward configuration or simple wrapping, the telemetry version lookup adds conditional fallback logic requiring careful verification of error handling and development scenario coverage.

Possibly related PRs

Poem

🐰 The scripts now hop with unified grace,
Entry points clean up the launching place,
Versions resilient through fallback tracks,
Package and release—no artifacts packed!
A tidy refactor, swift and precise.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Allow the MCP server to be run by uvx remotely" accurately describes the main objective of the changeset. The modifications directly support this goal: adding a public entry point script in pyproject.toml, creating a main() function in server.py to serve as the executable entry point, expanding the packaged modules and distributions, improving version detection robustness for remote execution, and simplifying the release workflow. The title is specific, clear, and concise—someone scanning the repository history would immediately understand that this change enables remote execution of the MCP server via uvx without requiring downloads or bundling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3e5485 and 4638877.

📒 Files selected for processing (4)
  • .github/workflows/bump-version.yml (2 hunks)
  • MCPForUnity/UnityMcpServer~/src/pyproject.toml (1 hunks)
  • MCPForUnity/UnityMcpServer~/src/server.py (1 hunks)
  • MCPForUnity/UnityMcpServer~/src/telemetry.py (3 hunks)
🧰 Additional context used
🪛 Ruff (0.14.1)
MCPForUnity/UnityMcpServer~/src/telemetry.py

48-48: Do not catch blind exception: Exception

(BLE001)


55-55: Do not catch blind exception: Exception

(BLE001)

🔇 Additional comments (8)
MCPForUnity/UnityMcpServer~/src/server.py (2)

192-194: LGTM!

The main() function properly exposes the server as a console script entry point for uvx execution, aligning with the PR objective.


198-199: LGTM!

The __main__ block correctly delegates to the new main() entry point, maintaining backward compatibility.

MCPForUnity/UnityMcpServer~/src/telemetry.py (3)

13-13: LGTM!

More specific imports improve code clarity and explicitly show the required importlib functionality.


39-56: LGTM! Resilient version lookup strategy.

The multi-path version lookup correctly handles both installed packages (via uvx) and development scenarios (git clone). The fallback chain ensures telemetry remains functional even if version detection fails.

Note: The blind exception catching flagged by static analysis is intentional and appropriate here for defensive coding.


113-113: LGTM!

Correctly uses the imported import_module function, consistent with the updated imports.

MCPForUnity/UnityMcpServer~/src/pyproject.toml (3)

20-21: LGTM! Console script entry point correctly configured.

The mcp-for-unity entry point properly targets the main() function in server.py, enabling uvx distribution as intended.


28-38: All py-modules verified to exist.

All 9 modules listed in py-modules are present as .py files in the source directory. The expanded list is accurate and properly configured for uvx distribution.


39-39: All package directories verified and properly configured.

The expanded packages list correctly includes tools, resources, and registry — all directories exist with required __init__.py files. The configuration is ready for distribution.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@msanatan msanatan merged commit 558f923 into CoplayDev:main Oct 22, 2025
1 check passed
@msanatan msanatan deleted the support-uvx branch October 22, 2025 21:36
choej2303 pushed a commit to choej2303/unity-mcp-ide that referenced this pull request Dec 13, 2025
* feat: add entry point script and additional Python modules to server package

Now we can run this server with `uvx`

* refactor: improve package version detection to support both installed and development environments

* refactor: simplify release workflow by removing server packaging step
This was referenced Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant