upilot-unity-mcp

Rules for using UPilot MCP to automate the Unity Editor, the development environment for Unity games and interactive applications. They also define project-specific setup and the standard Unity project for checking package changes.

In plain words
What is it for?
Use them to automate Unity Editor tasks and validate UPilot repository or package changes in the designated test project.
Why use it?
They help keep Unity automation aligned with the project's package, inherited rules, and validation project. This reduces confusion about which project and instructions should be used.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/codingriver/upilot/upilot-unity-mcp
Clone the repo
git clone --depth 1 https://github.com/codingriver/upilot

Made for: Cursor.

Per session 2,996 This file is loaded in full into every session.
When invoked 2,996 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02996 $0.02996
Opus 5 $0.01498 $0.01498
Sonnet 5 $0.00599 $0.00599
Haiku 4.5 $0.00300 $0.00300

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

Security

Grade A, and why

upilot-unity-mcp 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.

Tests~/UPilotTest/.cursor/rules/upilot-unity-mcp.mdc · 147 lines

How it starts

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

UPilot Unity MCP

rulesVersion: 17 upilotPackageVersion: 0.3.27 projectPath: D:\upilot\Tests~\UPilotTest generatedAt: 2026-08-27T13:27:15Z

This Unity project has the io.github.codingriver.upilot UPM package installed. Project-specific business rules outside this controlled UPilot block take precedence.

Parent Agent Rules

  • Parent Agent rules path: ../../AGENTS.md (relative to the project root AGENTS.md).
  • Before applying this UPilot block, automatically load the parent rules when the path is not (none).
  • Resolve every loaded AGENTS.md to a canonical absolute path and keep a visited set, including this file, so repeated or circular references are skipped.
  • Apply inherited parent rules first, then this project's local rules, then this UPilot block.

UPilot Package Acceptance

  • When validating UPilot repository/package changes, use ./Tests~/UPilotTest under the UPilot repository as the default and canonical Unity project for compile and EditMode acceptance.
  • Do not treat external client projects such as D:\MA\xclient or F:\xclient2 as default UPilot validation targets.
  • Use external client projects only when explicitly requested for project-side/business smoke validation or investigation.
  • If this rule block is installed inside another Unity project, use that project for its own business workflows, but return to ./Tests~/UPilotTest before claiming UPilot package compile/EditMode acceptance.

Connection

  • Streamable HTTP: http://127.0.0.1:8011/mcp
  • Health check: http://127.0.0.1:8011/health
  • Third-party AI tools must connect through Streamable HTTP at http://127.0.0.1:<httpPort>/mcp only.
  • Never configure a third-party AI client with a WebSocket URL, the internal Unity Bridge port, a stdio command, or a local MCP Server process command.
  • WebSocket transport is internal to MCP Server <-> Unity Bridge. The default internal port is 8765 and must not appear as the AI client's endpoint.
  • When multiple Unity projects run concurrently, allocate a unique HTTP/WebSocket port pair per project internally, give each client registration a distinct name, and expose only that project's HTTP /mcp endpoint to the AI tool.
  1. Call unity_mcp_status.
  2. Require connected: true and serverReady: true.
  3. Verify paths.unityProjectAbsolute matches D:\upilot\Tests~\UPilotTest (allow equivalent slash normalization).
  4. Stop and report the mismatch if another Unity project is connected.

Read the full file on GitHub · 147 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 First seen · 147 lines · 2,996 tokens per session scan A e679fb6d46ba

Subscribe to this mod's changes

upilot-unity-mcp is a cursor rule published in the GitHub repository codingriver/upilot (0 stars, last pushed 4d ago), licensed MIT. It adds 2,996 tokens to every session, about $0.0150 per session on Opus 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-08-31.