Documentation Index
Fetch the complete documentation index at: https://crsdk.app/llms.txt
Use this file to discover all available pages before exploring further.
1. Initialize your project
Create a new project directory and initialize it:
mkdir my-camera-app && cd my-camera-app
npm init -y
npm pkg set type=module
camera-remote-web-api is an ESM-only package. Setting "type": "module" in your package.json enables ES module syntax (import/export) which is required to use the SDK.
2. Install the SDK
npm install camera-remote-web-api
During installation, you’ll be prompted to accept the Sony Camera Remote SDK license agreement. The native binary for your current OS is downloaded automatically.
If you need to target platforms other than your current machine (e.g., deploying to Linux from macOS):
npx camera-server platforms # List available platforms
npx camera-server install --platform linux-x64 # Install a specific platform
npx camera-server install --platform linux-arm64
npx camera-server install --platform win32-x64
| Platform | Architecture | Package |
|---|
| macOS | Apple Silicon (ARM64) | @alpha-sdk/darwin-arm64 |
| Linux | x64 | @alpha-sdk/linux-x64 |
| Linux | ARM64 | @alpha-sdk/linux-arm64 |
| Windows | x64 | @alpha-sdk/win32-x64 |
4. Check dependencies
Run the doctor command to verify your environment has all required dependencies:
Requirements
- Node.js 18+
- Camera: Sony camera with Remote SDK support (USB or network)
- Windows: libusbK 3.0 driver required for USB connections
- macOS: macOS 14+ (Sonoma)
- Linux: Ubuntu 20.04+ or equivalent
5. Install MCP servers (optional)
Configure AI-powered SDK documentation search for Claude Code, VS Code, or Cursor:
This walks you through installing the AI SDK Assistant and AI Camera Assistant MCP servers. See the MCP Server quickstart for details.
6. Verify setup
Check that everything is installed correctly:
Running the camera server
Once the package is installed, use the CLI to run the camera server in the background. Your app (Node.js, browser, or anything that speaks HTTP) then connects to it as a pure client.
Start the server
npx camera-server start # Start on default port 8080
npx camera-server start --port 9090 # Start on a specific port
npx camera-server start 9090 # Shorthand for --port 9090
start spawns CameraWebApp as a detached background process — it keeps running after the CLI exits. You can close your terminal and the server stays up.
- Without
--port, it defaults to 8080 and auto-increments (8081, 8082, …) if the port is taken.
- With an explicit
--port N, it uses exactly that port and errors if it’s already in use.
Check status
npx camera-server status # Discover ALL running camera servers
npx camera-server status --port 9090 # Status of a specific server
status (with no port) discovers every running CameraWebApp instance regardless of port, queries each one, and reports SDK version, uptime, and connected camera count. Useful when you’re running multiple instances or aren’t sure which port a server is on.
Stop the server
npx camera-server stop # Stop ALL running servers
npx camera-server stop --port 9090 # Stop a specific server
stop first tries a graceful shutdown via the /api/server/shutdown endpoint, then falls back to SIGTERM/SIGKILL if needed. It only kills the actual listening process — browser tabs connected to the server are left untouched.
Interactive TUI
Run npx camera-server with no arguments to launch an interactive terminal UI:
Inside the TUI you can type commands (start, stop, status, etc.) with Tab autocomplete, press / to browse the command list, or Esc to exit.
Typical workflow
npm install camera-remote-web-api # Install package (binary auto-downloads)
npx camera-server start # Start the server in the background
npx camera-server status # Verify it's running
# ... your app connects to http://localhost:8080 ...
npx camera-server stop # Stop the server when done
Don’t manage the server lifecycle from both the CLI and code at the same time. If you use npx camera-server start, don’t also call ServerManager.start() from your application — otherwise the two will fight each other (one respawning what the other kills). Pick one: CLI for interactive / deployment, ServerManager for fully programmatic control.
CLI Reference
All available camera-server commands:
# Server management
npx camera-server start [--port <number>] # Start the camera server
npx camera-server stop [--port <number>] # Stop (all by default, or a specific port)
npx camera-server status [--port <number>] # Show running server(s)
# Setup and diagnostics
npx camera-server info # Version and binary info
npx camera-server install [--platform <name>] # Install platform binary
npx camera-server uninstall [--platform <name>] # Remove platform binary
npx camera-server doctor # Check system prerequisites
npx camera-server platforms # List available platforms
npx camera-server docs # Open API docs in browser
# MCP and authentication
npx camera-server mcp # Interactive MCP setup
npx camera-server mcp status # Show configured MCP servers
npx camera-server mcp install <agent> <scope> [server] # Install MCP server config
npx camera-server auth login # Authenticate with Athena
npx camera-server auth status # Check auth status
npx camera-server auth logout # Sign out
npx camera-server athena-bridge install <agent> <scope> # Install AthenaBridge MCP
MCP install arguments
| Argument | Values |
|---|
agent | claude-code, vscode, cursor |
scope | user, project |
server | CameraRemoteSDK, CameraWebAPI, CameraHelp, or --all |
Package Exports
The npm package has two entry points:
| Import | Environment | Includes |
|---|
camera-remote-web-api | Browser + Node.js | CameraManager, CameraClient, EventStream, all types |
camera-remote-web-api/server | Node.js only | CameraManager (server), ServerManager, LiveViewStream, CameraServer |
// Browser-safe (no Node.js dependencies)
import { CameraManager, CameraClient, EventStream } from 'camera-remote-web-api';
// Node.js only (spawns binary, uses WebSocket)
import { CameraManager, ServerManager, LiveViewStream } from 'camera-remote-web-api/server';
The CameraManager exported from camera-remote-web-api/server is a different class than the one from camera-remote-web-api. The server variant includes binary management (start() is async, getPort(), getPid(), etc.).