Skip to main content
Glama

@sfwapi/mcp

MCP server for the SFW API: NSFW and nudity detection for images, GIFs and videos as tools for Claude Code, Claude Desktop, Cursor, VS Code, Codex and any other MCP client.

Tools

Tool

What it does

analyze_url

Analyse an image, GIF or video at a public URL

analyze_file

Analyse a local file on your machine (uploaded to the API)

get_account

Credit balance, plan limits and this month's usage (free)

Every analysis result carries the content level (0 Everyday, 1 Revealing, 2 Implied nudity, 3 Explicit), a 0-100 score per level, and flags for drawn content (art) and adult objects (sex_object). Pass block_level to get a blocked/allowed decision directly.

One credit per image or analysed GIF/video frame; failed calls are free; 500 free credits a month. Media is processed in memory and never stored.

Example output

Level 0 (Everyday). Scores 0-100: revealing 2, implied nudity 0, explicit 0. Allowed by the policy. 1 credit used, 499 left.

Structured JSON matching the HTTP API response is returned alongside the text summary.

Related MCP server: @imageat/mcp

Install

Get a free key at sfwapi.dev/console and put it in SFWAPI_API_KEY.

Claude Code

claude mcp add sfwapi -e SFWAPI_API_KEY=sk_live_... -- npx -y @sfwapi/mcp

Cursor (.cursor/mcp.json) and Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "sfwapi": {
      "command": "npx",
      "args": ["-y", "@sfwapi/mcp"],
      "env": { "SFWAPI_API_KEY": "sk_live_..." }
    }
  }
}

VS Code (.vscode/mcp.json)

{
  "inputs": [
    { "type": "promptString", "id": "sfwapi-key", "description": "SFW API key", "password": true }
  ],
  "servers": {
    "sfwapi": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@sfwapi/mcp"],
      "env": { "SFWAPI_API_KEY": "${input:sfwapi-key}" }
    }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.sfwapi]
command = "npx"
args = ["-y", "@sfwapi/mcp"]
env = { SFWAPI_API_KEY = "sk_live_..." }

Hosted endpoint (no install)

https://api.sfwapi.dev/mcp serves the same tools over Streamable HTTP, without analyze_file (a hosted server cannot read your disk). Send the key as Authorization: Bearer sk_live_...:

claude mcp add --transport http sfwapi https://api.sfwapi.dev/mcp --header "Authorization: Bearer sk_live_..."

Environment

Variable

Description

SFWAPI_API_KEY

Required. Your SFW API key.

SFWAPI_BASE_URL

Optional. Defaults to https://api.sfwapi.dev.

Node 20 or newer. MIT licence.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers