--- title: "How it works" description: "How a request travels from you to your camera: Studio, MCP, the CLI or your own code ask Slate, and Slate speaks the camera's own protocol, PTP." url: https://darkgrade.com/docs/overview/how-it-works last_updated: 2026-12-04 docs_index: https://darkgrade.com/docs/llms.txt --- # How it works > How a request travels from you to your camera: Studio, MCP, the CLI or your own code ask Slate, and Slate speaks the camera's own protocol, PTP. > ## Documentation Index > Fetch the complete documentation index at: https://darkgrade.com/docs/llms.txt > Use this file to discover all available pages before exploring further. Darkgrade runs a Sony, Canon or Nikon camera from a computer, and everything in it goes through **Slate**, the TypeScript library that talks to your camera in the camera's own language. [Studio](https://darkgrade.com/docs/studio.md), [MCP](https://darkgrade.com/docs/ai.md) and the [CLI](https://darkgrade.com/docs/cli.md) are built on it, so what you learn in one product works in the other three, on every supported brand. ## What this means for you - **One name per idea.** Sony's Creative Look, Canon's Picture Style and Nikon's Picture Control are all one setting, [Look](https://darkgrade.com/docs/functionality/color.md#look). The [vocabulary](https://darkgrade.com/docs/slate/getting_started/vocabulary.md) lists every brand's own word for each. - **One spelling per value.** `f/4`, `ISO 1600` and `Daylight` are written the same on every brand. - **Modes are handled for you.** If a photo needs the camera in photo mode, Darkgrade switches, takes it, and switches back. - **Sent once, then confirmed.** A shutter press or a record command is never sent twice. If a result can't be confirmed, you are told so. - **The camera says what it can do.** One question, [what the camera can do](https://darkgrade.com/docs/functionality/connection.md#what-the-camera-can-do), returns every setting, its current choices, and which operations work right now. ## Four products, one path ```mermaid flowchart LR studio["Studio"] --> slate mcp["MCP"] --> slate cli["CLI"] --> slate code["Your code"] --> slate slate(["Slate"]) --> camera["Your camera (PTP over USB)"] ``` You ask for something in the product that suits you. That product passes the request to Slate. Slate turns it into your camera brand's commands, sends them, and confirms the camera did it. - **Studio** holds the camera while it's open. Its controls, [live view](https://darkgrade.com/docs/studio/live-view.md), recording and [card browser](https://darkgrade.com/docs/studio/card.md) call Slate directly, and its [voice control](https://darkgrade.com/docs/studio/voice.md) turns what you say into the same operations. - **MCP** is a set of [tools](https://darkgrade.com/docs/ai/tools.md), one per operation, that an AI app such as Claude can call. There are three ways to serve them. Studio serves them when you turn on **Let AI apps control the camera** in its [Settings](https://darkgrade.com/docs/studio/claude.md), so Claude runs the camera Studio has open. The CLI serves them from one command, [`darkgrade mcp`](https://darkgrade.com/docs/cli/mcp.md), which holds the camera itself with no Studio and no code. Developers can [write their own server](https://darkgrade.com/docs/ai/server.md#write-the-server) with Slate. - **The CLI** opens the camera, runs one operation and closes it again, so each command stands alone in a script. - **Your code** imports [Slate](https://darkgrade.com/docs/slate.md) and calls [`Camera`](https://darkgrade.com/docs/slate/getting_started/camera.md) itself. Every product connects over USB. Slate can also open a camera [over Wi-Fi](https://darkgrade.com/docs/slate/getting_started/ptp-ip.md); the other three cannot. ## Follow one request Here is what happens when you set the ISO, from the moment you ask. #### 1. You ask, in your product's way All four are the same request: ```text Studio Click the microphone and say: “Set ISO to 800” ``` ```text MCP Ask Claude: “Set ISO to 800” → camera_set_iso { "value": "ISO 800" } ``` ```bash CLI npx darkgrade camera set-iso 'ISO 800' ``` ```typescript Slate await camera.setIso('ISO 800') ``` #### 2. Slate checks it against the camera Slate asks the camera what it offers right now: its mode, lens and firmware all change the choices. A value the camera isn't offering is refused here, with the reason, and the setting is never written. #### 3. Slate says it in your brand's words ISO is a different code on every brand. Slate picks the right one for your camera and sends it once. #### 4. The camera answers, and Slate confirms Slate reads the setting back from the camera. You get the value the camera now reports, so *done* means the camera really changed. Taking a photo, recording and downloading a file follow the same path. A photo is confirmed by its new file, and a recording by the finished clip on the card. ## Your camera speaks PTP Cameras talk to computers in a standard protocol called **PTP**, the Picture Transfer Protocol (ISO 15740). It is how a computer imports photos over USB, and it can do much more: - **Operations** tell the camera to do something: take a picture, send a file. - **Properties** are its settings: ISO, aperture, white balance. - **Events** are the camera telling the computer something changed: a new file is on the card. Each manufacturer adds its own codes on top for live view, focus, video and most settings. That is why camera software is usually made for one brand. Slate has a driver for Sony, one for Canon and one for Nikon, and picks the right one when it connects. You never need to know PTP to use Darkgrade. If you're curious, [What is PTP?](https://darkgrade.com/docs/slate/getting_started/what-is-ptp.md) explains the protocol, and the [glossary](https://darkgrade.com/docs/overview/glossary.md) has the other words these docs use. ### For developers: drivers, errors and raw protocol access - **Drivers.** `Camera` chooses a Sony, Canon or Nikon driver from the USB device it opens. Other brands Slate knows (Fujifilm, Panasonic, Olympus and OM System, Leica, Sigma) open with a driver for standard PTP plus that brand's codes, and any other PTP camera with the standard driver alone. [Camera compatibility](https://darkgrade.com/docs/slate/getting_started/camera-compatibility.md#other-brands) says what that covers. - **Capabilities.** [`getCapabilities()`](https://darkgrade.com/docs/functionality/connection.md#what-the-camera-can-do) returns `controls` (each setting's value and `allowedValues`) and `operations` (whether each can run now, with a `reason` when it can't). Read it instead of checking the model name. - **Errors.** Every failure is one of three types: `CameraUnsupportedError` (nothing was sent), `CameraRefusedError` (the camera said no) or `CameraOutcomeUnknownError` (sent, not confirmed, never resent). See [Errors and recovery](https://darkgrade.com/docs/slate/guides/errors.md). - **Events.** `camera.on('settingsChanged' | 'mediaAdded', handler)` fires when a setting changes on the camera or a new file lands. See [Events](https://darkgrade.com/docs/slate/guides/events.md). - **Wi-Fi.** Canon, Nikon and other PTP cameras connect over a network with PTP/IP; Sony uses its own SDK. See [Wi-Fi with PTP/IP](https://darkgrade.com/docs/slate/getting_started/ptp-ip.md). - **Under `Camera`.** Raw PTP commands and property codes are on `protocolSession(camera)`. See [Raw protocol access](https://darkgrade.com/docs/slate/guides/protocol.md) and the [PTP reference](https://darkgrade.com/docs/slate/ptp-reference.md). ## Next > [card] [Find your product](https://darkgrade.com/docs/overview.md#which-one-are-you) > > Studio, MCP, the CLI or Slate: which one fits you. > [card] [What you can do](https://darkgrade.com/docs/overview/use-cases.md) > > Ideas for each product, with the page that gets you started. > [card] [Everything a camera can do](https://darkgrade.com/docs/functionality/connection.md) > > Every setting and operation, shown in all four products. > [card] [Is my camera supported?](https://darkgrade.com/docs/slate/getting_started/camera-compatibility.md) > > Find your camera and what it supports.