Connect Claude or GPT to ApertureLab, right on your desktop.

The ApertureLab MCP Server is a desktop program that connects a large language model to ApertureLab. Through it, Claude, GPT or a model running locally can design a sonar scene, run the simulator and beamformer on the workstation's own GPU, and read back the finished image. It uses the Model Context Protocol, so any client that supports the protocol connects to it without additional code.

The protocol

The Model Context Protocol

The Model Context Protocol (MCP) is an open standard, introduced by Anthropic in November 2024, for connecting language-model applications to external tools and data. A server publishes a list of tools, each with a name, a description and the arguments it takes. A client, such as Claude Code or Codex, reads that list, passes it to the model, and carries out the calls the model decides to make.

The choice of model is left to the user. The model behind the client can be one hosted by its provider, such as Claude or GPT, or one that runs entirely on the workstation.

Architecture

How a model reaches the simulator

ApertureLab MCP Server architecture Step 1, a language model: Claude, GPT, Grok, an OpenRouter model, or a local LLM, hosted at a provider or on the workstation. Step 2, an MCP client on the workstation such as Claude Code, Codex CLI, Cline, Goose or LM Studio. Step 3, the client sends tool calls over MCP to the ApertureLab MCP Server and receives results and images. The same client can also reach environmental models through a second MCP server. Step 4, the server drives the ApertureLab engine, which runs on the workstation's GPU. Step 5, the scene file and images are written to files on disk. Your workstation Language model Claude GPT Grok, OpenRouter or a local LLM at a provider, or on this machine MCP client Claude Code Codex CLI Cline · Goose LM Studio MCP tool calls → ← results and images ApertureLab MCP Server 24 tools one GPU job queue ApertureLab engine validator, preview simulator beamformer runs on your GPU Files on disk scene YAML sonar image SLC, raw HDF5 MCP Your environmental models wave, sediment, bathymetry a second MCP server 1 2 3 4 5 ApertureLab MCP Server architecture Your workstation Language model Claude, GPT, Grok, OpenRouter, or a local LLM at a provider, or on this machine MCP client Claude Code, Codex CLI Cline, Goose, LM Studio MCP tool calls ↓ results, images ↑ ApertureLab MCP Server 24 tools, GPU queue Environmental models a second MCP server ApertureLab engine validator, preview, simulator, beamformer runs on your GPU Files on disk scene YAML, sonar image, SLC, HDF5 1 2 3 4 5
The language model runs at its provider or on the workstation itself. The MCP client carries the model's tool calls to the ApertureLab MCP Server and returns the results and images; the same client can reach other MCP servers, such as one that serves an environmental model. The server, the engine on the GPU and the files all stay on the workstation.

The MCP Server listens only on the loopback address, 127.0.0.1, on port 8737, so nothing outside the workstation can reach it. The client sends each tool call over Streamable HTTP; the server applies it to one shared scene session, runs heavy work such as terrain previews off its event loop, and queues simulations for the local GPU one at a time. Every result that names a file gives its path in the session folder, so the scene file and the images remain ordinary files that can be opened, versioned or re-run without the model.

The model never touches the GPU or the file system directly. It sees tool descriptions and tool results, and the server decides what each call is permitted to do, including fixed limits on scene size and scatterer density that hold whatever the model requests.

Throughput

More scenes in less time, with fewer failed runs

Authoring a scene by hand means writing a YAML file against the full scene schema: seafloor zones, relief operators, objects and their burial, the imaging geometry and the run settings. A language model connected to the server does that designing and writing. It looks up the schema and the reference documentation through the server's describe tools, and it is instructed to validate every scene and preview the terrain before it asks for GPU time.

Before any simulation starts, the server checks the scene with the same validator the desktop application uses. The validator rejects a scene with invalid or contradictory settings, and it estimates the memory the run will need and compares that with the RAM free on the workstation. A scene that would fail is therefore caught in seconds, and the model is told why, instead of the failure appearing after minutes of simulation.

The person's part is to describe the scene and check the preview. A request for a rippled sand plain with a boulder field at mid-range and a pipeline crossing the swath, for example, is turned by the model into a complete scene file that the validator has accepted before anything runs, and the person never edits the YAML.

Automation

Simulation with a language model in the loop

Because the server is reached through a protocol rather than a chat window, a session can run unattended. Claude Code and Codex both run headless from a script, so a batch job can ask the model for a family of scenes, such as one seafloor imaged at ten grazing geometries or with an object's burial stepped from exposed to fully covered, and let it create, validate and run each one in turn.

The loop also closes on the output. The look_at_result tool returns the finished sonar image to the model, which can then check whether the object it placed is visible, whether its shadow falls where the geometry predicts, and whether the terrain reads as intended, and revise the scene before the next run. Each run leaves its scene file and images in the session folder, so the batch can be reproduced afterwards without the model.

Integration

Scenes from environmental models

An MCP client can connect to several servers at once, and the model can call tools from all of them in one conversation. A group that already runs environmental models, such as a wave model, a sediment grain-size map or a bathymetry database, can expose them through their own MCP server or as files. The model then composes scenes from their outputs: the seabed type from the sediment map, the ripple wavelength and orientation from the wave conditions and grain size, and the relief from the bathymetry. The ApertureLab tools accept zone grids and meshes by file path, so gridded products and 3D models from other tools enter a scene directly.

This places the simulator inside a larger modeling chain. When the environmental model updates its forecast or moves to a new survey area, the language model regenerates the matching sonar scenes, and the simulated imagery follows the environment it is meant to represent.

The application

The MCP Server window

The server is its own entry in the ApertureLab folder of the Start menu. Its window shows the address clients connect to, the state of the GPU queue, the session folder, connection settings for each supported client ready to copy, and one log line for every tool call with its client, arguments, outcome and duration. Closing the window stops the server and any simulation it has running.

The ApertureLab MCP Server window: a green status line with the server address, a GPU status line showing a pilot job running, the session folder with an Open folder button, tabs of connection settings for Claude Code, Codex CLI, Cline and Goose, and LM Studio with a Copy button, and a call log of a Claude Code session from get_started through paint_zones, patch_scene, validate_scene and preview_scene to run_scene
The MCP Server window during a headless Claude Code session. The model read the instructions, looked up the bottom types, objects, rocks and outcrops, painted the seafloor zones, placed the objects, validated the scene and previewed the terrain, then queued a pilot run at 200 scatterers per square meter, which the status line shows running on the GPU. It then raised the density to 20,000 and ran the scene again.
A synthetic aperture sonar image of a patchwork seafloor of sand, rippled sand, mud, gravel and shell hash, with a container, a car, a small boat, tires, barrels and other objects scattered across it, each with its shadow, and a rock outcrop in the lower middle
The final image from that session, 80 m along track by 100 m in range at 20,000 scatterers per square meter. The seafloor is a patchwork of sand, rippled sand, mud, gravel and shell hash painted as zones with irregular outlines. Eighteen man-made objects, among them a container, a car, a small boat, tires, barrels and a pipe, are scattered across the swath together with a rock outcrop and a sparse scatter of boulders.

Setup

Connecting a client

With the MCP Server running, each client needs one entry that points at its address. The window shows the same settings with the port it is actually using.

Claude Code
claude mcp add --transport http aperturelab http://127.0.0.1:8737/mcp
Codex CLI
In ~/.codex/config.toml:
[mcp_servers.aperturelab]
url = "http://127.0.0.1:8737/mcp"
LM Studio
In mcp.json (version 0.3.17 or later):
{ "mcpServers": { "aperturelab": { "url": "http://127.0.0.1:8737/mcp" } } }
Cline and Goose
Add a remote server of type Streamable HTTP with the URL http://127.0.0.1:8737/mcp. Either agent can use a model from OpenRouter, which gives access to Grok and other hosted models.

Limits

Limitations

The MCP Server is distributed with the ApertureLab Windows installer and simulates on the workstation's NVIDIA GPU.

The server is meant to be used by a language-model client, such as Claude Code or Codex, running on the same workstation. It listens only on the loopback address and has no authentication of its own, so anyone logged in to that machine can reach it.

Web chat applications such as claude.ai and ChatGPT cannot reach a server on the loopback address, and Claude Desktop is not supported. The supported clients are Claude Code, Codex CLI, Cline, Goose and LM Studio.

The Blender scene import tools are not available through the MCP Server; a Blender scene is imported from the desktop application's File menu instead.

A local model must support tool calling and have a context window large enough for the server's instructions, which are about 7,000 characters, together with the descriptions of its 24 tools.

Next: the desktop workbench, or what a scene file contains.