Logotipo de UnityNaturalMCP

UnityNaturalMCP

Comunidad
notargs

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

Editornotargs
RepositorioUnityNaturalMCP
IdiomaC#
Forks
17
Estrellas
163
Herramientas disponibles
0
Tipo de transportestdio, streamable-http
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    UnityNaturalMCP ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    163 estrellas y 17 forks en el repositorio enlazado.

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

Instalación

TypingMind
Requisitos:

Node.js 18+

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

Usa el MCP de UnityNaturalMCP con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado UnityNaturalMCP, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Puedes ejecutar MCP localmente en tu dispositivo o conectarte a la URL de un servidor MCP remoto.

Opción 1: Usa el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade UnityNaturalMCP como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de UnityNaturalMCP.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "notargs-unitynaturalmcp": {
      "command": "npx",
      "args": [
        "-y",
        "UnityNaturalMCP"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de UnityNaturalMCP y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de UnityNaturalMCP.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar UnityNaturalMCP para ayudarme con esta tarea?
UnityNaturalMCP
Claro. Lo he leído.
Esto he encontrado usando UnityNaturalMCP.

Opción 2: Añade la URL de un servidor MCP

Usa esta opción si UnityNaturalMCP ya está alojado en un servidor remoto o si tu equipo quiere un conector compartido al que puedan acceder varios usuarios.

1

Abre Conectores MCP

En TypingMind, ve a Plugins, abre Conectores MCP y elige Añadir URL.

  1. Abre TypingMind en tu navegador.
  2. Ve a Plugins.
  3. Abre Conectores MCP.
  4. Haz clic en Añadir URL.
Formulario de TypingMind para añadir la URL de un servidor MCP personalizado
2

Pega la URL del servidor

Introduce la URL de tu servidor en el campo URL del servidor. Añade un nombre de conexión, una descripción, un icono, cabeceras HTTP personalizadas o la configuración del cliente OAuth si el servidor los requiere.

  1. Pega la URL de tu servidor en el campo URL del servidor.
  2. Introduce un nombre para la conexión de UnityNaturalMCP.
  3. Añade una descripción y un icono si quieres que sea más fácil de identificar.
  4. Añade cabeceras HTTP personalizadas o los datos del cliente OAuth si el servidor requiere autenticación.
3

Crea la conexión

Haz clic en Crear conexión, vuelve a la lista de plugins y comprueba que la nueva conexión MCP esté activa.

  1. Haz clic en Crear conexión.
  2. Vuelve a la lista de conectores MCP.
  3. Comprueba que la conexión de UnityNaturalMCP aparezca como activa.
  4. Actualiza la lista de plugins si la conexión no aparece de inmediato.
4

Cambia de modelo sin volver a conectar

Inicia un chat con tu modelo preferido, activa las herramientas de UnityNaturalMCP desde Plugins y cambia de modelo cuando lo necesites. La conexión MCP seguirá disponible en el espacio de trabajo de TypingMind.

  1. Inicia un nuevo chat en TypingMind.
  2. Selecciona el modelo de IA que quieras usar.
  3. Activa las herramientas de UnityNaturalMCP desde Plugins.
  4. Pide al modelo que use la herramienta cuando sea necesario.
  5. Cambia a otro modelo de IA y reutiliza la misma conexión MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar UnityNaturalMCP para ayudarme con esta tarea?
UnityNaturalMCP
Claro. Lo he leído.
Esto he encontrado usando UnityNaturalMCP.

Preguntas frecuentes

¿Para qué sirve el servidor MCP UnityNaturalMCP?

UnityNaturalMCP es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP UnityNaturalMCP con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar UnityNaturalMCP con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de UnityNaturalMCP con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con UnityNaturalMCP conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP UnityNaturalMCP a TypingMind?

Puedes conectar UnityNaturalMCP en TypingMind con el conector MCP local o añadiendo la URL de un servidor MCP remoto. Usa el conector local cuando el servidor necesite acceder a archivos, aplicaciones o recursos privados de tu dispositivo, y una URL de servidor cuando el servidor MCP esté alojado de forma remota.

¿Qué herramientas ofrece el servidor MCP UnityNaturalMCP en TypingMind?

UnityNaturalMCP ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP UnityNaturalMCP?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si UnityNaturalMCP requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇