Logo van UnityNaturalMCP

UnityNaturalMCP

Community
notargs

UnityNaturalMCP is an MCP server implementation for Unity that aims for a "natural" user experience.

Uitgevernotargs
RepositoryUnityNaturalMCP
TaalC#
Forks
17
Sterren
163
Beschikbare tools
0
Transporttypestdio, streamable-http
Categorieën
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    UnityNaturalMCP biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    163 sterren en 17 forks in de gekoppelde repository.

UnityNaturalMCP

Stars Forks Ask DeepWiki

Unity .NET C# 9.0 GitHubCopilot ClaudeCode Cursor WSL2

日本語

UnityNaturalMCP is an MCP server implementation for Unity that aims for a "natural" user experience.

MCP tools defined in Unity C# can be used directly from MCP clients such as Claude Code, GitHub Copilot(VSCode) and Cursor.

[!WARNING] UnityNaturalMCP is still in the preview stage. It is usable in practice, but several feature additions are planned.

Features

  • Concise communication flow between Unity Editor and MCP clients
  • stdio/Streamable HTTP support
  • Implementation of extended MCP tool entirely written in C# using MCP C# SDK
  • ClaudeCode, GitHub Copilot(VSCode) and Cursor support

Requirements

  • Unity 6000.0 or later
  • Node.js 18.0.0 or later (if using mcp-stdio-to-streamable-http)

Architecture

or

UnityNaturalMCPServer

An MCP server implementation provided as a Unity Package that behaves as a Streamable HTTP server.

Clients that support Streamable HTTP, such as Github Copilot(VSCode), can communicate directly with Unity Editor through this server.

mcp-stdio-to-streamable-http

mcp-stdio-to-streamable-http

A Node.js-based stdio MCP server that relays communication between MCP clients and Unity.

Some MCP clients, such as Cursor, do not support Streamable HTTP as of June 23, 2025.

By bypassing stdio input to Streamable HTTP, it enables communication between UnityNaturalMCPServer and MCP clients.

UnityNaturalMCPTest

A Unity project for functional verification and as a sample.

MCP Tools

Currently, the following MCP tools are implemented:

  • RefreshAssets: Refresh Unity Editor assets
  • GetCurrentConsoleLogs: Get Unity Console log history
  • ClearConsoleLogs: Clear Unity Console logs
  • RunEditModeTests: Run Edit Mode tests on Unity Test Runner
  • RunPlayModeTests: Run Play Mode tests on Unity Test Runner

Installation

Unity

The following packages are required:

Also, install the following Nuget Packages via NugetForUnity:

[!WARNING] ModelContextProtocol is still in preview stage. When installing via NugetForUnity, you need to enable the Show Prerelease toggle.

You can install via UPM (Unity Package Manager):

  • Edit Packages/manifest.json
  • Add the following to the dependencies section:
    json
    "jp.notargs.unity-natural-mcp": "https://github.com/notargs/UnityNaturalMCP.git?path=/UnityNaturalMCPServer"

Initial Setup

  1. Open Edit > Project Settings > Unity Natural MCP in Unity Editor
  2. Set the MCP server port number (default: 56780)
  3. Click the Refresh button to apply the settings

[!NOTE] 56780 is just the default port. Feel free to change it to suit your project. Note that 67 80 is the ASCII code for CP. Of course, it comes from MCP.

Setting

Claude Code

Use the following command to register an MCP server with ClaudeCode.

shell
claude mcp add -s project --transport http unity-natural-mcp http://localhost:56780/mcp

WSL2

When using MCP with Claude Code on Windows, you need to use WSL2.

To integrate WSL2 with Unity, you need to properly configure the network settings between WSL2 and the host OS.

A simple approach is to use mirror mode to connect WSL2 and the host OS.

To enable mirror mode, add the following settings to C:/Users/[username]/.wslconfig:

ini
[wsl2]
networkingMode=mirrored

In mirror mode, you can communicate between WSL2 and the host OS via localhost.

However, when the C# server binds to localhost, it may not work as expected and connections may fail.

To work around this, set the IP Address to * in Unity's Edit > Project Settings > Unity Natural MCP and execute Refresh.

[!CAUTION] From a security perspective, specifying * for the IP Address is not normally recommended. This is only meant to show a simplified setup procedure. Please adjust accordingly based on your environment.

GitHub Copilot(VSCode)

When using GitHub Copilot(VSCode), connection via Streamable HTTP is possible.

Add the following configuration to .vscode/mcp.json:

json
{
  "servers": {
    "unity-natural-mcp": {
      "url": "http://localhost:56780/mcp"
    }
  }
}

Cursor

Cursor does not support Streamable HTTP as of June 23, 2025. You need to connect via stdio. Please download the latest mcp-stdio-to-streamable-http from mcp-stdio-to-streamable-http Releases.

Clone this repository and add these snippets to .cursor/mcp.json.

Please replace path/to/mcp-stdio-to-streamable-http with the path to the cloned mcp-stdio-to-streamable-http.

json
{
  "mcpServers": {
    "unity-natural-mcp": {
      "command": "node",
      "args": ["path/to/mcp-stdio-to-streamable-http/dist/index.js"],
      "env": {
        "MCP_SERVER_IP": "localhost",
        "MCP_SERVER_PORT": "56780"
      }
    }}
}

Gemini CLI

Streamable HTTP is supported. Create .gemini/settings.json at the root and add the following (if you use a custom port, replace 56780):

json
{
  "mcpServers": {
    "httpServer": {
      "httpUrl": "http://localhost:56780/mcp"
    }
  }
}

For more details, see the Gemini CLI documentation: Gemini CLI documentation: HTTP-based MCP server

Custom MCP Tool Implementation

1. Create MCP Tool

In UnityNaturalMCP, you can implement MCP tools in C# using the MCP C# SDK.

Create an asmdef for the Editor and add the following script files.

csharp
using System.ComponentModel;
using ModelContextProtocol.Server;

[McpServerToolType, Description("Description of custom MCP tool")]
public class MyCustomMCPTool
{
    [McpServerTool, Description("Method description")]
    public string MyMethod()
    {
        return "Hello from Unity!";
    }
}

2. Create MCP Tool Builder

To register MCP tools with the MCP server, create a class that inherits from McpBuilderScriptableObject.

csharp
using Microsoft.Extensions.DependencyInjection;
using UnityEngine;
using UnityNaturalMCP.Editor;

[CreateAssetMenu(fileName = "MyCustomMCPToolBuilder", 
                 menuName = "UnityNaturalMCP/My Custom Tool Builder")]
public class MyCustomMCPToolBuilder : McpBuilderScriptableObject
{
    public override void Build(IMcpServerBuilder builder)
    {
        builder.WithTools<MyCustomMCPTool>();
    }
}

3. Create ScriptableObject

  1. Right-click in the project window in Unity Editor
  2. Create ScriptableObject by Select Create > UnityNaturalMCP > My Custom Tool Builder
  3. From Edit > Project Settings > Unity Natural MCP > Refresh, restart the MCP server to load the created tools.

Best practices for Custom MCP Tools

MCPInspector

From MCP Inspector, you can call MCP tools via Streamable HTTP and perform operational verification smoothly.

MCPInspector

Error Handling

When errors occur within MCP tools, they are not displayed in logs.

It is recommended to use try-catch blocks to log errors and rethrow them.

csharp
[McpServerTool, Description("Example of error-returning process")]
public async void ErrorMethod()
{
  try
  {
      throw new Exception("This is an error example");
  }
  catch (Exception e)
  {
      Debug.LogError(e);
      throw;
  }
}

Asynchonous Processing

When using Unity's API, it is necessary to consider the possibility that it may be called from threads other than the main thread.

Additionally, the return type must use ValueTask<T>.

csharp
[McpServerTool, Description("Example of asynchronous processing")]
public async ValueTask<string> AsyncMethod()
{
    await UniTask.SwitchToMainThread();
    await UniTask.Delay(1000);
    return "Finished async processing";
}

Troubleshooting

Run tests tool fails due to disconnecting

When a domain reload occurs while running tests, the connection with the Unity editor will be disconnected, and the run tests tool will fail.

Note the following:

  • Run tests after the compilation is complete
  • Do not run Edit Mode tests that involve domain reloading
  • When running Play Mode tests, turn off Reload Domain in Edit > Project Settings > Editor > "Enter Play Mode Settings"

License

MIT License

Installatie

TypingMind
Vereisten:

Node.js 18+

{
  "mcpServers": {
    "notargs-unitynaturalmcp": {
      "command": "",
      "args": []
    }
  }
}

Gebruik UnityNaturalMCP MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra UnityNaturalMCP is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Je kunt MCP lokaal op je apparaat uitvoeren of verbinding maken met de URL van een externe MCP-server.

Optie 1: Gebruik de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg UnityNaturalMCP toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van UnityNaturalMCP.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "notargs-unitynaturalmcp": {
      "command": "npx",
      "args": [
        "-y",
        "UnityNaturalMCP"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van UnityNaturalMCP in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van UnityNaturalMCP in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je UnityNaturalMCP gebruiken om me hiermee te helpen?
UnityNaturalMCP
Zeker. Ik heb het gelezen.
Dit vond ik met UnityNaturalMCP.

Optie 2: Voeg een MCP-server-URL toe

Gebruik dit als UnityNaturalMCP al extern wordt gehost of als je team één gedeelde connector wil die meerdere gebruikers kunnen gebruiken.

1

Open MCP-connectoren

Ga in TypingMind naar Plug-ins, open MCP-connectoren en kies URL toevoegen.

  1. Open TypingMind in je browser.
  2. Ga naar Plug-ins.
  3. Open MCP-connectoren.
  4. Klik op URL toevoegen.
TypingMind-formulier om een eigen MCP-server-URL toe te voegen
2

Plak de server-URL

Voer je server-URL in het veld Server-URL in. Voeg een verbindingsnaam, beschrijving, icoon, aangepaste HTTP-headers of OAuth-clientinstellingen toe als de server die vereist.

  1. Plak je server-URL in het veld Server-URL.
  2. Voer een verbindingsnaam in voor UnityNaturalMCP.
  3. Voeg een beschrijving en een icoon toe om de verbinding makkelijker te herkennen.
  4. Voeg aangepaste HTTP-headers of OAuth-clientgegevens toe als de server authenticatie vereist.
3

Maak de verbinding

Klik op Verbinding maken, ga terug naar de lijst met plug-ins en controleer of de nieuwe MCP-verbinding actief is.

  1. Klik op Verbinding maken.
  2. Ga terug naar de lijst met MCP-connectoren.
  3. Controleer of de verbinding met UnityNaturalMCP als actief wordt weergegeven.
  4. Vernieuw de lijst met plug-ins als de verbinding niet meteen verschijnt.
4

Wissel van model zonder opnieuw verbinding te maken

Start een chat met je favoriete model, schakel de tools van UnityNaturalMCP in via Plug-ins en wissel van model wanneer dat nodig is. De MCP-verbinding blijft beschikbaar in de TypingMind-werkruimte.

  1. Start een nieuwe chat in TypingMind.
  2. Selecteer het AI-model dat je wilt gebruiken.
  3. Schakel de tools van UnityNaturalMCP in via Plug-ins.
  4. Vraag het model om de tool te gebruiken wanneer dat nodig is.
  5. Schakel over naar een ander AI-model en gebruik dezelfde MCP-verbinding opnieuw.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je UnityNaturalMCP gebruiken om me hiermee te helpen?
UnityNaturalMCP
Zeker. Ik heb het gelezen.
Dit vond ik met UnityNaturalMCP.

Veelgestelde vragen

Waarvoor wordt de MCP-server UnityNaturalMCP gebruikt?

UnityNaturalMCP is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik UnityNaturalMCP MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je UnityNaturalMCP gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom UnityNaturalMCP MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als UnityNaturalMCP verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik UnityNaturalMCP MCP met TypingMind?

Je kunt UnityNaturalMCP met TypingMind verbinden via de lokale MCP-connector of door de URL van een externe MCP-server toe te voegen. Gebruik de lokale connector als de server toegang nodig heeft tot bestanden, apps of privébronnen op je apparaat. Gebruik een server-URL als de MCP-server extern wordt gehost.

Welke tools biedt UnityNaturalMCP MCP in TypingMind?

UnityNaturalMCP biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om UnityNaturalMCP MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als UnityNaturalMCP authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇