Skip to main content
Glama

🌉 Forge Neo MCP

Forge Neo MCP Python Version License

MCP対応のStable Diffusion WebUI Forge - Neo用MCPサーバー · MCPを話せるAIエージェントなら、自分のGPUで画像を生成できます

Claude — またはMCP対応のエージェント — に画像を頼むと、ローカルのForge Neoで生成されます。読み込まれているチェックポイントを確認し、そのモデルが期待するサンプリングパラメータとプロンプトスタイルを割り出し、プロンプトを書き、ファイルを返してくれます。

ステップやCFG、サンプラーを自分で指定する必要はありません(指定したい場合を除く)。それらはあなた自身の環境から取得されます:インスタンスの設定、過去の生成履歴、チェックポイントのメタデータ。判断できない場合は、推測せずに質問してきます。

[!IMPORTANT] Forge Neoは--api付きで実行する必要があります。Forgeのフォルダには何もインストールされません — 拡張機能もカスタムノードもありません。ブリッジはForgeが既に公開しているREST APIと通信します。


📋 目次


Related MCP server: sd-api-mcp

✅ 要件

Forge Neo

--api付きで実行中

Python

エージェントを実行するマシンで3.10以上

MCPクライアント

Claude Code、Claude Desktop、Cursor、その他MCP対応のもの

Forgeが別のマシンで動いている場合のみ:そのマシンへのネットワークアクセス、および結果をbase64ではなくファイルパスで受け取りたい場合はファイル共有。


📦 インストール

1 · Forge NeoでAPIを有効にする

webui-user.bat(Windows)またはwebui-user.sh(Linux)を編集して--apiを追加します:

set COMMANDLINE_ARGS=--api

既存のフラグはそのままに、--apiを追加するだけです。Forgeを再起動します。

動作確認: http://127.0.0.1:7860/docsを開きます。/sdapi/v1/...エンドポイントが一覧表示されていれば、APIは有効です。

2 · ブリッジをインストールする

pip install git+https://github.com/eduardoabreu81/forgeneo-mcp

3 · エージェントに登録する

Claude Code

claude mcp add forgeneo -e FORGE_URL=http://127.0.0.1:7860 -- forgeneo-mcp

Claude Desktop、Cursor、またはmcp.jsonを持つクライアント

{
  "mcpServers": {
    "forgeneo": {
      "command": "forgeneo-mcp",
      "env": { "FORGE_URL": "http://127.0.0.1:7860" }
    }
  }
}

クライアントを再起動します — MCPサーバーは起動時に読み込まれるため、ツールは新しいセッションで表示されます。


⚙️ 設定

FORGE_URL以外はすべてオプションで、それもForgeが127.0.0.1:7860にない場合のみ必要です。

変数

機能

デフォルト

FORGE_URL

Forgeの場所

http://127.0.0.1:7860

FORGE_AUTH

--api-auth付きでForgeを起動した場合のuser:password

なし

FORGE_PATH_MAP

Forgeのパスを自分のマシンで到達可能なパスに変換

なし

FORGE_OUTPUT_DIR

自動検出できない場合の出力フォルダ

自動

FORGE_TIMEOUT

リクエストの待機秒数

600

FORGE_HISTORY_LIMIT

設定を学習する際に読み込む最近の画像数

600

FORGE_CIVITAI_LOOKUP

1でチェックポイントをハッシュでオンライン識別可能

オフ

FORGENEO_CACHE_DIR

確認済みの回答が記憶される場所

~/.forgeneo-mcp

すべて同じマシン上にある場合

他に何もする必要はありません — デフォルトでカバーされます。

Forgeが別のマシンにある場合

Forgeを--listen --api付きで起動し、ブリッジをそのマシンに向けてパスをマッピングします:

claude mcp add forgeneo \
  -e FORGE_URL=http://gpu-box:7860 \
  -e FORGE_PATH_MAP='D:/forge-neo=//gpu-box/share/forge-neo' \
  -- forgeneo-mcp

FORGE_PATH_MAPはForgeが呼ぶ名前 = あなたが呼ぶ名前として読み取られます。ForgeはD:\forge-neo\output\...のようなパスを報告します。同じフォルダに\\gpu-box\share\forge-neo\output\...として到達する場合、そのマッピングによりブリッジはメガバイト単位のbase64ではなくファイルパスを渡せます。

これがなくてもすべて機能します — base64で受け取るだけです。

[!NOTE] --listenはパスワードなしでAPIをネットワークに公開します。それが問題になる環境では、Forgeに--api-auth user:passwordを追加し、FORGE_AUTHをそれに合わせて設定してください。


🚀 初回実行

新しいセッションを開き、エージェントに接続確認を依頼します。capabilitiesを呼び出して、見つかった内容を報告します:

reachable    true
counts       checkpoints · loras · samplers · schedulers · modules
filesystem   file paths        (or: base64 — no readable output dir)
history      how many past generations it could read

確認する価値のある3つの項目:

  • filesystem: base64 — FORGE_PATH_MAPが欠落しているか誤っています。致命的ではありませんが、結果が会話を肥大化させます。

  • history: 0 — 過去の作業から学習できません。通常は出力フォルダに到達できないか、Forgeがメタデータを保存していません(トラブルシューティングを参照)。

  • loras: 0 でLoRAがインストールされている場合 — Forge自身のLoRAリストが空です。UIで更新してください。


💬 使い方

頼むだけです。エージェントが残りを処理します。

「冬のハイキングについての記事のカバー画像」

読み込まれているものを確認し、そのモデルが散文を好むかタグを好むかを判断し、それに応じてプロンプトを書き、生成します。

「同じものだけど、サムネイルに使うスタイルで」

LoRAを検索し、該当するものを見つけ、トリガーワードと通常使用する重みを取得し、プロンプトに書き込みます — 送信された内容が読めるように可視化されます。

「ポートレート用のモデルに切り替えて」

そのチェックポイントを読み込みます。異なるアーキテクチャに属する場合、対応するVAEとテキストエンコーダーも一緒に読み込まれます。

直接尋ねる価値のあるその他のこと:

  • 「どのモデルが読み込まれていて、どうプロンプトすればいい?」 — 平易な言葉でのプロファイル

  • 「このチェックポイントで使えるLoRAはどれ?」 — 互換性のあるものに絞り込み

  • 「fluxのセットアップは完了してる?」 — VAEとテキストエンコーダーを確認

  • 「停止」 — 実行中の生成を中断


🛠️ ツール

エージェントが自動的に選択します。ここにあるのは、何ができるかを知るためのリストです。

ツール

目的

capabilities

このインスタンスが提供するものとブリッジが読み取れたもの

model_profile

読み込まれているチェックポイント:パラメータ、プロンプトスタイル、モジュールの健全性

prompt_dialect

このモデルがどうプロンプトされることを期待しているか、品質タグ付き

loras

名前、タグ、トリガーワード、説明でLoRAを検索

lora_info

1つのLoRAに関するすべて、使用可能なプロンプト断片付き

models

チェックポイントの一覧表示、読み込み、更新

module_check

読み込まれているVAEとテキストエンコーダーがアーキテクチャに適合しているか

module_download

欠落モジュールの入手先 — 承認した場合のみ取得します

generate

書かれたプロンプトから生成、txt2imgまたはimg2img

progress

実行中のジョブの確認、中断、スキップ


🔧 トラブルシューティング

Forgeに到達できないと言われる Forgeが--api付きで実行され、http://127.0.0.1:7860/docsに/sdapi/v1/エンドポイントが一覧表示されていることを確認してください。Forgeが別のマシンにある場合は--listenも必要で、ファイアウォールが妨げになっている可能性があります。

結果がbase64で返ってきて会話が溢れる FORGE_PATH_MAPが欠落しているか一致していません。Forgeが報告するパス — 任意の生成の情報に表示されます — と、同じフォルダに到達するために使用するパスを比較してください。

通常の設定を認識しない 過去の画像から学習しますが、そのためにはForgeが生成パラメータを保存する必要があります。設定 → 画像保存で、**「生成パラメータのテキスト情報をpngファイルにチャンクとして保存」**を有効にするか、.txtサイドカーをオンにしてください。どちらもない場合、出力にパラメータが含まれず、アーキテクチャのデフォルトにフォールバックします。

SDXLチェックポイントの系統を何度も聞かれる Pony、Illustrious、Animagine、標準SDXLはファイルからは区別できません — 同じテンソル、同じプリセット、異なるプロンプト語彙。一度答えるとファイルごとに記憶され、二度と聞かれません。

アーキテクチャ切り替え後に画像がおかしくなる モジュールチェックを依頼してください。Forgeは各プリセットで最後に選択されたVAEとテキストエンコーダーを記憶しているため、別のプリセットがアクティブな状態でチェックポイントを読み込むと、誤ったものが付いたままになることがあります。チェックは何が欠落しているか、正しいファイルが既にインストールされているかを示します。

容量不足でダウンロードが拒否された 意図的です — 数ギガバイト進んだ後に失敗するのではなく、開始前に空き容量を確認します。空き容量を確保するか、bf16の代わりにfp8_scaledのような軽量ビルドを選択してください。


🎯 機能概要

  • モデルに合ったサンプリングパラメータ。 利用可能な場合はあなた自身の過去の生成から、そうでない場合はインスタンスの設定から取得されます — このリポジトリの表からではありません。

  • 正しいプロンプト語彙。 役立つ場合は品質タグ、害になる場合はなし:キャプションで訓練されたモデルにmasterpiece, best qualityを追加すると、プロンプトが改善されるどころか薄まります。

  • 検索可能なLoRA。 名前、タグ、トリガーワード、説明で検索でき、実際に使用する重み付き。プロンプトに何かが追加される際は必ず表示されます。

  • 正直な不確実性。 証拠が尽きたところでそれを伝え、質問します。黙って推測することはありません。

  • モジュール健全性チェック。 プリセットが誤ったVAEやテキストエンコーダーを拾った場合に気づき、欠落しているものの公式ダウンロード先を示します。

各回答がどのように導出されるかのメモは、それを導出するコードの隣のソースにあります。


🗺️ ロードマップ

  • ビデオ(Wan) — Forgeは4n+1の倍数のフレーム数でビデオを生成し、ffmpegでエンコードしますが、APIは結果のパスを破棄します。ディスクからの収集は画像が返ってくる方法として既に実装されているため、これは主に配管の問題です。

  • EXIFメタデータ — JPEGとWebPは.txtサイドカーがオフの場合、パラメータをEXIFに保存します。その組み合わせは現在履歴を生成しません。

  • 認証 — FORGE_AUTHは実装されていますが、実際の--api-authインスタンスに対してテストされていません。


📄 クレジット

  • Forge Neo by Haoming02 — ブリッジの接続先WebUI、およびモジュール参照の背後にあるDownload Modelsウィキ

  • モデル作者 — カードに実際のプロンプトガイダンスを公開している方々。方言テーブルは推測ではなくそれらから構築されています

  • Model Context Protocol — プロトコルとPython SDK

  • CivitAI — オプションのルックアップで使用される公開ハッシュ別エンドポイント


📜 ライセンス

MIT — LICENSEを参照


Stable Diffusionコミュニティのために❤️を込めて

バグ報告 • 機能リクエスト • ディスカッション • ☕ Ko-fi

Available Tools

10 tools
capabilitiesA

Report what this Forge instance offers: routes, counts, and which metadata sources are available. Call this first in a session.

Inputs: no named parameters.

generateA

Generate an image from an already-written prompt.

The prompt is sent verbatim: include any <lora:name:weight> yourself. With use_profile_defaults on, missing sampling parameters are filled from what the loaded model actually used before, so leave them unset unless you mean to override. That includes shift (Forge's distilled_cfg_scale) and the dimensions: leaving them at 0 takes the architecture's own values instead of a generic default. Returns file paths when the output folder is readable.

Pass init_image (a local file path) to run img2img instead, where denoising_strength controls how far the result may drift from it: around 0.3 keeps the composition, 0.75 reinterprets it freely. Edit-style and video models expect values close to 1.0.

Inputs: prompt (required), seed, shift, steps, +10 more.

lora_infoA

Full detail for one LoRA, including description, tags, past usage and a ready-to-paste prompt fragment with its trigger words.

Inputs: name (required).

lorasA

Search available LoRAs by name, title, tags, trigger words or description.

Only call this when the request actually calls for one (a named style, character, or concept) — most generations need no LoRA at all. kind can be "content" or "accelerator"; accelerators change the sampling regime rather than the image, so adopting one means adjusting steps and CFG together.

Inputs: kind, limit, query, verbose, +1 more.

model_profileA

Describe the currently loaded checkpoint: architecture preset, whether it behaves as a turbo/distilled model, the sampling parameters that actually worked before, the expected prompt dialect, and whether its VAE and text encoder modules exist. Call before writing a prompt for an unfamiliar model.

Inputs: no named parameters.

modelsA

List or load checkpoints. action: "list" | "load" | "refresh".

Loading swaps the model for the whole instance, including any human using the web UI at the same time, and takes several seconds — only do it when the operator asked for that model. When the target belongs to a different architecture, its preset, VAE and text encoder are switched with it, since Forge would otherwise load it against whatever modules are selected now. The architecture is inferred from two signals and only acted on when they agree; pass preset to state it outright.

Inputs: name, limit, query, action, +1 more.

module_checkA

Check the VAE and text encoders loaded for an architecture against what it actually needs, and list installed files that could fill any gap.

Defaults to the active preset. Worth calling after switching architecture or when output looks wrong for no obvious reason: Forge records the last selection made under a preset, so loading a checkpoint while another preset was active can leave the wrong modules attached. Where the reference does not state a VAE, it says so instead of guessing — a wrong VAE degrades output without raising an error.

Inputs: preset.

module_downloadA

Find, and optionally fetch, a VAE or text encoder the architecture needs.

Called with no arguments it lists what the active preset is missing and where each file comes from, downloading nothing. Downloading requires both a label naming one entry and confirm=True, and the operator has to agree first: these are multi-gigabyte files written into their models folder, often across a network share.

Links come from the Forge Classic wiki's Download Models page. Where several builds exist — bf16, fp8_scaled, gguf — they are all offered, because which to take depends on the operator's hardware, not on a default worth hiding.

Inputs: label, preset, confirm.

progressB

Check or stop the current generation. action: "status" | "interrupt" | "skip".

Inputs: action.

prompt_dialectA

How the loaded checkpoint expects to be prompted, with its quality tags.

Returns the dialect (pony / illustrious / animagine / anima / sd15 / sdxl_base / natural), the quality prefix and negative baseline it needs, and where that conclusion came from. Quality tags are not decoration: an Illustrious prompt without them degrades, and a Flux prompt with them degrades too.

When the dialect comes back unknown — xl covers Pony, Illustrious and stock SDXL, which share tensors and preset — ask the operator, then call again with confirm set to their answer. It is cached by file hash and never asked again.

Inputs: confirm.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Tools are mostly distinct by resource and action—LoRA search vs detail, module check vs download, generation vs progress—but model_profile and prompt_dialect overlap on prompt dialect, and models/model_profile could be confused at a glance. The detailed descriptions mitigate most ambiguity.

    Naming Consistency4/5

    Names consistently use lowercase snake_case and a readable resource-oriented style (loras, lora_info, models, module_check). Not all are verb_noun—generate is a bare verb and progress is ambiguous—so it is not a perfect 5, but there is no chaotic convention mixing.

    Tool Count5/5

    Ten tools is well within the ideal 3–15 range and matches the server's scope: discovery, model/prompt/LoRA/module setup, generation, and progress control. No tool feels redundant or superfluous.

    Completeness4/5

    The surface covers the full generation workflow—model loading, profiling, prompt dialect, LoRA lookup, module diagnostics/download, generate, and progress monitoring. Minor gaps exist (no LoRA download/management, no explicit output/history listing), but they are not required for the core purpose.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to control a local InvokeAI creative engine, supporting text-to-image, image-to-image, masked inpaint, upscaling, and full queue, model, gallery, board, and workflow management.
      13
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Exposes a local Forge or AUTOMATIC1111 SDXL backend as typed image-generation tools, enabling any MCP client to generate and edit images through a deterministic, stateless interface with server-enforced SFW content.
      3
      Mozilla Public 2.0
    • A
      license
      B
      quality
      C
      maintenance
      Enables Claude Code to call local generative AI services on a LAN, letting users list and chat with Ollama models and list checkpoints, LoRAs, and samplers or generate and save images via Stable Diffusion WebUI Forge Neo. Requests can be made in natural language, with per-call options for model, image size, and Hires.fix settings.
      1
      MIT