Connect VS Code Copilot
Agent mode and tool approval
Verified against a working setup on 2026-08-10
VS Code supports MCP through Copilot's agent mode. If you already have Copilot, this is the least additional software of any option — and it puts Unity tools next to the C# editing you were doing anyway.
Where the config lives
| Scope | File | Note |
|---|---|---|
User (Windows) | %APPDATA%\Code\User\mcp.json | Applies to every workspace. |
User (macOS) | ~/Library/Application Support/Code/User/mcp.json | Same file, different home. |
Workspace | .vscode/mcp.json | Committed with the project. |
servers as the top-level key, not mcpServers. Copying a Claude or Cursor config across without changing that key is a very easy mistake — and it fails silently.The config
{
"servers": {
"unity-mcp": {
"type": "stdio",
"command": "C:\\Users\\you\\.unity\\relay\\relay_win.exe",
"args": ["--mcp"]
}
}
}{
"servers": {
"unityMCP": {
"type": "stdio",
"command": "C:\\Users\\you\\.local\\bin\\uvx.exe",
"args": [
"--offline",
"--from", "mcpforunityserver==10.0.0",
"mcp-for-unity",
"--transport", "stdio"
]
}
}
}Turning it on
- 1 Write mcp.json
Use the user-level path for a setup that follows you across projects.
- 2 Open the Chat view and pick Agent
The mode dropdown sits at the top of the chat panel. Ask and Edit modes cannot call tools.
- 3 Open the tools picker
The tools icon lists every MCP tool available. Your Unity tools should be there and ticked.
- 4 Open your Unity project
As always, the Editor must be running.
- 5 Verify
Ask for something only the live project knows.
textWhat compile errors are in my Unity console right now?
Tool approval
VS Code asks before running a tool and offers to remember your choice. That prompt is a real safety boundary, so it is worth being deliberate about what you make permanent.
| Tool kind | Approval | Why |
|---|---|---|
Read console, read scene | Always allow | No side effects, and this is most of the value. |
Search and inspect assets | Always allow | Read-only. |
Create or edit scripts | Allow per session | Recoverable, but only if git is clean. |
Modify scenes or GameObjects | Ask every time | Hardest thing to review after the fact. |
Delete anything | Ask every time | Obvious. |
Run menu items | Ask every time | A menu item can do literally anything. |
Why this one is convenient for Unity
The obvious benefit: VS Code is already many people's C# editor for Unity, so the model can read your scripts through the workspace and your scene through MCP at the same time. That combination catches a class of bug — script expects a component the scene does not have — that neither source alone would reveal.
What to take away
- VS Code uses
servers, notmcpServers. - User config lives at
%APPDATA%\Code\User\mcp.json. - Only Agent mode can call tools.
- Always-allow reads; keep scene and delete tools on ask.
- Workspace files plus MCP scene access catches script/scene mismatches.