Pro Onlyv1.1.4+

AI CLI Integration Guide

Control Unity via HTTP API from any AI CLI tool - Claude Code, Gemini CLI, Codex CLI, and more.

Supported CLI Tools

C

Claude Code

Anthropic

Anthropic's official CLI tool. Powerful code generation.

G

Gemini CLI

Google

Google's latest AI model from command line.

O

Codex CLI

OpenAI

OpenAI's code-specialized model.

Any CLI tool that can make HTTP requests works with this API.

How It Works

1

Copy the System Prompt

Pass the system prompt template below to your CLI tool.

2

AI Generates curl Commands

The AI understands your instructions and generates appropriate HTTP API requests.

3

Execute in Unity

Generated commands execute in Unity Editor and return results.

System Prompt Template

Use this template as your CLI's system prompt. The AI will understand how to use the HTTP API.

# Unity Control via Synaptic AI Pro HTTP API

You have access to Unity Editor through the Synaptic AI Pro HTTP API running at http://localhost:8080

## Prerequisites - Start the Server First!

Before using any HTTP API commands, you MUST start the MCP server:

```bash
cd <Unity Project>/Assets/Synaptic\ AI\ Pro/MCPServer && node index.js
```

The server will output "HTTP server listening on port 8080" when ready.
Keep this terminal running while using the API.

## Available Endpoints

### Check Connection
```bash
curl http://localhost:8080/health
```

### List Available Tools
```bash
curl http://localhost:8080/tools
```

### Execute Tool
```bash
curl -X POST http://localhost:8080/tool/{tool_name} \
  -H 'Content-Type: application/json' \
  -d '{"param1": "value1", "param2": "value2"}'
```

## Example Commands

Create a GameObject:
```bash
curl -X POST http://localhost:8080/tool/unity_create_gameobject \
  -H 'Content-Type: application/json' \
  -d '{"name": "MyCube", "type": "cube"}'
```

Create a C# Script:
```bash
curl -X POST http://localhost:8080/tool/unity_create_script \
  -H 'Content-Type: application/json' \
  -d '{"scriptName": "PlayerController", "code": "using UnityEngine;\n\npublic class PlayerController : MonoBehaviour\n{\n    void Start() { }\n    void Update() { }\n}"}'
```

## Workflow
1. First call /tools to see available tools and their parameters
2. Use the appropriate tool endpoint to execute commands
3. Check the response for success/error status

Always verify Unity is running and HTTP Server is enabled in Synaptic AI Pro settings before executing commands.

Usage Examples

Using with Claude Code

Save prompt to file and load:

claude --system-prompt "$(cat unity-prompt.txt)"

Conversation Example

You:Create a capsule for the player character in Unity
AI:Checking /tools, I'll use unity_create_gameobject to create a capsule...
You:Add a Rigidbody component to that capsule
AI:Using unity_add_component to add Rigidbody...

Prerequisites

  • Synaptic AI Pro v1.1.4 or later installed
  • MCP server running (node index.js)
  • Unity Editor open
Back to Documentation
Synaptic AI - Professional AI Tools for Unity & Creative Software