Sam2

by gf-johnco.huggingface.gf-john/sam2

sam2 images and video inference on ZeroGPU

  • Remote endpoint
  • 2 tools

Uptime

Checked  · every day

99.13%from 5 days of checks

Up without downtime on 3 of 5 days with data; down 50 minutes in all, the longest 25 minutes on 30 October.

  • No downtime
  • Degraded
  • Down over 5 minutes
  • No data
  • Not checked yet

Response time

Median 1113 ms, slowest 5% 1214 ms for the handshake and the tool list, over 30 days.

1500 ms750 ms0

How far each check got

  • Reached the address 86.6%
  • Completed the handshake 33.3%
  • Listed its tools 33.3%

2 tools at the last answer.

Every day
DayResultChecksMedian
3 Nov (today)No downtime11039 ms
2 NovDown 25 minutes6of 11197 ms
1 NovNo downtime1of 11207 ms
31 OctNo downtime1of 1911 ms
30 OctDown 25 minutes61113 ms

A failure counts as down time only when a second check five minutes later fails too. How we check

Connect to the publisher's own endpoint

Add to ~/.config/devin/mcp_config.json:

{
  "mcpServers": {
    "sam2": {
      "url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
    }
  }
}
For agents: the install prompt

Every step above as one Markdown text, for an assistant installing it for you.

# Install the MCP server Sam2 (`co.huggingface.gf-john/sam2`)

Its page: https://plug.directory/servers/co.huggingface.gf-john/sam2

It runs on the publisher's servers; the client connects to its URL.

Use the section for the person's client.

## Claude Desktop

Paste into Settings › Connectors › Add custom connector:

```text
https://gf-john-sam2.hf.space/gradio_api/mcp/sse
```

## Claude Code

Run in a terminal:

```sh
claude mcp add --transport sse sam2 https://gf-john-sam2.hf.space/gradio_api/mcp/sse
```

## Cursor, Devin Desktop, LM Studio, Gemini CLI, oterm, ECA

Merge into the place for the person's client:

- Cursor: ~/.cursor/mcp.json
- Devin Desktop: ~/.config/devin/mcp_config.json
- LM Studio: mcp.json (Program › Install › Edit mcp.json)
- Gemini CLI: ~/.gemini/settings.json
- oterm: config.json in oterm's data folder (~/Library/Application Support/oterm on macOS, ~/.local/share/oterm on Linux, %APPDATA%\oterm on Windows)
- ECA: ~/.config/eca/config.json (global) or .eca/config.json in the project

```json
{
  "mcpServers": {
    "sam2": {
      "url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
    }
  }
}
```

## VS Code

Merge into .vscode/mcp.json:

```json
{
  "servers": {
    "sam2": {
      "type": "sse",
      "url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
    }
  }
}
```

## Zed

This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.

## Cline, AnythingLLM, Augment Code

Merge into the place for the person's client:

- Cline: cline_mcp_settings.json (MCP Servers › Configure › Configure MCP Servers)
- AnythingLLM: anythingllm_mcp_servers.json in the AnythingLLM storage plugins directory
- Augment Code: Augment Settings Panel – MCP section – Import from JSON (VS Code extension)

```json
{
  "mcpServers": {
    "sam2": {
      "type": "sse",
      "url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
    }
  }
}
```

## Continue

Merge into ~/.continue/config.yaml:

```yaml
mcpServers:
  - name: "sam2"
    type: sse
    url: "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
```

## Goose

This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.

## Codex

This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.

## mcp-client-cli, TUUI, BoltAI, Bob Shell, Kiro, Kiro CLI

This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.

## Agenvoy

This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.

## Amp

Merge into ~/.config/amp/settings.json (user) or .amp/settings.json (workspace):

```json
{
  "amp.mcpServers": {
    "sam2": {
      "url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
    }
  }
}
```

Then restart the client, or reload its MCP servers, and ask it to list the server's tools to confirm it started.

Tools 2

  • sam2_process_image SAM2 image segmentation: segment objects in an image from box and/or point prompts and return their masks. Provide prompts as bounding boxes and/or points (points require point_labels). Returns a JSON list of segmentation masks, one mask per prompt -- one mask per bounding box, or a single mask for a points-only prompt -- in the same order as the input prompts. Each mask is a base64-encoded 1-bit (binary) PNG string; when decoded the PNG has the same width and height as the original input image, with pixel value 1 inside the object and 0 elsewhere.
  • sam2_process_video SAM2 video segmentation: track objects through a video given their segmentation masks on a reference frame. Seed the objects to track by supplying their masks on the reference frame (ref_frame_idx); SAM2 then propagates each object forward -- and, when ref_frame_idx is nonzero, also backward -- through every frame. The video can optionally be downsampled before tracking with sample_fps or every_x; all frame indices (the "frame" field of every detection AND the ref_frame_idx input) are 0-based positions in the SAMPLED frame sequence, NOT original video frame numbers, so with every_x=5 the detection "frame": 2 corresponds to original frame 10. Returns a JSON list of per-frame detections, one entry per tracked object per frame in which it appears (frames where an object is absent are skipped). Each detection is a dict with: "frame" (integer sampled-frame index as defined above); "track_id" (integer object id, stable across frames); "x", "y", "w", "h" (the object's bounding box as top-left

From Hugging Face Spaces. Report a problem