Skip to main content
Glama

Image Generation MCP Server

by mikeyny

画像生成MCPサーバー

Replicate のblack-forest-labs/flux-schnellモデルを使用して画像を生成するためのMCP (Model Context Protocol)サーバー実装。

理想的には、Cursor の MCP 機能と一緒に使用しますが、どの MCP クライアントでも使用できます。

特徴

  • テキストプロンプトから画像を生成する
  • 設定可能な画像パラメータ(解像度、アスペクト比、品質)
  • 生成された画像を指定されたディレクトリに保存する
  • MCPプロトコルに完全準拠
  • エラー処理と検証

前提条件

  • Node.js 16以上
  • APIトークンを複製する
  • MCP 向け TypeScript SDK

設定

  1. リポジトリをクローンする
  2. 依存関係をインストールします:
    npm install
  3. apiToken定数を更新して、 src/imageService.tsのコードに Replicate API トークンを直接追加します。
    // No environment variables are used since they can't be easily set in cursor const apiToken = "your-replicate-api-token-here";

    注: Claude で使用する場合は、ルート ディレクトリに.envファイルを作成し、そこに API トークンを設定できます。

    REPLICATE_API_TOKEN=your-replicate-api-token-here
    次にプロジェクトをビルドします。
    npm run build

使用法

カーソルで使用するには:

  1. 設定に移動
  2. 機能を選択
  3. 「MCPサーバー」までスクロールします。
  4. 「新しいMCPサーバーを追加」をクリックします
  5. タイプを「コマンド」に設定する
  6. コマンドを次のように設定します: node ./path/to/dist/server.js

APIパラメータ

パラメータタイプ必須デフォルト説明
promptはい-画像生成のためのテキストプロンプト
output_dirはい-生成された画像を保存するサーバーディレクトリパス
go_fastブール値いいえ間違い高速生成モードを有効にする
megapixelsいいえ「1」解像度の品質(「1」、「2」、「4」)
num_outputs番号いいえ1生成する画像の数(1~4)
aspect_ratioいいえ「1:1」アスペクト比(「1:1」、「4:3」、「16:9」)
output_formatいいえ「ウェブ」画像形式(「webp」、「png」、「jpeg」)
output_quality番号いいえ80圧縮品質(1~100)
num_inference_steps番号いいえ4ノイズ除去ステップ数(4~20)

リクエスト例

{ "prompt": "black forest gateau cake spelling out 'FLUX SCHNELL'", "output_dir": "/var/output/images", "filename": "black_forest_cake", "output_format": "webp" "go_fast": true, "megapixels": "1", "num_outputs": 2, "aspect_ratio": "1:1" }

回答例

{ "image_paths": [ "/var/output/images/output_0.webp", "/var/output/images/output_1.webp" ], "metadata": { "model": "black-forest-labs/flux-schnell", "inference_time_ms": 2847 } }

エラー処理

サーバーは次のエラー タイプを処理します。

  • 検証エラー(無効なパラメータ)
  • API エラー (API の問題を複製する)
  • サーバーエラー(ファイルシステム、権限)
  • 不明なエラー(予期しない問題)

各エラー応答には次の内容が含まれます。

  • エラーコード
  • 人間が読めるメッセージ
  • 詳細なエラー情報

ライセンス

ISC

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

ユーザーは、Replicate のモデルを使用して、構成可能なパラメータと完全な MCP プロトコル準拠により、テキスト プロンプトから画像を生成できます。

  1. 特徴
    1. 前提条件
      1. 設定
        1. 使用法
          1. APIパラメータ
            1. リクエスト例
              1. 回答例
                1. エラー処理
                  1. ライセンス

                    Related MCP Servers

                    • A
                      security
                      F
                      license
                      A
                      quality
                      A Model Context Protocol server that provides image generation capabilities using the Ideogram API, allowing users to create images from text prompts with customizable parameters.
                      Last updated -
                      1
                      9
                      4
                      TypeScript
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A MCP server that enables Claude and other MCP-compatible assistants to generate images from text prompts using Together AI's image generation models.
                      Last updated -
                      1
                      4
                      TypeScript
                      MIT License
                      • Apple
                      • Linux
                    • -
                      security
                      A
                      license
                      -
                      quality
                      Provides image generation capabilities using the Flux Schnell model on Replicate, allowing users to create images from text prompts.
                      Last updated -
                      1
                      JavaScript
                      MIT License
                    • -
                      security
                      A
                      license
                      -
                      quality
                      Provides image generation capabilities for Claude using the Replicate Flux model, allowing users to create images from text prompts with customizable parameters like aspect ratio and output format.
                      Last updated -
                      80
                      33
                      JavaScript
                      MIT License
                      • Apple

                    View all related MCP servers

                    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/mikeyny/ai-image-gen-mcp'

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