script-execute

script-execute is a skill for Claude Code from IvanMurzak/Unity-MCP. It costs 53 tokens per session (1,922 once invoked), scanned A, original, Apache-2.0.

A tool for compiling and running C# code inside the Unity Editor, either as a complete class or as method statements. It can also resolve Unity objects such as GameObjects and components passed as parameters.

In plain words
What is it for?
Use it to run C# logic, inspect or modify Unity objects, and execute editor-side experiments.
Why use it?
It lets you test or perform Unity code without manually creating a script file for every small operation. It also handles references to objects already in the Unity project.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to run C# logic, inspect or modify Unity objects, and execute editor-side experiments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ivanmurzak/unity-mcp/script-execute
About the project

Unity-MCP connects AI coding agents to the Unity game engine through MCP, letting them work with the Unity Editor and running games. It is used by game developers to generate code, automate development and testing, debug projects, and add AI-driven behavior to games. The catalogue entries provide skills, instructions, an MCP integration, and settings for operating this workflow.

IvanMurzak/Unity-MCP · 4,501 stars · on GitHub · ai-game.dev

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add IvanMurzak/Unity-MCP --skill script-execute
Clone the repo
git clone --depth 1 https://github.com/IvanMurzak/Unity-MCP

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for script-execute

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/script-execute/github.svg)](https://agentmods.dev/skills/ivanmurzak/unity-mcp/script-execute)
Your own site
<a href="https://agentmods.dev/skills/ivanmurzak/unity-mcp/script-execute"><img src="https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/script-execute/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for script-execute

Your own site · 80×15
<a href="https://agentmods.dev/skills/ivanmurzak/unity-mcp/script-execute"><img src="https://agentmods.dev/badge/skills/ivanmurzak/unity-mcp/script-execute.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,922 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 50
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.01922
Opus 5.5 $0.00021 $0.00769
Sonnet 5.5 $0.00011 $0.00384
Haiku 4.5 $0.00005 $0.00192

Measured yesterday against content hash b6023fd476fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

script-execute scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Unity-MCP-Plugin/.claude/skills/script-execute/SKILL.md · 223 lines

How it starts

The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Script / Execute

Modes

  • Snippet (default): plain statements. The last expression is the result (GameObject.Find("Player").name). Own using lines, local classes and functions are allowed; await works. Usings for System, LINQ, UnityEngine, UnityEditor and AIGD are already there; an unknown type name is imported automatically when exactly one namespace has it.
  • Full code: when csharpCode declares class className with a static method methodName, that method runs.
  • isMethodBody=true forces snippet mode.

Compile errors point at your own lines (snippet.cs(2,5)).

usings / include

  • usings: extra namespaces, e.g. ["MyGame.Gameplay"].
  • include: helper .cs files or folders (recursive), relative to <Project>/.ai-game-dev/snippets, compiled with the snippet.

Passing Unity objects as parameters

Parameters become the snippet's variables (or the method's arguments, in order):

  • UnityEngine.GameObject — resolves an actual GameObject from value {"instanceID": N}, {"name": "..."}, or {"path": "..."}.
  • UnityEngine.Component (or any component subtype) — resolves from {"instanceID": N}.
  • AIGD.GameObjectRef — passes a GameObjectRef POCO directly; call goRef.FindGameObject() to resolve it.
  • AIGD.ComponentRef — passes a ComponentRef POCO.
  • AIGD.ObjectRef — passes a base ObjectRef POCO.

How to Call

unity-mcp-cli run-tool script-execute --input '{
  "csharpCode": "string_value",
  "className": "string_value",
  "methodName": "string_value",
  "parameters": "string_value",
  "isMethodBody": false,
  "usings": "string_value",
  "include": "string_value"
}'

For complex input (multi-line strings, code), save the JSON to a file and use:

unity-mcp-cli run-tool script-execute --input-file args.json

Or pipe via stdin (recommended):

unity-mcp-cli run-tool script-execute --input-file - <<'EOF'
{"param": "value"}
EOF

Troubleshooting

If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead. Read the /unity-initial-setup skill for detailed installation instructions.

Read the full file on GitHub · 223 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +24 lines · +5 tokens per session b6023fd476fe
  2. 4d ago Changed · +2 lines 9064ef9860f9
  3. 1mo ago First seen · 197 lines · 48 tokens per session scan A 00b38c73fb05

Subscribe to this mod's changes

script-execute is a skill published in the GitHub repository IvanMurzak/Unity-MCP (4,501 stars, last pushed today), licensed Apache-2.0. It adds 53 tokens to every session and 1,922 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

godot-csharp

Use C#/.NET in Godot 4.7: partial classes extending nodes, the PascalCase lifecycle (Ready/Process/PhysicsProcess), [Export] fields, [Signal] delegates as C# events, type-safe node lookup, and calling between C# and GDScript. Use when writing Godot game code in C# (.cs files, .csproj), needing the Godot .NET build…

gamedev-skills/awesome-gamedev-agent-skills · 108 tokens

unity-csharp-scripting

Write Unity 6.3 LTS C# gameplay scripts: the MonoBehaviour lifecycle (Awake/OnEnable/Start/Update/FixedUpdate/LateUpdate), GameObject and component access, coroutines, and Inspector serialization. Use when creating or editing .cs scripts in a Unity project, or when the user mentions MonoBehaviour, Start/Update…

gamedev-skills/awesome-gamedev-agent-skills · 92 tokens

gdextension

Use when building native extensions for Godot — godot-cpp (C++) or gdext (Rust), binding classes, building, and GDScript/C# interop.

jame581/GodotPrompter · 38 tokens

godot-csharp-patterns

Use C# in Godot with clear interop boundaries, node ownership, and engine lifecycle awareness.

MRCalderon3D/everything-game-dev-code · 27 tokens

fantasy-net

This guide applies to development and code review for Fantasy / Fantasy.Net / Fantasy.Unity written in C#. Use it when a task involves Fantasy server code or Unity client code using Fantasy, ECS entities/components/systems, scenes and subscenes, FTask, network handlers/messages/protocols, Address or Roaming routing…

qq362946/Fantasy · 157 tokens

sbox

Use when writing or modifying code for s&box, sbox, the Facepunch sandbox engine, or any Source 2 game project in C#. Triggers on mentions of s&box, sbox, sandbox game, Facepunch engine, Source 2 game, .sbproj, .razor with PanelComponent, @inherits PanelComponent, Sandbox.Component, GameObject + Components.Get …

gavogavogavo/claude-sbox · 197 tokens