8000 GitHub - YousicianGit/UniMcp: UniMcp enables AI assistants like Cursor and Windsurf to interact with Unity
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

YousicianGit/UniMcp

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0