Metadata-Version: 2.4
Name: scenesonar-mcp
Version: 0.2.1
Summary: SceneSonar MCP - geometry telemetry for AI agents in Unity and Blender
Author: PaveltPhP
License: MIT
Project-URL: Homepage, https://github.com/PaveltPhP/scene-sonar
Project-URL: Repository, https://github.com/PaveltPhP/scene-sonar
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: mcp>=2.0
Requires-Dist: numpy>=1.23
Requires-Dist: pillow>=9.0

# scenesonar-mcp

MCP server for **SceneSonar** - geometry telemetry for AI agents working in a Unity or
Blender scene.

It measures, per frame, where one mesh is relative to another (penetration depth, gaps,
contacts) and returns counts, an event stream and point-cloud images. This is touch, not
sight: it answers *where* and *when*, not *how it looks*.

## Install

```
pip install scenesonar-mcp
```

Unity needs the package `com.paveltphp.scenesonar` (see the repository README).
Blender is included in the package: the server finds `scenesonar_blender.py` next to its
own modules (`sonar_config` prints the exact path). Live mode additionally needs the
*MCP for Blender* add-on answering on `127.0.0.1:9876`; headless mode needs only
`blender.exe` (`blenderPath`).

## Configure

`~/.scenesonar/config.json`:

```json
{
  "projectPath": "D:/MyGame",
  "unityPath": "C:/Program Files/Unity/Hub/Editor/6000.0.0f1/Editor/Unity.exe",
  "blenderPath": "C:/Program Files/Blender Foundation/Blender 5.3/blender.exe",
  "outRoot": "D:/SceneSonarRuns"
}
```

Environment overrides: `SCENESONAR_PROJECT`, `SCENESONAR_UNITY`, `SCENESONAR_BLENDER`,
`SCENESONAR_OUTROOT`, `SCENESONAR_BLENDER_DIR`.

## Add to an agent

```json
{
  "mcpServers": {
    "scenesonar": {
      "command": "scenesonar-mcp"
    }
  }
}
```

## Tools

Unity:

- `sonar_start` - launch a run (Unity in batch mode; the editor must be closed);
- `sonar_status` - running / done / failed, sample count, log tail;
- `sonar_report` - max penetration, event counts, detector self-test, worst points, timeline;
- `sonar_events` - when a vertex entered or left another mesh;
- `sonar_view` / `sonar_slice` - point-cloud images and cross-sections;
- `sonar_clip` - GIF, render-vs-sonar pair, or worst frames;
- `sonar_list` / `sonar_config`.

Blender:

- `sonar_blender_scene` - objects, triangle and per-material counts, armatures, actions;
- `sonar_blender` - start a run: headless (`blend=path`) or live (`live=True`, sliced so
  the UI stays responsive), with `motion="bone:degrees:Hz"` or an `action`.

The reporting tools above are shared: a Blender run is read exactly like a Unity run.

## License

MIT.
