# How to Handle Dependencies with Unity MCP: Complete Setup and Detection Guide

> Master Unity MCP dependency handling with our setup and detection guide. Learn how DependencyManager streamlines installations and validation for your projects.

- Repository: [Coplay/unity-mcp](https://github.com/CoplayDev/unity-mcp)
- Tags: how-to-guide
- Published: 2026-07-07

---

**Unity MCP handles external dependencies through a centralized `DependencyManager` that automatically detects your platform, validates Python 3.10+ and uv installations, and surfaces installation instructions in the Editor UI.**

The Unity MCP (Model Context Protocol) package requires specific external tooling to bridge AI assistants with the Unity Editor. According to the CoplayDev/unity-mcp source code, the dependency handling logic lives in the `MCPForUnity/Editor/Dependencies` subsystem, which provides platform-aware detection and user-friendly setup workflows without requiring manual configuration files.

## How the Dependency Manager Orchestrates Checks

The dependency resolution process follows a six-step pipeline orchestrated by [[`DependencyManager.cs`](https://github.com/CoplayDev/unity-mcp/blob/main/DependencyManager.cs)](https://github.com/CoplayDev/unity-mcp/blob/beta/MCPForUnity/Editor/Dependencies/DependencyManager.cs):

1. **Platform Detection** – `GetCurrentPlatformDetector()` selects the first `IPlatformDetector` that returns `true` for `CanDetect`, choosing from Windows, macOS, or Linux implementations in [`MCPForUnity/Editor/Dependencies/PlatformDetectors/`](https://github.com/CoplayDev/unity-mcp/tree/beta/MCPForUnity/Editor/Dependencies/PlatformDetectors).

2. **Tool Validation** – The selected detector executes `DetectPython()` and `DetectUv()` to locate Python 3.10+ and the uv package manager, returning a `DependencyStatus` object for each tool containing version, path, and availability data.

3. **Result Aggregation** – All `DependencyStatus` objects are compiled into a `DependencyCheckResult` (defined in [[`DependencyCheckResult.cs`](https://github.com/CoplayDev/unity-mcp/blob/main/DependencyCheckResult.cs)](https://github.com/CoplayDev/unity-mcp/blob/beta/MCPForUnity/Editor/Dependencies/Models/DependencyCheckResult.cs)), which generates a human-readable `Summary` and a list of `RecommendedActions`.

4. **UI Presentation** – The `MCPSetupWindow` reads the result and renders a checklist interface (defined in [`MCPSetupWindow.uxml`](https://github.com/CoplayDev/unity-mcp/blob/beta/MCPForUnity/Editor/Windows/MCPSetupWindow.uxml)) that displays missing dependencies with direct installation links.

5. **Auto-Installation** – For the MCP Server component itself, the manager reports that it "will be installed automatically when needed," eliminating manual server setup.

6. **Re-Validation** – After installing missing tools, calling `CheckAllDependencies()` again updates the `IsSystemReady` flag to verify the system state.

## Platform-Specific Detection Logic

Each platform detector implements `IPlatformDetector` with OS-specific heuristics to locate binaries without requiring external dependencies:

### Windows Detection

The [[`WindowsPlatformDetector.cs`](https://github.com/CoplayDev/unity-mcp/blob/main/WindowsPlatformDetector.cs)](https://github.com/CoplayDev/unity-mcp/blob/beta/MCPForUnity/Editor/Dependencies/PlatformDetectors/WindowsPlatformDetector.cs) searches for `python.exe` on the system `PATH` and validates the existence of `uv.exe` in standard installation directories.

### macOS and Linux Detection

macOS and Linux detectors use `which python3` and `which uv` shell commands to locate binaries, with Linux specifically checking `/usr/bin` and `/usr/local/bin` for package manager installations.

All detectors rely solely on standard .NET APIs and `System.Runtime.InteropServices.RuntimeInformation`, ensuring they function without additional NuGet packages or native plugins.

## Checking Dependencies Programmatically

You can interact with the dependency system from custom Editor scripts to validate the environment before running MCP workflows.

### Running a Full Dependency Check

Use `DependencyManager.CheckAllDependencies()` to validate the entire toolchain and log specific missing components:

```csharp
using MCPForUnity.Editor.Dependencies;

var result = DependencyManager.CheckAllDependencies();

Debug.Log(result.Summary);
if (!result.IsSystemReady)
{
    foreach (var action in result.RecommendedActions)
    {
        Debug.LogWarning($"Required action: {action}");
    }
}

```

This method returns a `DependencyCheckResult` containing the `IsSystemReady` boolean and aggregated status for all required tools.

### Launching the Setup Window

To present the graphical dependency checklist to users, invoke the `MCPSetupWindow` class:

```csharp
using MCPForUnity.Editor.Windows;

// Opens the Local Setup Window with current check results
MCPSetupWindow.ShowWindow();

```

This window calls `DependencyManager.CheckAllDependencies()` internally and renders the results using the `dependency-list` UI component defined in the UXML template.

### Retrieving Installation URLs

For custom UI elements or automated documentation, fetch the official download URLs:

```csharp
var (pythonUrl, uvUrl) = DependencyManager.GetInstallationUrls();

Debug.Log($"Download Python from: {pythonUrl}");
Debug.Log($"Download uv from: {uvUrl}");

```

The `GetInstallationUrls()` method (lines 95-104 in [[`DependencyManager.cs`](https://github.com/CoplayDev/unity-mcp/blob/main/DependencyManager.cs)](https://github.com/CoplayDev/unity-mcp/blob/beta/MCPForUnity/Editor/Dependencies/DependencyManager.cs)) returns platform-appropriate download links for the missing dependencies.

### Validating Dependencies in CI/CD

For automated build pipelines, programmatically fail the build if required dependencies are missing:

```csharp
var result = DependencyManager.CheckAllDependencies();
var missing = result.GetMissingRequired();

if (missing.Count > 0)
{
    throw new BuildFailedException(
        $"Missing MCP dependencies: {string.Join(", ", missing.Select(m => m.Name))}\n" +
        $"Actions required: {string.Join("\n", result.RecommendedActions)}"
    );
}

```

The `GetMissingRequired()` method filters the dependency list to return only items marked as required but not available on the system.

## Understanding the Data Models

The dependency system uses two primary data structures defined in [`MCPForUnity/Editor/Dependencies/Models/`](https://github.com/CoplayDev/unity-mcp/tree/beta/MCPForUnity/Editor/Dependencies/Models/):

**`DependencyStatus`** – Represents a single external tool with properties for `Name`, `IsAvailable`, `Version`, `InstallPath`, and `ErrorMessage`.

**`DependencyCheckResult`** – Aggregates multiple `DependencyStatus` objects and provides helper methods like `GetMissingRequired()` and `GetMissingOptional()` to filter results by severity.

## Summary

- **Unity MCP** requires Python 3.10+ and the uv package manager to function as an AI bridge.
- The **`DependencyManager`** class in [`MCPForUnity/Editor/Dependencies/DependencyManager.cs`](https://github.com/CoplayDev/unity-mcp/blob/main/MCPForUnity/Editor/Dependencies/DependencyManager.cs) orchestrates platform detection and validation.
- **Platform detectors** in `MCPForUnity/Editor/Dependencies/PlatformDetectors/` implement OS-specific logic for locating binaries without external dependencies.
- Use **`CheckAllDependencies()`** to programmatically validate the environment and retrieve actionable recommendations.
- The **`MCPSetupWindow`** provides a built-in UI for visualizing missing dependencies and accessing installation URLs.
- The **`DependencyCheckResult`** model offers `IsSystemReady` and `GetMissingRequired()` for automated validation in CI/CD pipelines.

## Frequently Asked Questions

### What dependencies are required for Unity MCP to function?

Unity MCP requires **Python 3.10 or higher** and the **uv** package manager (a fast Python package installer). The `DependencyManager` validates these through `DetectPython()` and `DetectUv()` methods. The MCP Server itself is installed automatically when needed, so you only need to ensure Python and uv are present on your system.

### How can I check if my system is ready without opening the Unity Editor?

You can run dependency checks from any Editor script using `DependencyManager.CheckAllDependencies()`. This method returns a `DependencyCheckResult` with an `IsSystemReady` property that returns `true` only when all required dependencies (Python and uv) are detected and meet version requirements.

### Can I automate dependency validation in my build pipeline?

Yes. Use the `GetMissingRequired()` method on the `DependencyCheckResult` object to identify critical missing tools. If the returned list contains any items, you can fail the build before attempting to initialize MCP connections. This is useful for CI/CD environments where you want to validate the environment before running automated tests.

### What happens if I install Python but the setup window still shows it as missing?

The platform detectors cache results during the current editor session. After installing Python or uv, click the refresh button in the `MCPSetupWindow` or manually call `DependencyManager.CheckAllDependencies()` again to re-run the detection logic. The `WindowsPlatformDetector` (and other platform implementations) will then scan the updated PATH and registry to locate the newly installed binaries.