EM

eeeeeeeethan/mcptoolforunity

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

5 stars 2 forks 质量 30 趋势 13

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

概览

Simply add the [McpTool] attribute to static methods to make them callable from editors like Cursor/windsurf. 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. Add the [McpTool] attribute to the static methods you want to call. you need re-enable cursor MCP server to refresh tool list

README

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;
}

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

restart Unity if you have modified port

3. Configure Cursor

paste command to Cursor settings

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

5. Test Agent

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →