MCP ExplorerExplorer

Unimcp

@YousicianGiton 21 days ago
1 Apache-2.0
FreeCommunity
AI Systems
#agentic-ai#cursor#llm#mcp#windsurf#unity
UniMcp enables AI assistants like Cursor and Windsurf to interact with Unity

Overview

What is Unimcp

UniMcp is a server that enables AI assistants, such as Cursor and Windsurf, to interact with Unity, facilitating tasks like code compilation and test execution.

Use cases

Use cases for UniMcp include automating code compilation, running tests in Unity projects, and facilitating debugging processes with AI assistance.

How to use

To use UniMcp, install .NET 8, check out the UniMcp repository, add UniMcp.Client to Unity Package Manager, configure your IDE, and start the MCP server. Once set up, the server will automatically start, allowing AI agents to compile code or run tests.

Key features

Key features of UniMcp include the ability to run tests with filters, compile code, and interact with the server through a console application based on the MCP C# SDK.

Where to use

UniMcp can be used in game development environments where Unity is utilized, particularly in projects that leverage AI for development assistance.

Content

UniMcp

UniMcp enables AI assistants like Cursor and Windsurf to interact with Unity.

UniMcp

Functions

  • Run tests with a filter
  • Compile the code

Installation

  1. Install .NET 8 to run the server.

  2. Check out the UniMcp repository

  3. Add UniMcp.Client to Unity Package Manager from the repository you checked out:

"com.yousician.unimcp.client": "file:../../UniMcp/UniMcp.Client",
  1. In Unity, open Tools > UniMcp and press the configure button of your IDE.

[!NOTE]
If you are using Visual Studio Code, you can configure the MCP server for cursor and it will be discovered automatically.

If your IDE is not listed, you can press “Copy Config to Clipboard” and paste it into your IDE.

  1. Start the MCP server in your IDE.
    In most IDEs this is done by pressing a “Refresh” button in the MCP server settings.

Usage

Once configured, the server will be automatically started by your IDE.
The Unity bridge will be started automatically by the Unity Editor.
Now you can ask your favorite AI agent to compile the code or run tests.

Development

The Unity client is set up to also work without Unity to enable debugging together with the server.

The server is a console application that’s based on the MCP C# SDK. You can interact with it directly by writing messages to STDIN.

Example messages

List available tools:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Run all tests:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "RunTests",
    "arguments": {
      "testFilter": ""
    }
  }
}

Compile the code:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "Compile"
  }
}

Debugging

When debugging the server, the MCP framework will eat all exceptions.
You can put a breakpoint here to see the issue.

Logs

The server writes logs to ~/UniMcp.log.
The client’s logs are visible in the UniMcp editor window.

Adding New Tools

To add new tools to the server:

  1. Create a new tool description in UniMcp.Server.Tools
  2. Implement the appropriate functionality in UniMcp.Client.Commands

Tools

No tools

Comments