
spartanz51/imagegen-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
spartanz51/imagegen-mcp は [https://github.com/spartanz51/imagegen-mcp.] からインポートされた MCP サーバー候補です
概要
spartanz51/imagegen-mcp は [https://github.com/spartanz51/imagegen-mcp.] からインポートされた MCP サーバー候補です
概要(AI 翻訳)
このプロジェクトは、OpenAIのイメージ生成とAPIの編集に関するラッパーとして機能するモデルコンテキストプロトコル(MCP)に基づいてサーバーの実装を提供します。
##特徴
※MCPツールによるOpenAI画像生成機能を公開
※DALL-E2、DALL-E3、gpt-image-1などのモデルを用いた「[text-to-image」生成をサポート。
※ DALL-E 2 と gpt-image-1 を使って編集する [[image-to-image] をサポートしました。
- 環境変数とコマンドライン引数で設定可能。 *サイズ、質、様式、フォーマット、等のようなさまざまな変数を扱います。
- 生成/編集された画像を一時ファイルに保存し、ベース64データとともにパスを返します。
ここでは、MCP を介して統合された text-to-image ツールを使用して、Cursor で直接画像を生成する例を示します。
npx でクイックラン
npmから[npxを使用してサーバーを直接実行できます(Node.jsとnpmが必要です):
オプションの詳細については、サーバーセクションの実行を参照してください。
前提条件
※Node.js(v18以降推奨)
- npmかヤーン
- OpenAI APIキー
Cursor との ## 統合
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
MCP OpenAI Image Generation Server
This project provides a server implementation based on the Model Context Protocol (MCP) that acts as a wrapper around OpenAI’s Image Generation and Editing APIs (see OpenAI documentation).
Features
- Exposes OpenAI image generation capabilities through MCP tools.
- Supports
text-to-imagegeneration using models like DALL-E 2, DALL-E 3, and gpt-image-1 (if available/enabled). - Supports
image-to-imageediting using DALL-E 2 and gpt-image-1 (if available/enabled). - Configurable via environment variables and command-line arguments.
- Handles various parameters like size, quality, style, format, etc.
- Saves generated/edited images to temporary files and returns the path along with the base64 data.
Here’s an example of generating an image directly in Cursor using the text-to-image tool integrated via MCP:
Quick Run with npx
You can run the server directly from npm using npx (requires Node.js and npm):
npx imagegen-mcp [options]
See the Running the Server section for more details on options and running locally.
Prerequisites
- Node.js (v18 or later recommended)
- npm or yarn
- An OpenAI API key
Integration with Cursor
You can easily integrate this server with Cursor to use its image generation capabilities directly within the editor:
-
Open Cursor Settings:
- Go to
File > Preferences > Cursor Settings(or use the shortcutCtrl+,/Cmd+,).
- Go to
-
Navigate to MCP Settings:
- Search for “MCP” in the settings search bar.
- Find the “Model Context Protocol: Custom Servers” setting.
-
Add Custom Server:
- Click on “Edit in settings.json”.
- Add a new entry to the
mcpServersarray. It should look something like this:
"mcpServers": [ "image-generator-gpt-image": { "command": "npx imagegen-mcp --models gpt-image-1", "env": { "OPENAI_API_KEY": "xxx" } } // ... any other custom servers ... ]- Customize the command:
- You can change the
--modelsargument in thecommandfield to specify which models you want Cursor to have access to (e.g.,--models dall-e-3or--models gpt-image-1). Make sure your OpenAI API key has access to the selected models.
- You can change the
-
Save Settings:
- Save the
settings.jsonfile.
- Save the
インストール
npx imagegen-mcp [options]設定
"mcpServers": [
"image-generator-gpt-image": {
"command": "npx imagegen-mcp --models gpt-image-1",
"env": {
"OPENAI_API_KEY": "xxx"
}
}
// ... any other custom servers ...
]