MDMCP Server (Unity)

HTTP automation bridge for the Unity Editor.

Install (UPM - Git URL)

"com.clokk.mdmcp-unity": "https://github.com/clokk/mdmcp-unity.git#v0.2.3"

Or use Package Manager → Add package from Git URL…

Prompting in Cursor

Give the agent concrete context and speak in natural language about what you want to automate with MCP actions.

  • Always attach the package guide: @Packages/com.clokk.mdmcp-unity/Documentation/MDMCPServer.md (or @MDMCPServer.md if copied locally).
  • Prompt naturally, e.g.: “Enter play mode, wait 2s, click /Canvas/MainMenu/PlayButton, then return getContext.”
  • Ensure the Unity Editor is open, compiled (no pending compilation), and the Editor window is active before running MCP commands.

Repo: clokk/mdmcp-unity

Start the Server

Unity menu: Markdown → Start MCP Server (default: http://localhost:43210)

Quickstart (curl)

curl -X POST http://localhost:43210 -H "Content-Type: application/json" -d '{"action":"getContext"}'

Extend

using MCP;
using UnityEditor;

namespace MyCompany.MDMCP.Actions
{
    public class HelloAction : IEditorAction
    {
        public string ActionName => "hello";
        public object Execute(EditorActionPayload payload)
        {
            return ActionResponse.Ok(new { message = "Hello from MDMCP!" });
        }
    }
}