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.
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
| Day | Result | Checks | Median |
|---|---|---|---|
| 3 Nov (today) | No downtime | 1 | 1039 ms |
| 2 Nov | Down 25 minutes | 6of 1 | 1197 ms |
| 1 Nov | No downtime | 1of 1 | 1207 ms |
| 31 Oct | No downtime | 1of 1 | 911 ms |
| 30 Oct | Down 25 minutes | 6 | 1113 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
Paste into Settings › Connectors › Add custom connector:
https://gf-john-sam2.hf.space/gradio_api/mcp/sse Run in a terminal:
claude mcp add --transport sse sam2 https://gf-john-sam2.hf.space/gradio_api/mcp/sse Add to ~/.cursor/mcp.json:
Add to ~/.config/devin/mcp_config.json:
Add to mcp.json (Program › Install › Edit mcp.json):
Add to ~/.gemini/settings.json:
Add to config.json in oterm's data folder (~/Library/Application Support/oterm on macOS, ~/.local/share/oterm on Linux, %APPDATA%\oterm on Windows):
Add to ~/.config/eca/config.json (global) or .eca/config.json in the project:
{
"mcpServers": {
"sam2": {
"url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
}
}
} Add to .vscode/mcp.json:
{
"servers": {
"sam2": {
"type": "sse",
"url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
}
}
} Add to ~/.config/zed/settings.json:
{
"context_servers": {
"sam2": {
"url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
}
}
} This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.
Add to cline_mcp_settings.json (MCP Servers › Configure › Configure MCP Servers):
Add to anythingllm_mcp_servers.json in the AnythingLLM storage plugins directory:
Add to Augment Settings Panel – MCP section – Import from JSON (VS Code extension):
{
"mcpServers": {
"sam2": {
"type": "sse",
"url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
}
}
} Add to ~/.continue/config.yaml:
mcpServers:
- name: "sam2"
type: sse
url: "https://gf-john-sam2.hf.space/gradio_api/mcp/sse" Add to ~/.config/goose/config.yaml:
extensions:
"sam2":
type: streamable_http
name: "sam2"
enabled: true
uri: "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
headers: {}
env_keys: []
envs: {}
timeout: 300 This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.
Run in a terminal:
codex mcp add sam2 --url https://gf-john-sam2.hf.space/gradio_api/mcp/sse This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.
Add to ~/.llm/config.json:
Add to resources/assets/config/mcp.json in the installed app:
Add to ~/.boltai/mcp.json:
Add to ~/.bob/settings/mcp.json (global) or .bob/mcp.json (project):
Add to ~/.kiro/settings/mcp.json (user) or .kiro/settings/mcp.json (workspace):
Add to ~/.kiro/settings/mcp.json (user) or .kiro/settings/mcp.json (workspace):
{
"mcpServers": {
"sam2": {
"url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
}
}
} This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.
Add to ~/.config/agenvoy/mcp.json:
{
"servers": {
"sam2": {
"url": "https://gf-john-sam2.hf.space/gradio_api/mcp/sse"
}
}
} This server's endpoint speaks only SSE, which this client's documentation does not list among its transports; use another client for it.
Add to ~/.config/amp/settings.json (user) or .amp/settings.json (workspace):
{
"amp.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_imageSAM2 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_videoSAM2 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