Unity Editor HTTP API
A REST API server for controlling Unity Editor via HTTP. Perfect for AI agents, automation scripts, CI/CD pipelines, and external tools.
Loading actions...
Skill content
Main instructions and any bundled files for this skill.
Unity Editor HTTP API
A REST API server for controlling Unity Editor via HTTP. Perfect for AI agents, automation scripts, CI/CD pipelines, and external tools.
Installation
Option 1: Local Package (Recommended for Development)
- Copy the
com.fubz.unity-editor-apifolder to your project'sPackages/directory - Unity will automatically detect and import the package
Option 2: Git URL
Add to your Packages/manifest.json:
{
"dependencies": {
"com.fubz.unity-editor-api": "https://github.com/YOUR_USERNAME/unity-editor-api.git"
}
}
Option 3: OpenUPM (if published)
openupm add com.fubz.unity-editor-api
Quick Start
The server starts automatically when Unity opens. Access it at http://localhost:8091.
# Check if server is running
curl http://localhost:8091/api/help
# Get console logs
curl "http://localhost:8091/api/logs?type=error&limit=10"
# Enter play mode
curl -X POST http://localhost:8091/api/playmode -d '{"action":"play"}'
# Load a scene
curl -X POST http://localhost:8091/api/scene/load -d '{"path":"Assets/Scenes/Main.unity"}'
API Reference
Console & Debugging
| Endpoint | Method | Description |
|---|---|---|
/api/help | GET | API documentation |
/api/logs?type=error&limit=20 | GET | Console logs (type: error|warning|log) |
Play Mode Control
| Endpoint | Method | Body | Description |
|---|---|---|---|
/api/playmode | GET | - | Check play mode state |
/api/playmode | POST | {"action":"play|stop|pause|resume"} | Control play mode |
Scene Management
| Endpoint | Method | Body | Description |
|---|---|---|---|
/api/scene/list | GET | - | List all scenes in project |
/api/scene/current | GET | - | Get current scene info |
/api/scene/load | POST | {"path":"Assets/.../Scene.unity"} | Load a scene |
/api/hierarchy | GET | - | Get scene hierarchy |
Editor Operations
| Endpoint | Method | Body | Description |
|---|---|---|---|
/api/recompile | POST | - | Trigger script recompilation |
/api/save | POST | {"what":"scene|project|all"} | Save scene/project |
/api/menu | POST | {"path":"File/Save"} | Execute menu item |
/api/select | POST | {"name":"Main Camera"} | Select GameObject |
/api/project | GET | - | Get project info |
Configuration
Access settings via Tools > Editor API > Open Settings
- Port: Default 8091
- Auto Start: Automatically start server when Unity opens
Claude Code Integration
This package includes a ready-to-use skill file for Claude Code.
Setup
Copy the skill to your project's .claude/skills/ folder:
# From your Unity project root
mkdir -p .claude/skills/unity-editor-api
cp Packages/com.fubz.unity-editor-api/ClaudeCode/SKILL.md .claude/skills/unity-editor-api/
Or symlink it:
mkdir -p .claude/skills
ln -s ../../Packages/com.fubz.unity-editor-api/ClaudeCode .claude/skills/unity-editor-api
What Claude Code Can Do
With this skill, Claude Code can:
- Check for compile errors after code changes
- Enter/exit play mode
- Load scenes
- Trigger recompilation
- Inspect scene hierarchy
- Execute menu items
- Save scenes and project
Response Format
All endpoints return JSON:
// Success
{"success": true, "data": ...}
// Error
{"error": "Description of what went wrong"}
Tips
- Background Operation: Enable "Run In Background" in Player Settings for reliable operation when Unity isn't focused
- CORS: All endpoints include CORS headers for browser-based tools
- Timeouts: Operations have built-in timeouts (2-10 seconds depending on operation)
License
MIT
Related Skills
Frontend Typescript Linting.mdc
TypeScript and ESLint rules that MUST be followed when creating, modifying, or reviewing any file under apps/frontend/, including .ts, .tsx, .js, and .jsx files. Also apply when discussing frontend li...
2. Apply Deepthink Protocol (reason about dependencies
risks