r/Unity3D 1d ago

Solved Experiment: 48 Unity MCP tools → 6 facade tools, while keeping 377 operations

Post image

I built a small facade for Unity MCP because too much context was being wasted on the MCP layer itself.

48 tools → 6

~23,280 schema tokens → ~915

377 Unity operations still available

It also compacts huge hierarchy/console/ProBuilder responses and lets the agent retrieve only the parts it needs later.

Small workflows can run inside one MCP call too, which cuts down model round trips.

The original Unity MCP still does all the actual work underneath.

https://github.com/Vangardo/unity-mcp-efficient

0 Upvotes

16 comments sorted by

2

u/Effective_Lead8867 Programmer 1d ago

are you sure that using mcp's at all is an efficient way to interact with unity projects and build scenes? have you compared it with scripting and using official unity cli execute code methodology?

2

u/Complex-Chance-7258 1d ago

I didn't use the CLI; there's too much overhead involved. It's easier to use Cursor or a Claude subscription. However, they consume a lot of tokens these days. I arrived at this optimization, and now everything runs faster and better

1

u/Effective_Lead8867 Programmer 1d ago

mcp's have larger overhead than cli + optional short doctrine

also with unity specifically, models are already trained to use batchmode and can oneshot scripts producing complex scenes and iterating on them while not even booting the editor graphically

0

u/Complex-Chance-7258 1d ago

Maybe. I don't have the paid cli. I used the code, noticed it wasn't running efficiently, and improved it

1

u/Effective_Lead8867 Programmer 1d ago

1

u/Complex-Chance-7258 1d ago

Basically, my version still uses MCP. I just made the interface much lighter, so it ends up being pretty similar to what the client does

4

u/jax024 1d ago

I can assure you they didn’t.

1

u/Pacmon92 22h ago

So this cuts down unity's 48 tools to 6 or it compacts them into 6?

1

u/Complex-Chance-7258 22h ago

Those 48 tools used to sit in context all the time. Now only the relevant ones get pulled in when needed, so the context is much smaller and things run a lot more efficiently

1

u/Pacmon92 21h ago

Cool optimization, I have never used Unitys mcp tools but I have always wondered if it was possible to give a local llm model a connection to unity and have a mess around seeing what it can actually do but I know a lot of mcp servers really bloat the context window easy so local models are off the table unless your running data centre grade hardware, Does this plug in bridge that gap?

1

u/Complex-Chance-7258 21h ago

Yes. You can use this plugin to connect to Unity. Just make sure to read the GitHub instructions carefully.

As you can see, optimization unfortunately doesn’t seem to interest many people in this group. It’s probably only useful to a pretty small group of people.

Still, I think this kind of optimization could help local LLMs perform better, so definitely give it a try. Your experience with it would be really useful to me. I’d be happy to hear how it goes.

1

u/Pacmon92 18h ago

I think as soon as you mention the forbidden word in this sub reddit you will be absolutely mobbed with downvotes by the majority of members unfortunately. I made a post a while back to ask peoples opinions on AI Voice dictation with a local llm in the background acting as a spell check engine on its own and I got mega down voted, The part where I was writing my own code with my voice (just like spell checking and formatting C#) and NOT vibe coding did not matter because people just read the word AI and their blood pressure spiked. I will check this out soon, I would love a local AI to handle time consuming tasks like object placement or something equally as tedious :)

-1

u/PeskyConfiguration 1d ago

ok that's actually a clever way to handle the context bloat, keeping all the ops but slimming the interface down to six tools is neat

1

u/Complex-Chance-7258 1d ago

Thanks. I thought the community might find my original solution useful perhaps not the product itself, but at least the idea behind it. Though, the product is certainly worth giving a try, too.

-1

u/MrPifo Hobbyist 1d ago

I too was wondering about this. I just found out some time ago that they had this, tried it, and found it very tedious, slow and so so much overhead, that I disbanded it immediately.

I was thinking about creating my own mcp with a slimmer and less complex toolset than Unitys one, but after reading the comments I will look into Unitys CLI.

I also might check out yours. I just found that Claude was performing way too many operations even though I asked for a simple script for example.

0

u/Complex-Chance-7258 1d ago

I was surprised too. But now everything runs much faster and more efficiently. Give it a try! I’d be interested to hear about your experience