FLUXイメージジェネレーターMCPサーバー
Black Forest LabのFLUXモデルを用いて画像を生成するためのMCP(Model Context Protocol)サーバー。最新のMCP SDK(v1.7.0)を使用しています。
特徴
テキストプロンプトに基づいて画像を生成する
画像のサイズ、プロンプトのアップサンプリング、および安全設定をカスタマイズします
生成された画像をローカルに保存する
複数のプロンプトからのバッチ画像生成
Related MCP server: Image Generator MCP Server
前提条件
Node.js (v18.0.0 以上)
Black Forest Lab API キー ( https://api.bfl.mlで取得)
インストール
ソースから
このリポジトリをクローンする
依存関係をインストールします:
npm install.env.exampleに基づいて.envファイルを作成し、Black Forest Lab API キーを追加します。
BFL_API_KEY=your_api_key_hereプロジェクトをビルドします。
npm run buildnpmの使用
npm install -g @modelcontextprotocol/server-flux-image-generator使用法
MCPサーバーの起動
次のコマンドでサーバーを起動します。
npm start自動再コンパイルを使用した開発の場合:
npm run watchMCPクライアントとの統合
このサーバーを MCP クライアント (Claude など) で使用するには、クライアントの構成に以下を追加します。
{
"mcpServers": {
"flux-image-generator": {
"command": "mcp-server-flux-image-generator",
"env": {
"BFL_API_KEY": "your_api_key_here"
}
}
}
}利用可能なツール
画像を生成する
カスタマイズ可能な設定でテキスト プロンプトに基づいて画像を生成します。
パラメータ:
prompt(文字列、必須): 生成する画像のテキスト説明width(数値、オプション、デフォルト:1024):画像の幅(ピクセル単位)height(数値、オプション、デフォルト:1024):画像の高さ(ピクセル単位)promptUpsampling(ブール値、オプション、デフォルト: false): プロンプトをアップサンプリングして詳細を強調しますseed(数値、オプション):再現性のある結果を得るためのランダムシードsafetyTolerance(数値、オプション、デフォルト:3):コンテンツモデレーションの許容範囲(1~5)
例:
{
"prompt": "A serene lake at sunset with mountains in the background",
"width": 1024,
"height": 768,
"promptUpsampling": true,
"seed": 12345,
"safetyTolerance": 3
}クイックイメージ
デフォルト設定で画像を素早く生成するための簡素化されたツール。
パラメータ:
prompt(文字列、必須): 生成する画像のテキスト説明
例:
{
"prompt": "A futuristic cityscape with flying cars"
}バッチ画像生成
プロンプトのリストから複数の画像を生成します。
パラメータ:
prompts(文字列の配列、必須): テキストプロンプトのリスト(最大10個)width(数値、オプション、デフォルト:1024):画像の幅height(数値、オプション、デフォルト:1024):画像の高さ
例:
{
"prompts": [
"A serene lake at sunset",
"A futuristic cityscape",
"A magical forest with glowing plants"
],
"width": 1024,
"height": 768
}出力形式
すべてのツールは次の形式で応答を返します。
{
"image_url": "https://storage.example.com/generated_image.jpg",
"local_path": "/path/to/output/flux_1234567890.png"
}エラーの場合:
{
"error": true,
"message": "Error description"
}バッチ ツールは次を返します:
{
"total": 3,
"successful": 2,
"failed": 1,
"results": [
{
"prompt": "A serene lake at sunset",
"success": true,
"image_url": "https://storage.example.com/image1.jpg",
"local_path": "/path/to/output/flux_batch_1234567890_0.png"
},
{
"prompt": "A futuristic cityscape",
"success": true,
"image_url": "https://storage.example.com/image2.jpg",
"local_path": "/path/to/output/flux_batch_1234567890_1.png"
},
{
"prompt": "Prohibited content",
"success": false,
"error": "Content policy violation"
}
]
}ライセンス
マサチューセッツ工科大学
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.