MCP ExplorerExplorer

Mcptoolforunity

@EEEEEEEEthanon a year ago
3 MIT
FreeCommunity
AI Systems
McpToolForUnity allows static methods to be callable from editors using the [McpTool] attribute.

Overview

What is Mcptoolforunity

McpToolForUnity is a Unity package that allows developers to create callable static methods from editors like Cursor and windsurf by using the McpTool attribute.

Use cases

Use cases include creating utility functions that can be called directly from the Unity editor, simplifying repetitive tasks, and improving the efficiency of game development processes.

How to use

To use McpToolForUnity, install the package from the provided Git URL, configure the Cursor settings, and add the McpTool attribute to your static methods. After making changes, re-enable the MCP server to refresh the tool list.

Key features

Key features include the ability to easily expose static methods to editors, customizable parameter descriptions via attributes, and straightforward installation and configuration.

Where to use

McpToolForUnity is primarily used in game development within the Unity engine, particularly for enhancing editor functionality and streamlining development workflows.

Content

Introduction to McpToolForUnity

Features

Simply add the [McpTool] attribute to static methods to make them callable from editors like Cursor/windsurf.

[McpTool("Add two numbers")]
static int Add([McpTool("The first one")] int a, [McpTool("The second one")] int b)
{
    // Attribute for parameters are not necessary
    return a + b;
}

image

Installation

1. Unity Package

Add the package from the git URL: https://github.com/EEEEEEEEthan/McpToolForUnity.git

This will create a McpCommand directory at the same level as Assets.

2. Open Unity Preferences

image

restart Unity if you have modified port

3. Configure Cursor

paste command to Cursor settings

image

4. Attribute Everything

Add the [McpTool] attribute to the static methods you want to call.

[McpTool("Add two numbers")]
static int Add([McpTool("The first one")] int a, [McpTool("The second one")] int b)
{
    // Attribute for parameters are not necessary
    return a + b;
}

you need re-enable cursor MCP server to refresh tool list

image

5. Test Agent

image

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers