| Endpoint | Method | Purpose | Parameters |
|---|---|---|---|
/scripts-compile |
GET | Trigger compilation | timeout (optional) |
/scripts-compile-status |
GET | Get compilation status | None |
| Endpoint | Method | Purpose | Parameters |
|---|---|---|---|
/tests-run-single |
GET/POST | Run a single specific test | test_name, mode, timeout |
/tests-run-all |
GET/POST | Run all tests in specified mode | mode, timeout |
/tests-run-regex |
GET/POST | Run tests matching regex pattern | filter_regex, mode, timeout |
/tests-run-status |
GET | Get test execution status | None |
/tests-run-cancel |
GET | Cancel running tests | guid (optional) |
| Endpoint | Method | Purpose | Parameters |
|---|---|---|---|
/assets-refresh |
GET | Refresh asset database | force (optional) |
| Endpoint | Method | Purpose | Parameters |
|---|---|---|---|
/editor-status |
GET | Get Editor state | None |
| Endpoint | Method | Purpose | Parameters |
|---|---|---|---|
/shaders-compile-single |
GET | Compile single shader | shader_name, timeout |
/shaders-compile-all |
GET/POST | Compile all shaders | timeout |
/shaders-compile-regex |
GET/POST | Compile shaders by regex | pattern, timeout |
/shaders-compile-status |
GET | Get shader compilation status | None |
| Endpoint | Method | Purpose | Parameters |
|---|---|---|---|
/menu-items-execute |
POST | Execute Unity menu item | menu_item_path |
Note: Editor log tools (editor_log_path, editor_log_head, editor_log_tail, editor_log_grep) are provided at the MCP layer by mcp-server.js, not as HTTP endpoints. They read the Unity Editor log file directly from the file system.
Endpoint: GET /tests-run-single?test_name=MyNamespace.MyTests.MySpecificTest&mode=EditMode
Parameters:
test_name(required): Full name of the test to runmode(optional): "EditMode" or "PlayMode" (default: "EditMode")timeout(optional): Timeout in seconds (default: 60)
Example:
GET /tests-run-single?test_name=MyProject.Tests.PlayerControllerTests.TestJump&mode=EditModeEndpoint: GET /tests-run-all?mode=EditMode
Parameters:
mode(optional): "EditMode" or "PlayMode" (default: "EditMode")timeout(optional): Timeout in seconds (default: 60)
Examples:
# Run all EditMode tests
GET /tests-run-all?mode=EditMode
# Run all PlayMode tests
GET /tests-run-all?mode=PlayModeEndpoint: GET /tests-run-regex?filter_regex=.*PlayerController.*&mode=EditMode
Parameters:
filter_regex(required): .NET Regex pattern for filtering testsmode(optional): "EditMode" or "PlayMode" (default: "EditMode")timeout(optional): Timeout in seconds (default: 60)
Examples:
# Run only integration tests:
GET /tests-run-regex?filter_regex=Integration\.Tests\..*&mode=PlayMode
# Run single test by pattern:
GET /tests-run-regex?filter_regex=MyNamespace\.MyTests\.SpecificTest&mode=EditMode
# Run all tests in a namespace:
GET /tests-run-regex?filter_regex=MyNamespace\..*&mode=EditModeEndpoint: GET /tests-status
Response Fields:
status: "running" or "idle"isRunning: booleanlastTestTime: ISO timestamptestResults: object with statistics and individual resultstestRunId: unique GUIDhasError: booleanerrorMessage: error description if applicable
Endpoint: GET /tests-cancel?guid=
Parameters:
guid(optional): Test run GUID to cancel. If not provided, cancels current running test.
Examples:
# Cancel current test run
GET /tests-cancel
# Cancel specific test run
GET /tests-cancel?guid=abc123def456# Check editor status
GET /editor-status
# Trigger compilation
GET /compilation-trigger
# Wait for compilation to complete
GET /compilation-status
# Run all EditMode tests
GET /tests-run-all?mode=EditMode
# Check test status
GET /tests-status# 1. Verify Unity is ready
GET /editor-status
# 2. Compile project
GET /compilation-trigger
# 3. Check compilation status
GET /compilation-status
# 4. Run EditMode tests
GET /tests-run-all?mode=EditMode
# 5. Check test results
GET /tests-status
# 6. Run PlayMode tests
GET /tests-run-all?mode=PlayMode
# 7. Check final test results
GET /tests-status# Run only integration tests:
GET /tests-run-regex?filter_regex=Integration\.Tests\..*&mode=PlayMode
# Run single test:
GET /tests-run-single?test_name=MyNamespace.MyTests.SpecificTest&mode=EditMode
# Run all tests in a namespace:
GET /tests-run-regex?filter_regex=MyNamespace\..*&mode=EditModeHTTP -32603 Errors:
- Unity HTTP server restarting during compilation/asset refresh
- Expected behavior, wait 3-5 seconds and retry
Test Execution Issues:
- Check
/tests-run-statusfor detailed error information - Verify test names and patterns are correct
Compilation Errors:
- Check
/scripts-compile-statusfor error details - Fix compilation issues before running tests
Long-running operations send real-time progress updates when accessed via MCP:
- Assembly count: Shows completed/total assemblies
- Current assembly: Name of assembly being compiled
- Elapsed time: Seconds since compilation started
Example: "Compiled Assembly-CSharp (5/13, 2.3s)"
- Test count: Shows completed/total tests
- Current test: Full name of test being executed
Example: "Running MyProject.Tests.PlayerTests.TestJump (1/6)"
- Shader count: Shows completed/total shaders
- Current shader: Name of shader being compiled
Example: "Compiling Standard.shader (10/50)"
When using the MCP protocol:
- Progress notifications are sent as JSON-RPC notifications (have
methodfield, noidfield) - Final responses have
idfield matching the request - MCP clients should skip progress notifications and wait for the actual response
Status endpoints (/scripts-compile-status, /tests-run-status, /shaders-compile-status) return progress information when operations are in progress:
Example /scripts-compile-status with progress:
{
"status": "compiling",
"isCompiling": true,
"progress": {
"totalAssemblies": 13,
"completedAssemblies": 5,
"currentAssembly": "Assembly-CSharp",
"elapsedSeconds": 2.3
}
}- Check status before operations to avoid redundant work
- Use appropriate timeouts (EditMode: 30s, PlayMode: 60-120s)
- Prefer regex filtering for flexible test selection
- Handle -32603 errors with retry logic
- Monitor test status to avoid duplicate test runs