Skip to main content
Glama

sdnext-mcp

SD.Next(Stable Diffusion Next)WebUI 向けの Model Context Protocol(MCP)サーバーです。

SD.Next の REST API(/sdapi/v1/* + /sdapi/v2/civitai/*)を 125 個の MCP ツールとしてラップし、LLM ホスト(Claude Desktop、DSH など)がテキストから画像への生成、画像から画像への変換、コントロール誘導生成、アップスケーリング、ディテーラー、LoRA、スクリプト、キャプション/タグ付け/VQA、モデルとオプションの管理、サーバー内部情報の取得、ファイル/ギャラリー、CivitAI など、SD.Next のあらゆる利用シナリオを操作できるようにします。

これは薄い HTTP クライアントです。 Python を組み込んでおらず、WebUI を起動しません。SD.Next を --api --listen 付きでご自身で実行する必要があります。MCP サーバーは HTTP 経由で通信するだけです。

これが存在する核となる理由: SD.Next のリクエストパラメータは A1111 とは異なります(モジュラーガイダンス、1024 のデフォルトキャンバス、組み込みの YOLO ディテーラー、独立した軸としてのスケジューラー、UNet/DiT など)。そのため、A1111 用の MCP コードは SD.Next では動作しません。ここにあるすべてのツールは、SD.Next の実際の pydantic リクエストフィールドに基づいてモデル化されています。

要件

  • Node.js ≥ 18(グローバルな fetchFormDataAbortSignal.timeout を使用)

  • --api --listen 付きで起動した実行中の SD.Next インスタンス(認証を有効にするには --api-auth user:pass を追加)

Related MCP server: sd-neo-mcp

インストール

cd sdnext_mcp
npm install          # installs @modelcontextprotocol/sdk + zod

実行

デフォルトは stdio トランスポートです(MCP ホストによって起動されます):

# in your MCP host config
{
  "mcpServers": {
    "sdnext": {
      "command": "node",
      "args": ["/abs/path/to/sdnext_mcp/src/index.js"],
      "env": {
        "SDNEXT_BASE_URL": "http://127.0.0.1:7860",
        "SDNEXT_USERNAME": "user",
        "SDNEXT_PASSWORD": "pass"
      }
    }
  }
}

または、Streamable HTTP トランスポートを直接実行します:

SDNEXT_MCP_TRANSPORT=http SDNEXT_MCP_PORT=8787 node src/index.js
# → http://127.0.0.1:8787/mcp

設定(環境変数)

変数

デフォルト

意味

SDNEXT_BASE_URL

http://127.0.0.1:7860

WebUI アドレス

SDNEXT_API_PATH

/sdapi/v1

v1 プレフィックス

SDNEXT_API_KEY

Bearer トークン(最優先)

SDNEXT_USERNAME / SDNEXT_PASSWORD

HTTP Basic 認証

SDNEXT_TIMEOUT_MS

300000

リクエストタイムアウト(生成は遅い)

SDNEXT_MCP_TRANSPORT

stdio

stdio または http

SDNEXT_MCP_HOST / SDNEXT_MCP_PORT

127.0.0.1 / 8787

HTTP トランスポートのバインド

SDNEXT_MCP_DRY_RUN

false

1 = リクエストを表示し、送信しない

SDNEXT_SAVE_DIR

save_dir ディスク書き込み用のデフォルトディレクトリ

ツールファミリー(合計 125 個)

  • 生成sdnext_txt2imgsdnext_img2imgsdnext_controlsdnext_process_imagesdnext_process_batchsdnext_detailsdnext_prompt_enhance

  • 列挙子sdnext_list_samplerssdnext_list_masking(29 個のリストツール)

  • 画像理解sdnext_captionsdnext_caption_dispatchsdnext_taggersdnext_vqasdnext_analyze

  • モデル/オプション — チェックポイント、VAE、UNet、LoRA の更新/選択/読み込み、sdnext_get_options/sdnext_set_options

  • サーバーsdnext_statussdnext_progress、中断/スキップ、再起動/シャットダウン、ログ、履歴、ストレージ、GPU

  • ファイル/ギャラリーsdnext_uploadsdnext_file、delete-、browser/sdnext_png_info

  • コントロール処理sdnext_preprocesssdnext_masksdnext_detect

  • モデレーションsdnext_nudenetsdnext_prompt_langsdnext_image_guardsdnext_prompt_banned

  • CivitAI — 検索、モデル/バージョン、ダウンロードキュー、設定、ブックマーク、禁止、履歴(27 個のツール)

  • メタsdnext_list_toolssdnext_call_api(汎用パススルー)、オートコンプリートファイル管理

実行時に sdnext_list_tools を実行して完全なカタログを確認するか、node scripts/dump_tools.mjs を実行してください。

典型的なワークフロー

sdnext_list_checkpoints   → pick a model
sdnext_list_samplers      → pick a sampler
sdnext_txt2img { prompt, sd_model_checkpoint, sampler_name, width:1024, height:1024, steps:20 }
sdnext_progress           → poll while it runs
sdnext_caption / sdnext_tagger → understand a result

画像は入出力ともに生の base64 PNG です(data: プレフィックスなし)。画像が入力となる場所では "upload:<id>" 参照が受け入れられます。任意の生成ツールで save_dir を渡すと、結果をディスクにも書き込めます。

スクリプト

npm run check          # syntax-check the entry
node scripts/smoke.mjs # DRY_RUN stdio smoke test (no live server needed)
node scripts/dump_tools.mjs  # export the tool catalog

レイアウト

アーキテクチャのドキュメントについては ../framework/ を参照してください(API の事実は 01-sdnext-api/、設計上の決定は 02-mcp-design/)。ソースは src/ 配下にあります: config.jsclient.jsimage.jsregistry.jsindex.js、および tools/(ドメインごとに 1 ファイル)。

Install Server
F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Free public MCP for AI agents — 193 tools, 44 workflows. No API key.

  • Generate images with any major model — one API key, one prepaid balance, one MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Congenital/sdnext_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server