SmartTokenGuard

io.github.nwjnjjj由 GitHub 账号 nwjnjjj 发布v1.2.2更新于 Nov 2, 2026

Stop burning credits on broken AI video: check every render before you pay for the next one.

已验证Streamable HTTP可网页运行数据与分析媒体与设计AI 与机器学习

概览

AI 生成的概览

检查 AI 生成的关键帧与视频片段的技术缺陷,并在你为下一步渲染付费前给出通过、重试、换模型或停止的结论。

可以做什么
  • 检测图像与视频的模糊、曝光、黑帧、冻结片段、闪烁、硬切,以及与参考图的色彩和光照漂移,并返回供复核的帧。
  • 根据测量结果与助手观察给出通过、同模型重试、切换备用模型、停止或停止预算的判定,并附具体修正建议,如负面提示词、降低运动幅度或更换种子。
  • 定位冲击、闪光与剪辑的精确帧,便于放置音效。
  • 报告项目花费、每个通过镜头的尝试次数、首次通过率,以及在付费生成视频前被拒的关键帧数量。
  • 查询许可证用量与套餐价格。
适用场景
适合在使用 ComfyUI、Kling、Runway、Veo、Hailuo、Seedance 等工具生成 AI 视频或关键帧时,希望每次渲染在进入下一步付费前先被筛查的场景。尤其适用于先检查静帧、避免为废片付费的工作流。
运行要求
需要来自 Polar 收据的 Starter 或 Pro 付费许可证密钥:本地安装通过环境变量 STG_LICENSE_KEY 提供,远程端点通过 Authorization bearer 头提供。本地安装需要 uv;远程 MCP 端点无需安装,但只接受公开的 https 媒体链接。文件限制为 32 MB、60 秒、1080p,每分钟 30 次请求。
安装前请注意
许可证密钥同时充当 API 密钥并会发送给 API,需妥善保管。付费套餐按月或按年通过 Polar 计费,检查次数每月重置。上传的媒体会发送到托管于 Google Cloud 的 API,README 称其在返回响应前即删除。判定只覆盖技术性渲染失败,不认证人体结构、身份、版权或故事质量。花费账本保存在本机。

安装

在 SourceWeft 中

  1. 打开 控制台中的 SmartTokenGuard,将其添加到工作区。
  2. 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.nwjnjjj%2Fsmart-token-guard/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "smarttokenguard": {
      "type": "http",
      "url": "https://stg-agent-560636228350.asia-east1.run.app/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

SmartTokenGuard

English · 简体中文

Stop burning credits on broken AI video.

Every black frame, frozen shot and off-model keyframe is money you already paid for. SmartTokenGuard checks each keyframe and clip from ComfyUI, Kling, Runway, Veo, Hailuo, Seedance or any other AI video tool the moment it renders, and tells your AI assistant whether it's worth paying for the next step: pass it, retry with exact fixes, switch models, or stop spending on that shot.

How much are broken renders costing you? Try the calculator: https://nwjnjjj.github.io/smart-token-guard/

ToolWhat it does
stg_inspect_renderMeasures an image or video: blur and soft focus, over/under-exposure, black frames, frozen segments, flicker, hard cuts, impacts and flashes, and colour/lighting drift against a reference image. Returns review frames so your assistant can check hands, faces and identity.
stg_qa_gateTurns measured issues + what the assistant saw into PASS / RETRY_SAME_MODEL / SWITCH_TO_FALLBACK / HALT / HALT_BUDGET, with concrete fixes (negative-prompt terms, lower motion, new seed). Keeps a spend ledger per project on your computer.
stg_detect_eventsExact frames of impacts, flashes and cuts, for placing sound effects.
stg_spend_reportWhat a project spent, attempts per passed shot, first-try pass rate, keyframes rejected before paying for video.
stg_account, stg_pricingLicense usage and plans.

Check the keyframe first. A rejected still costs nothing. A rejected 5-second clip has already been paid for.

How verdicts work: measured checks run automatically, and your assistant reviews the returned frames for hands, faces and identity before a render can PASS, so nothing broken slips through to the next paid step.

Plans

PlanMonthlyYearlyChecks per month
StarterUS$9US$99300
ProUS$29US$2903,000

Checks reset on the 1st of each month (UTC). One license per person; teams buy one per member. Checkout, tax and invoices are handled by Polar, the merchant of record. The license key in your Polar receipt is your API key. Cancel or change plans in the Polar customer portal. Run stg_pricing for the checkout links.

Install (MCP)

Requires uv.

Claude Desktop / Cursor: add to claude_desktop_config.json or ~/.cursor/mcp.json:

json
{  "mcpServers": {    "smart-token-guard": {      "command": "uvx",      "args": ["--from", "git+https://github.com/nwjnjjj/smart-token-guard", "smart-token-guard"],      "env": { "STG_LICENSE_KEY": "your-license-key" }    }  }}

Claude Code

bash
claude mcp add smart-token-guard -e STG_LICENSE_KEY=your-license-key -- uvx --from git+https://github.com/nwjnjjj/smart-token-guard smart-token-guard

VS Code: .vscode/mcp.json → {"servers": {"smart-token-guard": {"type": "stdio", "command": "uvx", "args": [...same...], "env": {...}}}}

Then ask: "Inspect renders/sh010_keyframe.png against refs/kai.png. If it passes, I'll render the clip on Kling (0.7 USD, fallback Runway)."

Python SDK

bash
pip install git+https://github.com/nwjnjjj/smart-token-guard
python
from smart_token_guard import Client
stg = Client()  # reads STG_LICENSE_KEYreport = stg.inspect("renders/sh010.mp4", reference_image="refs/kai.png")print(report["report"]["issues"], report["license"]["checks_remaining"])
decision = stg.qa_gate(model="Kling", render_cost_usd=0.7, technical_issues=report["report"]["issues"],                       semantic_defects=["deformed_hands"], fallback_model="Runway")print(decision["decision"], decision["actions"])

HTTP API: POST /v1/inspect (multipart file, optional reference, options JSON), POST /v1/qa-gate, GET /v1/account with Authorization: Bearer <license key>. See GET /v1/capabilities.

For AI agents (remote MCP and A2A)

No install needed. Media is passed as a public https URL; the server downloads it, analyses it and deletes it.

  • Remote MCP (Streamable HTTP): https://stg-agent-560636228350.asia-east1.run.app/mcp with header Authorization: Bearer <license key>. Tools: stg_inspect_media_url, stg_qa_gate, stg_account, stg_pricing.
  • A2A: Agent Card at https://stg-agent-560636228350.asia-east1.run.app/.well-known/agent-card.json, JSON-RPC message/send at /a2a. Send a data part {"media_url": "https://..."} (or text containing a link) to inspect, or {"skill": "qa-gate", ...} for a decision.
  • Same plans and monthly checks as above. URLs must be public https hosts; private and internal addresses are refused.

Limits and privacy

  • Up to 32 MB, 60 seconds and 1080p per file (JPEG, PNG, WebP, MP4, MOV, WebM, MKV). 30 requests per minute.
  • Files are uploaded to the SmartTokenGuard API (Google Cloud), analysed in a temporary file, and deleted before the response is sent. Nothing is stored and nothing is used for training.
  • The API receives your license key and the file. Project ledgers stay on your computer (~/.smart-token-guard/).
  • Measured checks catch technical render failures. They do not certify anatomy, identity, copyright or story quality.

Support

Refunds, invoices and cancellation: Polar customer portal (link in your receipt). The client code in this repository is MIT licensed; the hosted API requires a paid license.

来源:README.md,提交 9ab30ec

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

1
  1. v1.2.2最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分