# 1998: Level Editor · Unity MCP / Unity CLI setup and sample prompts

**Supports Unity MCP and Unity CLI. Bring your own compatible coding assistant.** The optional Unity Pipeline integration exposes 1998's authoring tools in your local Unity Editor; your assistant supplies the AI through your own account.

These are the three prompts used in the [recorded authoring sessions](./mcp-trace.json). The calls edited real Unity maps, then checked, built and saved their geometry. The browser shows their built results; it does not run a language model or a live MCP server.

**These workflows use 1998: Level Editor version 1.1.** An AI model or AI subscription is not included with 1998. Use your own compatible AI assistant and its normal account setup.

## Connect rooms

> Using this six-room shell, connect the spaces into a loop with six 2 m-wide, 2.65 m-high doorways. Keep 3.8 m ceilings and 24 cm solid walls. Give the connecting hall a teal floor and the store an indigo floor. Inspect shared walls, preview edits, validate, build and save the scene.

The recording starts with an authored six-room shell. The assistant inspects its stable wall IDs, previews and creates six managed doorways, assigns floor materials, then checks, builds and saves. The final inspection contains six connected rooms, six doorways, 3.8 m ceilings and 0.24 m wall depth.

## Add verticality

> Using the courtyard shell, raise Upper gallery and Landing to 3 m. Keep the courtyard open to the sky. Generate a 3 m-wide staircase over a 6 m run, with 20 cm maximum risers and 3.8 m headroom. Connect the entrance rooms, tint the gallery indigo and validate the result before building and saving.

The starting shell already contains the courtyard, gallery and landing outlines. The recorded commands raise the upper floors, create 15 stepped sectors, disable their ceilings, add two doorway connections, assign materials, then check, build and save. The stair command uses `sourceElevation:0`, `destinationElevation:3`, `run:6`, `width:3` and `maxStepHeight:0.2`.

Checks and geometry Build passed with warnings retained in the trace, including large floor drops at other boundaries and long sightlines. These reports do not certify player movement or AI navigation. Navigation baking was explicitly disabled in all three sessions.

## Revise the brief

> Revise a copy of the connected six-room level: widen all six doorways to 2.8 m, increase opening height to 2.9 m and ceilings to 4.2 m. Recolor the circulation floors amber and the workshop teal. Keep the room layout and doorway identities. Preview resizing, validate, build and save.

The recording edits a prepared copy of the first result. It raises the ceilings, previews and resizes all six existing doorways, recolors the floors, then checks, builds and saves. The final inspection retains the same six doorway IDs with the new dimensions. Scene opening and preparation of that copy use separate Unity Pipeline tools; the copy helper is recording setup, not a built-in `level1998` command.

## Set up your local assistant

1. Install 1998 1.1 when the Asset Store update is available. Create or open a saved level workspace in Unity. The ordinary Level Studio UI and geometry Build work without the optional automation packages.
2. Install the optional `com.unity.nuget.newtonsoft-json` and `com.unity.pipeline` packages in that project. This recording used **Newtonsoft JSON 3.2.2**, **Unity Pipeline 0.6.0-exp.1** and **Unity Editor 6000.6.0f1**. The 1998 integration accepts Newtonsoft 3.x and Pipeline versions from 0.6.0-exp.1 up to, but excluding, 0.7.0; that activation range is not a claim that every version was tested. Pipeline is experimental.
3. Install Unity's CLI following its [official Unity CLI instructions](https://docs.unity.com/en-us/unity-cli/use-unity-cli). The package can also be installed with `unity pipeline install --project-path "<project>"`. Keep the intended Unity Editor open and let compilation finish.
4. In your AI client's MCP settings, add a **local stdio server** whose command is `unity` and whose arguments are `mcp`, `--project-path`, and your absolute project path. The client launches the server process. Use the CLI executable's absolute path if it is not on the client's PATH.

The server command is:

```text
unity mcp --project-path "C:/Projects/MyUnityProject"
```

For clients that use this JSON configuration format, copy the following into their MCP settings and replace the project path. Other clients expose the same fields in their settings UI:

```json
{
  "mcpServers": {
    "unity": {
      "command": "unity",
      "args": ["mcp", "--project-path", "C:/Projects/MyUnityProject"]
    }
  }
}
```

This is a manual configuration example. The webpage does not install software, connect an AI account or insert credentials into your client. No model API key belongs in this example; your AI client handles its own provider authentication. Unity's CLI handles the local Editor connection. See Unity's [connectivity documentation](https://docs.unity3d.com/Packages/com.unity.pipeline@0.6/manual/connectivity.html) if the intended Editor is not discovered.

## Use Unity CLI directly

For a coding assistant with terminal access, use Unity CLI directly with the same local Editor and optional packages. The MCP client configuration above is only needed for the MCP route.

Save a UTF-8 request file, for example `C:/Requests/schema.json`, containing:

```json
{"command":"schema"}
```

Then run:

```text
unity command --project-path "C:/Projects/MyUnityProject" level1998 --request_file "C:/Requests/schema.json"
```

Replace both paths with your own. Subsequent requests use the same authoring commands and revision checks as MCP. Your coding assistant translates your brief into those requests; Unity CLI executes them in the local Editor.

## Discover the authoring tool over MCP

Ask the connected assistant:

> List the available MCP tools and find `level1998`. Request its schema, list the saved workspaces, then inspect the workspace I select. Before making changes, use its current revision and preview the proposed geometry edits.

The recording's `tools/list` exposed `level1998` with two optional string arguments: `request` and `request_file`. Choose one. An empty request returns the schema. This JSON-RPC example wraps the exact schema request used in the recording:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "level1998",
    "arguments": {
      "request": "{\"command\":\"schema\"}"
    }
  }
}
```

`request` contains serialized JSON text, not a nested object. Your MCP client normally constructs the outer JSON-RPC message. Subsequent inner requests begin with:

```json
{"command":"workspace.list"}
```

```json
{"command":"inspect","workspace":"Assets/Levels/MyLevel/Workspace.asset"}
```

Use your actual workspace path. `inspect` supplies the current revision and stable layer, sector, wall and doorway IDs. Every mutation requires that current `expectedRevision`; use the revision returned by each successful response for the next edit. Preview with `dryRun:true`, then commit the same operation against the current revision. A preview does not modify the source or advance its revision. A stale revision is rejected.

The recorded sessions finish with `validate`, `build` using `bakeNavigation:false`, and explicit `save` using `scene:true`. Check the inner command's `success` and the validation/build report's `passed` value. Keep reported warnings visible. Tool transport success alone does not mean the level passed its checks.

The prompts rely on suitable prepared maps and existing materials. The current `level1998` schema has no command that generates arbitrary room layouts from an empty project, manufactures 3D props or interprets natural language by itself. The assistant translates your brief into the supported authoring commands. Use the recorded prompts as starting briefs for your own saved levels, with the assistant inspecting their actual dimensions and IDs first.
