UniMcp enables AI assistants like Cursor and Windsurf to interact with Unity.
- Run tests with a filter
- Compile the code
-
Install .NET 8 to run the server.
-
Check out the UniMcp repository
-
Add
UniMcp.Client
to Unity Package Manager from the repository you checked out:
"com.yousician.unimcp.client": "file:../../UniMcp/UniMcp.Client",
- 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.
- Start the MCP server in your IDE. In most IDEs this is done by pressing a "Refresh" button in the MCP server settings.
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.
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.
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" }}
When debugging the server, the MCP framework will eat all exceptions. You can put a breakpoint here to see the issue.
The server writes logs to ~/UniMcp.log
.
The client's logs are visible in the UniMcp editor window.
To add new tools to the server:
- Create a new tool description in
UniMcp.Server.Tools
- Implement the appropriate functionality in
UniMcp.Client.Commands