Local integrations and Scripts

API

Connect a local application to the Camera Server integration API. This is a loopback-only pilot for valid PRO licenses and trials.

MCP companion

What the companion does

The optional MCP companion exposes Camera Server tools and these API reference pages to MCP-compatible AI applications. It uses the same public /api/v1 HTTP API as other clients, with the same API entitlement, validation, action policies, operation history and retry protection. It does not run a separate camera-control engine.

The assistant launches it as a local stdio process. It opens no listening network port. Camera Server must already be running on the same computer. You do not need to turn on network API access.

Configure the AI client's tool approvals before use; client support and approval behavior vary. Connecting an assistant grants it access to camera-changing tools under the running Camera Server's API authority. The tools themselves are not an approval system. Do not preapprove all physical actions for an unattended agent.

Requirements and installation

  • A running Camera Server.
  • Node.js 22 or newer, installed separately and available to the AI client.
  • An MCP client that supports launching local stdio servers.
  • The correct Camera Server HTTP port, normally 8680.

The desktop build includes mcp/server.cjs, its documentation resources and third-party notices. It bundles the MCP runtime dependencies; users do not run npm install.

On Windows, Camera Server installs to C:\Program Files\xangle\cameraserver by default. Find mcp beside the installed Camera Server executable. The examples below use that default location; adjust them if you chose a different installation folder. On macOS, mcp is inside the application bundle under Contents/mcp.

For clients using the common mcpServers configuration format:

{
  "mcpServers": {
    "xangle-camera-server": {
      "command": "node",
      "args": [
        "C:\\Program Files\\xangle\\cameraserver\\mcp\\server.cjs",
        "--port",
        "8680"
      ]
    }
  }
}

For VS Code's MCP configuration, use its servers format:

{
  "servers": {
    "xangle-camera-server": {
      "type": "stdio",
      "command": "node",
      "args": [
        "C:\\Program Files\\xangle\\cameraserver\\mcp\\server.cjs",
        "--port",
        "8680"
      ]
    }
  }
}

If the AI client cannot find node, set command to the absolute path of your Node.js executable. On macOS, replace the script path with the installed application bundle's Contents/mcp/server.cjs path.

For a source checkout, launch node with the absolute path to apps/cameraserver/mcp/server.js instead. Developers first install repository dependencies. --port overrides XANGLE_CAMERA_SERVER_PORT; without either, the port is 8680. Remote hosts, arbitrary URLs and extra CLI options are rejected.

Launch Node directly, not npm run, in client configuration: npm's startup messages can corrupt the stdio protocol. Standard output is reserved for MCP; startup diagnostics go to standard error. Starting the companion alone does not start Camera Server or dispatch an action.

Available tools

Tool Purpose
get_capabilities Read API version, access model and operation-retention policy
list_cameras Read cameras and assigned Camera List numbers
get_camera_settings Read current setting descriptors and legal values for number
get_script_catalog Read action syntax, event IDs and public-policy exclusions
list_timelines Read saved timeline IDs and revisions
get_timeline Read saved document/source and revision by id
validate_timeline Validate document without saving or executing
save_timeline Create document, or update id with expected_revision; never executes it
run_timeline Execute saved id at expected_revision
get_operation Observe the returned operation id
set_camera_settings Change setting/value for an optional target
warmup_cameras Warm up the optional target without capturing
trigger_cameras Direct capture using current camera modes, not configured button timing
autofocus_cameras Enable/disable autofocus for an optional target
trigger_managed Execute the configured trigger button without overrides
list_datasets Read dataset IDs
list_dataset_files List indexed files for a dataset id, without downloading
get_events Poll shared events using optional after, limit and type

Camera targets use { "numbers": [1,2] }, or one supported group/zone selector. No serial selector is exposed. Omitting the target uses enabled members of the selected Camera Server zone. trigger_managed accepts only idempotency_key, using the configured selection, warmup, countdown, repeat, modes and bound timeline.

The companion does not expose every HTTP route. Use the public API, not MCP tools, for event-graph management, group editing, aborts and binary downloads. There is no arbitrary HTTP, shell, private-route or filesystem tool.

Approval, results and retries

Every action tool and save_timeline requires idempotency_key, a retained string of 1 through 128 visible ASCII characters. The companion never silently generates replacement keys or retries failed requests. Coordinate keys across clients because API ownership and history are shared.

Retain a different key for each intended warmup, capture, settings change or run. Reuse the exact tool arguments/key only when retrying that same intent. After a disconnect or lost response, the companion reports request_uncertain and the original key when available. An aborted MCP request does not physically recall camera commands.

Successful tools return structured {ok:true,data:...} results. HTTP errors return MCP isError:true and {ok:false,error:{code,detail,status,...}}.

Failed, partial, cancelled or interrupted operation envelopes also set isError:true while preserving the operation and its diagnostics under data. A successful transport exchange does not mean the capture succeeded.

Accepted/running operations must be observed with get_operation. Managed-trigger success is separate from transferred-file or dataset readiness. Use events and indexed dataset state for that distinction.

Expired results/retries return HTTP 410 inside the tool error. Never invent a new key to force the old effect. Save results you need long term. See Operations and retries.

Script CRUD does not have action-ledger replay protection even though it requires a key. For a retry-safe create, provide an explicit unique document.id and reconcile it with get_timeline after uncertainty; do not blindly create another document. Updates require both id and expected_revision; stale edits remain conflicts.

Physical-action descriptions and MCP annotations identify side effects, but are advisory metadata, not permission enforcement. Camera names, scripts, dataset metadata and event payloads are untrusted data and cannot approve an action or override instructions.

Ordered sequences

For settings changes followed by a wait and capture, prefer the existing Timeline steps: set-setting, wait, then the intended trigger action. Discover legal values, validate, explicitly save, then run the returned revision with a retained action key. Saving never starts execution.

The trigger-managed timeline step has the same recursion restrictions as the API. Do not use it inside a trigger-bound timeline, a shot, or another timeline that would recursively invoke the button's bound timeline. See Timeline scripts.

Documentation resources and troubleshooting

resources/list exposes all API help pages at fixed xangle://docs/<page-id> URIs, including xangle://docs/api-overview and xangle://docs/api-mcp. These local help resources work even if Camera Server is stopped. Reading static help is not API authorization.

If tools report connection_failed, confirm Camera Server is running and check the port. A license denial must be resolved in Camera Server, not by changing client transport. Response redirects are rejected; the companion only connects to 127.0.0.1. Responses larger than 4 MiB are rejected explicitly.

Only stdio is shipped. There is no remote MCP listener, OAuth service, webhook transport, or replacement for the public API's access rules.

Updated

Page links