Connect an MCP client
The Model Context Protocol (MCP) lets an agent operate the running simulator. A read-only connection can report channel counters, inspect detected programs, and compare input and post-filter KLV. Full control adds channel and filter edits, start and stop, file management, server administration, and control of a selected browser tab or Windows desktop window.
Enable a connection
- Open the desktop application or open the operator UI on the simulator host at
http://127.0.0.1:8200. In Server settings → MCP, turn on Enable MCP server. Leave Local computer selected for a client running on this host. - To use files, enter an existing absolute MCP media folder on server. The supplied Docker Compose deployment uses host networking. Set paths inside the container, such as
/media, and mount the PEM files read-only for direct LAN TLS. Uploads, folder creation, and deletion require a writable mount. Leave the field empty for network or pattern experiments that do not need files. - Select Apply listener settings. Copy the URL shown after Listening at. The default is
http://127.0.0.1:8201/mcp. For a second simulator on the same host, assign a different port. - Enter a descriptive Token name, choose Read-only or Full control, and select Create token. Copy the secret while it is visible. Use one token per client. To rotate it, create a replacement, reconnect that client, verify
health, then revoke the old entry. Revocation also invalidates OAuth access and refresh tokens issued from that entry.
To manage a headless installation from your workstation, forward the operator port over SSH, for example with ssh -L 18200:127.0.0.1:8200 simulator-host. Open http://127.0.0.1:18200 while the SSH session is active. Changing the MCP listener takes effect immediately. The ordinary web UI and REST port are for trusted operators. Publish only the dedicated MCP listener to agent clients.
Local clients
Codex or another Streamable HTTP client. Enter the listening URL and configure a bearer token. For Codex, supply the raw token through the client environment as STANAG_MCP_TOKEN and run:
codex mcp add stanag-net-sim --url http://127.0.0.1:8201/mcp --bearer-token-env-var STANAG_MCP_TOKEN
For clients with a custom headers field, set Authorization to Bearer followed by the token. Ask the client to call health and report the running version and instance ID. Codex MCP configuration
Claude Desktop on Windows. Open stanag-net-sim.mcpb in the StanagNetSim installation folder and enter the listening URL and token during installation. For other stdio clients, set the command to the installed stanag-net-sim-mcp executable and supply STANAG_MCP_URL and STANAG_MCP_TOKEN in the client's environment. Linux builds place it in bin/ and the Docker image includes it in /app/. The bridge connects to an already running simulator.
Remote clients
Direct LAN HTTPS. Choose Direct LAN HTTPS, select the host interface, and enter the public HTTPS origin including its port, for example https://simulator.example.net:8201. Supply paths on the server to a PEM certificate chain and its private key. The certificate must cover that hostname and be trusted by the client. Apply and connect to the displayed URL.
HTTPS reverse proxy. Choose HTTPS reverse proxy and enter the public origin, such as https://simulator.example.net. The simulator listens on loopback. Forward the entire dedicated hostname to the configured MCP port. Preserve the public Host and Authorization headers. OAuth discovery, consent, token exchange and transfers use paths alongside /mcp. For example, on the simulator host:
simulator.example.net {
reverse_proxy 127.0.0.1:8201
}
Hosted ChatGPT. Add the public HTTPS URL ending in /mcp as a custom connector, select OAuth with ChatGPT’s published client identity, and approve the connection using a simulator token on your simulator's consent page. Its access level follows the token. Open /.well-known/oauth-protected-resource/mcp on the public hostname to check the advertised resource URL. Hosted clients need a reachable HTTPS origin even when the chat browser runs on the simulator PC. For a workspace Secure MCP Tunnel, configure the tunnel to run the pre-authenticated stdio bridge on the simulator host. Hosted MCP setup
Claude or another remote bearer client. Enter the public HTTPS endpoint and supply the same Authorization header used by local HTTP clients. If the client reports a missing tool, check the access level. If the listener fails to start, check port availability, certificate dates, hostname, and server-side file paths.
Run an experiment
- Inspect. Ask “List channels, then report input and output traffic, intentional drops, queue drops and the latest decoded KLV for channel X.” Read
stats.startedand the KLVrunIdwhen comparing samples across restarts. Preview quality comes from active paired monitors. The post-filter tap observes the stream before destination delivery. - Simulate. With full control, ask “Discover the packet loss filter, create a synthetic pattern channel to my test receiver, start it, and apply 1% loss. Report the revision and counters, then stop it.” Supply your receiver's address and confirm delivery there. For a revision conflict, reread the channel and reconcile the edit. A preset's filters and seed can be passed to
apply_simulation. - Operate a window. List UI sessions, identify the desired session ID, and ask for its channel and view. Use
set_ui_viewwith that ID to select a channel, open its video or KLV panel, or close its paired preview.capture_previewreturns one labeled JPEG per available pane, its capture time, media time and run. A stopped or undecoded pane reports its state. Capture times are independent. Finish unsaved operator edits before directing the agent to a different channel. - Transfer media. Use
list_mediafor root-relative paths and full server source paths.upload_mediareturns an HTTPS or local HTTP destination for a multipart POST with afilefield.download_mediareturns a GET URL. The transferring client must attach its Authorization header to each request. Uploads allow up to 4 GiB including framing and preserve existing files. Read-only credentials can download. Full control can upload and delete individual files or empty folders. File and PCAP sources and Unix socket endpoints must lie inside the designated folder. Clients limited to MCP tool calls can useread_media_chunkfor chunked downloads andwrite_media_filefor uploads up to 256 KiB. Native decoding of a scoped non-TS file uses temporary disk space equal to the source size. - Administer. Inspect update and license status with either access level. Full control can change settings, install a license, check for a signed update, install a specific available version, or restart a standalone backend. Credential fields in tool results show
[stored credential]. Keep that value to preserve a secret during an edit. Enter new credentials when changing a protected destination. Reconnect after an accepted restart or installation.