All posts

Ask AI What Your Camera Sees: SAM 3 over MCP

Pavel Kuba, author
Pavel Kuba
•
septembre 3, 2026
•
7 min
reading
Ask AI What Your Camera Sees: SAM 3 over MCP
All posts

Ask AI What Your Camera Sees: SAM 3 over MCP

Pavel Kuba, author
Pavel Kuba
•
décembre 3, 2026
•
7 min
reading
Ask AI What Your Camera Sees: SAM 3 over MCP

Two MCP servers, one AI agent, and a security camera. That is the whole stack for this guide. By the end you will be able to ask an AI agent in plain language to pull a snapshot from a camera on your Angelcam account and return a pixel-accurate segmentation mask of everything in the frame that you care about, without writing an integration.

The interesting part is not that it works. It is why it works with so little glue: Angelcam returns snapshots as ordinary public HTTPS URLs, and Roboflow's SAM 3 accepts an image URL as input. The agent passes one string between two tools. There is no base64 shuffling, no re-upload, no intermediate storage bucket.

What you are building

  1. An AI agent with the Angelcam MCP server and the Roboflow MCP server both connected.
  2. Ask it for a camera snapshot. It returns a snapshot URL.
  3. Ask it to segment that snapshot with text prompts like person, car, bollard.
  4. SAM 3 returns masks, per-class counts, and confidences. Zero training, zero labelled data.

This walkthrough uses Grok Bot as the client, because its persistent computer and account-wide plugins suit a multi-tool pipeline. The pipeline itself is client-agnostic: any MCP-capable client works, including Claude, ChatGPT, and Cursor. Only the connection UI differs.

Before you start

  • An Angelcam account with at least one connected camera. If you do not have one, an AngelBox will bring most existing IP cameras online in a few minutes.
  • A Roboflow account. The free tier is enough to follow along.
  • An MCP client. For Grok Bot specifically, see the Get started guide. Note that Grok Bot requires an eligible plan and is currently desktop (macOS, Windows) plus iOS, with no Linux app.

Step 1: Connect Angelcam

In Grok Bot, connectors appear as Plugins. Open Settings, then Plugins, add the Angelcam server, and complete the sign-in in the browser. Installed plugins are account-wide, so every Bot on your account can see the tools once one of them authenticates.

Two things worth knowing up front. First, plugin authentication is where most first attempts die: if the agent tells you the token is missing or expired, it will usually re-present the authorization card rather than failing loudly, so watch for it. Second, if your team uses an MCP allowlist, the server URL has to be on it or the plugin shows as disabled by your admin.

Verify the connection by asking for something trivial:

What is the status of my cameras?

You should get back a list with names, online status, codec type, and snapshot age. If you see camera names, the plugin is live.

The Grok Bot mobile app with the Angelcam MCP plugin added and a Roboflow connection prompt in the conversation
Adding Angelcam as a plugin, then chaining a second connection to Roboflow in the same conversation.

Step 2: Connect Roboflow

Same surface, same flow. Add the Roboflow MCP server from Plugins and authenticate. Roboflow's server exposes a large tool surface covering datasets, annotation, training, inference, and Workflows, so agents typically search the tool catalogue before calling anything.

Verify with:

Which foundation models are available for auto-labeling in my Roboflow workspace?

You are looking for SAM 3 in the response. At the time of writing the catalogue exposes it in two output shapes, RLE compressed masks and polygons, alongside a Gemini option that returns bounding boxes.

Step 3: Get the snapshot

Ask for it by name, not by ID. The Angelcam server can resolve a partial name, tag, or location hint into a camera ID, so natural language is enough:

Get me the latest snapshot from the camera at the north gate.

What comes back is a snapshot URL, a creation timestamp, and an age in minutes.

Read the age field. It matters more than anything else in this guide. These are periodical snapshots, not live frames. Depending on the camera's configuration, the image you are about to analyse may be minutes or many hours old. In testing for this article, three online cameras returned snapshots aged two hours, seven hours, and seven hours. That is fine for building a dataset. It is useless for answering "what is happening right now."

If you need a current frame, ask for a live stream URL instead and pull a frame from it. The Angelcam server can return HLS, MJPEG, or fMP4 for any online camera. MJPEG is the least work if all you want is a single still.

Step 4: Segment it with SAM 3

Here is where the two servers meet. Hand the snapshot URL straight to SAM 3 with a list of text prompts:

Run SAM 3 on that snapshot URL. Prompts: person, car, bollard, manhole cover, street light.

There are two ways the agent can execute this, and choosing the right one saves real money.

Option A: Workflows, for inference

Roboflow Workflows has a dedicated SAM 3 block that runs zero-shot segmentation from text prompts. A workflow definition can be executed inline as JSON, which means no project and no dataset are needed. This is the path to use when you want to look at something. Add a mask visualization block and the workflow returns an annotated image you can drop into a report.

Option B: Auto Label, for dataset building

The Auto Label path attaches SAM 3 to a batch of images inside a Roboflow project and produces reviewable annotations. Use it when the goal is a trained model rather than a one-off answer. Two constraints to plan around: it requires an existing project (a fresh workspace has none, so create one first), and it consumes credits per image, so preview on a single frame before committing a batch. Previews are free.

Writing prompts SAM 3 actually understands

SAM 3 takes short noun phrases, and the ceiling is 50 classes per run. Bare nouns work: person, car, bollard. What it handles badly is niche vocabulary, visible text, and relationships between objects. "The van parked next to the loading bay door" is not a SAM 3 prompt. If your question is relational or your class names are unusual, a vision language model returning bounding boxes will beat SAM 3 on comprehension, then you can pass those boxes to SAM 3 to get precise masks. Detection quality and mask quality are separate problems, and it is worth using a different model for each.

What you get back

Per-class detections with confidence scores and mask geometry. On a typical outdoor camera frame with the prompt list above, expect clean masks on people and vehicles, and a long tail of correctly identified static infrastructure: bollards, manhole covers, street lights.

A night-time camera snapshot with SAM 3 segmentation masks labelling a person, a car, bollards, manhole covers and street lights
SAM 3 output on a night-time snapshot. Note that every label here is a bare noun, which is exactly the prompt format the model wants.

That static tail is a useful signal in its own right. A scene inventory that stays constant frame to frame is a cheap way to detect camera tampering or repositioning.

Where this breaks

An honest list, because the failure modes are more instructive than the happy path. Here is one of them on video: the agent resolves the camera, fetches the snapshot, calls SAM 3, and runs straight into a Roboflow credit cap. Note what it does next, which is fall back to describing the raw frame in text rather than pretending it segmented anything.

The agent round trip, slowed for legibility and looping silently. The conversation is in Czech. SAM 3 never runs here: Roboflow returns credit_cap_exceeded, so the agent returns the raw snapshot and a written description instead.

  • Credit caps and rate limits. Zero-shot inference is metered. A credit_cap_exceeded from Roboflow, or a 429 upstream, stops the pipeline mid-conversation. A well-behaved agent will tell you and fall back. A careless one will summarise the fallback as if it were a result, which is how you end up believing the model found nothing when it never looked. Check for the error before you trust an empty answer.
  • Snapshot staleness. Covered above, and the single most common way this pipeline produces a confidently wrong answer.
  • Snapshot URLs are public. The snapshot URL is unauthenticated and fetchable by anyone who has it, which is precisely what makes the handoff to Roboflow so simple. That is a deliberate trade. Do not paste those URLs into places you would not paste the image itself, and be aware that a third-party inference provider fetching them is a data flow your security review should know about.
  • SAM 3 is a labelling accelerator, not a fleet runtime. Zero-shot segmentation at two credits an image is excellent for bootstrapping a dataset and terrible as a detector running continuously across hundreds of cameras. The production shape is: use SAM 3 to label fast, train a small purpose-built model, deploy that model for runtime inference.
  • Prompt brittleness. Zero-shot means no guarantees. Class names that work on one camera angle can quietly return nothing on another. Check for classes with zero detections before trusting a run.
  • Beta churn. Agentic clients are moving weekly. Menu paths in this guide will drift. The MCP servers and the tool names will not.

From demo to production

Everything above is a conversation. Turning it into a system means three more decisions: pull live frames instead of periodic snapshots, replace the zero-shot model with a trained one once you have a few hundred reviewed labels, and move the trigger from "someone asked" to an event, such as a motion or sensor event from Real-Time Security, so inference runs when something happens rather than on a schedule.

That is the architecture we build with partners running camera fleets: Angelcam handles connectivity, streaming, and recording through an API-first platform, and you keep full control of the model layer. No lock-in to one vendor's analytics, no rip-and-replace of existing cameras.

If you are building something along these lines and want to talk through the architecture, book a call or reach us at hello@angelcam.com.