@tasopen/mcp-alphabanana 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) TasogarePenguin 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,292 @@
1
+ # mcp-alphabanana
2
+
3
+ English | [日本語](README.ja.md)
4
+
5
+ Google Gemini AI を使って画像アセットを生成する Model Context Protocol (MCP) サーバー。
6
+
7
+ [FastMCP 3](https://www.npmjs.com/package/fastmcp) で構築され、シンプルなコードベースと柔軟な出力オプションを提供します。
8
+
9
+ ## 機能
10
+
11
+ - **Google Gemini AI による汎用画像生成**
12
+ - **カラーキー後処理による透過 PNG 出力**
13
+ - **複数の出力形式**: ファイル、base64、または両方
14
+ - **スタイル参照のための参照画像サポート**
15
+ - **柔軟なリサイズモード**: crop、stretch、letterbox、contain
16
+ - **複数のモデルティア**: flash (Gemini 2.5 Flash) または pro (Gemini 3 Pro)
17
+
18
+ ## インストール
19
+
20
+ `@tasopen/mcp-alphabanana` を MCP サーバー設定に追加してください。
21
+
22
+ ## 設定
23
+
24
+ `GEMINI_API_KEY` を MCP 設定(例: `mcp.json`)で設定します。一部のエージェント環境では OS 環境変数にアクセスできないため、`mcp.json` で OS 環境変数を参照するか、直接キーを記載できます。
25
+
26
+ 例:
27
+
28
+ - `mcp.json` で OS 環境変数を参照:
29
+
30
+ ```json
31
+ {
32
+ "env": {
33
+ "GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
34
+ }
35
+ }
36
+ ```
37
+
38
+ - `mcp.json` に直接キーを記載(エージェントが OS 環境変数を参照できない場合に有用):
39
+
40
+ ```json
41
+ {
42
+ "env": {
43
+ "GEMINI_API_KEY": "your_api_key_here"
44
+ }
45
+ }
46
+ ```
47
+
48
+ 運用に合わせて選択してください(可能であれば環境参照を推奨)。
49
+
50
+ ## VS Code 統合
51
+
52
+ VS Code 設定(`.vscode/settings.json` またはユーザー設定)に追加し、サーバー `env` を `mcp.json` または VS Code MCP 設定で設定します。OS 環境変数参照または直接キー記載の両方に対応:
53
+
54
+ ```json
55
+ {
56
+ "mcp": {
57
+ "servers": {
58
+ "mcp-alphabanana": {
59
+ "command": "npx",
60
+ "args":["-y", "@tasopen/mcp-alphabanana"],
61
+ "env": {
62
+ "GEMINI_API_KEY": "${env:GEMINI_API_KEY}" // or "your_api_key_here"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ **オプション:** 書き込み失敗時のカスタムフォールバックディレクトリを指定する場合は `MCP_FALLBACK_OUTPUT` を `env` に追加してください。
71
+
72
+ ## Antigravity (mcp_config.json)
73
+
74
+ Antigravity ではグローバルな `mcp_config.json` で MCP サーバーを登録します。例:
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "mcp-alphabanana": {
80
+ "command": "npx",
81
+ "args": ["-y", "@tasopen/mcp-alphabanana"],
82
+ "env": {
83
+ "GEMINI_API_KEY": "your_api_key_here"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ 注: このリポジトリでは `mcp_config.json` に `mcp-alphabanana` エントリ(Antigravity)を追加し、サーバー起動と画像生成の動作を確認しています。
91
+
92
+ ## Claude Desktop
93
+
94
+ Claude Desktop で MCP サーバーを動かす場合は `claude_desktop_config.json` にエントリを追加:
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "mcp-alphabanana": {
100
+ "command": "npx",
101
+ "args": ["-y", "@tasopen/mcp-alphabanana"],
102
+ "env": {
103
+ "GEMINI_API_KEY": "your_api_key_here"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ テスト済み: 上記エントリを Claude Desktop に追加しサーバーを起動すると、MCP サーバーが起動し画像生成が動作しました。
111
+
112
+ ### 環境変数
113
+
114
+ | 変数 | 必須 | 説明 |
115
+ |----------|----------|-------------|
116
+ | `GEMINI_API_KEY` | Yes | Google AI Studio APIキー。`mcp.json` で OS 環境変数参照(`${env:GEMINI_API_KEY}`)または直接キー記載(エージェントが OS 環境変数にアクセス不可な場合) |
117
+ | `MCP_FALLBACK_OUTPUT` | No | 書き込み失敗時のフォールバックディレクトリ(デフォルト: `<install-dir>/fallback-output`) |
118
+
119
+ ### 出力パスのベストプラクティス
120
+
121
+ **常に `outputPath` には絶対パスを使ってください:**
122
+
123
+ ✅ 良い例: "C:/Users/you/project/assets", "/home/user/images"
124
+ ❌ 悪い例: `"./"`, `"output/"`, `"../images"`
125
+
126
+ 相対パスは MCP サーバーの作業ディレクトリから解決されるため、サービス実行時に予期しない場所にファイルが作成される可能性があります。
127
+
128
+ **フォールバック動作:**
129
+ - 指定した `outputPath` が書き込み可能 → 通常通り画像を保存
130
+ - 書き込み不可(パーミッション拒否など) → フォールバックディレクトリに保存しレスポンスに `warning` を含める
131
+ - フォールバックも失敗した場合 → エラーを返す
132
+
133
+ ## 開発
134
+
135
+ ```bash
136
+ # 開発モード(MCP CLI)
137
+ npm run dev
138
+
139
+ # MCP Inspector (Web UI)
140
+ npm run inspect
141
+
142
+ # 本番用ビルド
143
+ npm run build
144
+ ```
145
+
146
+ ## ツール: generate_image
147
+
148
+ Gemini AI で画像アセットを生成(オプションで透過・参照画像対応)。
149
+
150
+ ### パラメータ
151
+
152
+ | パラメータ | 型 | デフォルト | 説明 |
153
+ |-----------|------|---------|-------------|
154
+ | `prompt` | string | *必須* | 生成する画像の説明 |
155
+ | `outputFileName` | string | *必須* | 出力ファイル名(拡張子がない場合は自動追加) |
156
+ | `outputType` | enum | `combine` | 出力形式: `file`、`base64`、または`combine` |
157
+ | `modelTier` | enum | *必須* | モデル: `flash` (Gemini 2.5 Flash, 最大3参照) または `pro` (Gemini 3 Pro, 最大14参照) |
158
+ | `sourceResolution` | enum | `1K` | Gemini生成解像度: `1K`、`2K`、または`4K` (2K/4Kはproのみ) |
159
+ | `outputWidth` | number | `1024` | 出力幅(ピクセル、8-4096) |
160
+ | `outputHeight` | number | `1024` | 出力高さ(ピクセル、8-4096) |
161
+ | `outputFormat` | enum | `png` | 出力形式: `png`または`jpg` |
162
+ | `outputPath` | string | *任意* | 絶対パスの出力ディレクトリ(ファイル保存時は必須) |
163
+ | `transparent` | boolean | `false` | 透過背景をリクエスト(PNGのみ) |
164
+ | `transparentColor` | string | `null` | 透過にする色(例: `#FF00FF`、未指定時は #FF00FF) |
165
+ | `colorTolerance` | number | `30` | 透過色マッチングの許容範囲(0-255) |
166
+ | `fringeMode` | enum | `auto` | フリンジ処理: `auto`、`crisp`、`hd`(autoは128px以下で`crisp`、それ以外は`hd`) |
167
+ | `resizeMode` | enum | `crop` | リサイズモード: `crop`、`stretch`、`letterbox`、または`contain` |
168
+ | `referenceImages` | array | `[]` | スタイルガイダンス用の参照画像(ファイルパス) |
169
+ | `debug` | boolean | `false` | デバッグモード: 中間画像を出力 |
170
+
171
+ ### 使用例
172
+
173
+ #### 基本的な生成
174
+
175
+ ```json
176
+ {
177
+ "prompt": "ピクセルアートの宝箱、金の装飾、木の質感",
178
+ "modelTier": "flash",
179
+ "outputFileName": "chest",
180
+ "outputWidth": 64,
181
+ "outputHeight": 64,
182
+ "transparent": true
183
+ }
184
+ ```
185
+
186
+ #### 透過スプライト
187
+
188
+ ```json
189
+ {
190
+ "prompt": "レトロゲーム風の宇宙戦闘機スプライト、青みがかった銀色、輪郭がはっきり、背景なし、文字・数字・ロゴを含めない",
191
+ "modelTier": "flash",
192
+ "outputFileName": "space_fighter",
193
+ "outputWidth": 64,
194
+ "outputHeight": 64,
195
+ "transparent": true
196
+ }
197
+ ```
198
+
199
+ #### 透過 + フリンジ制御
200
+
201
+ ```json
202
+ {
203
+ "prompt": "アニメ調 自転車に乗った少女",
204
+ "modelTier": "flash",
205
+ "outputFileName": "bicycle_girl",
206
+ "outputWidth": 1024,
207
+ "outputHeight": 576,
208
+ "transparent": true,
209
+ "colorTolerance": 30,
210
+ "fringeMode": "crisp"
211
+ }
212
+ ```
213
+
214
+ #### 高解像度背景
215
+
216
+ ```json
217
+ {
218
+ "prompt": "夕暮れのファンタジーの森、光る茸",
219
+ "outputFileName": "forest_bg",
220
+ "modelTier": "pro",
221
+ "sourceResolution": "4K",
222
+ "outputWidth": 3840,
223
+ "outputHeight": 2160,
224
+ "outputFormat": "jpg",
225
+ "outputPath": "C:/Users/you/project/assets/backgrounds"
226
+ }
227
+ ```
228
+
229
+ #### 参照画像を使用
230
+
231
+ ```json
232
+ {
233
+ "prompt": "同じピクセルアートスタイルで、開いた状態の宝箱",
234
+ "modelTier": "flash",
235
+ "outputFileName": "chest_open",
236
+ "outputWidth": 64,
237
+ "outputHeight": 64,
238
+ "transparent": true,
239
+ "referenceImages": [
240
+ {
241
+ "description": "スタイル参照用の閉じた宝箱",
242
+ "filePath": "C:/Users/you/project/assets/references/chest_closed.png"
243
+ }
244
+ ]
245
+ }
246
+ ```
247
+
248
+ ## 出力タイプ
249
+
250
+ | タイプ | ファイル保存 | Base64返却 | MCP画像コンテンツ |
251
+ |------|-----------|----------------|-------------------|
252
+ | `file` | ✓ | ✗ | ✗ |
253
+ | `base64` | ✗ | ✓ | ✓ |
254
+ | `combine` | ✓ | ✓ | ✓ |
255
+
256
+ ## 透過処理
257
+
258
+ サーバーはヒストグラム分析と色相近接により背景色を推定し、RGB距離でキー抜きを行いデスピルします。候補がなければ最も近い色相のコーナーカラーを使用します。
259
+
260
+ ### モデルメモ
261
+
262
+ - 透過 PNG 出力は通常 flash で十分です。
263
+ - `colorTolerance` は 30 前後が最も安定しました。高すぎると誤検出が増えます。
264
+
265
+ ### 推奨背景色
266
+
267
+ | 色 | 16進数 | 最適な用途 |
268
+ |-------|-----|----------|
269
+ | マゼンタ | `#FF00FF` | ほとんどのスプライト(デフォルト、両モデルで動作) |
270
+ | 緑 | `#00FF00` | 紫/ピンクのオブジェクト |
271
+ | シアン | `#00FFFF` | 赤/オレンジのオブジェクト |
272
+ | 青 | `#0000FF` | 黄/緑のオブジェクト |
273
+
274
+ ### 例
275
+
276
+ ```json
277
+ {
278
+ "transparent": true,
279
+ "transparentColor": "#00FF00",
280
+ "colorTolerance": 30
281
+ }
282
+ ```
283
+
284
+ ### Fringe Mode ガイド
285
+
286
+ - 細い線が消えやすい場合(ドット絵、スポーク、ワイヤーメッシュ等)は `crisp`
287
+ - 高解像度画像でフリンジが目立つ場合は `hd`
288
+ - `auto` はサイズで自動切替(128px 以下は `crisp`、それ以外は `hd`)
289
+
290
+ ## ライセンス
291
+
292
+ MIT
package/README.md ADDED
@@ -0,0 +1,296 @@
1
+ # mcp-alphabanana
2
+
3
+ English | [日本語](README.ja.md)
4
+
5
+ A Model Context Protocol (MCP) server for generating image assets using Google Gemini AI.
6
+
7
+ Built with [FastMCP 3](https://www.npmjs.com/package/fastmcp) for a simplified codebase and flexible output options.
8
+
9
+ ## Features
10
+
11
+ - **General-purpose image generation** using Google Gemini AI
12
+ - **Transparent PNG output** via color-key post-processing
13
+ - **Multiple output formats**: file, base64, or both
14
+ - **Reference image support** for style guidance
15
+ - **Flexible resize modes**: crop, stretch, letterbox, contain
16
+ - **Multiple model tiers**: flash (Gemini 2.5 Flash) or pro (Gemini 3 Pro)
17
+
18
+ ## Installation
19
+
20
+ add `@tasopen/mcp-alphabanana` to your MCP Servers configuration.
21
+
22
+ ## Configuration
23
+
24
+ Configure the `GEMINI_API_KEY` in your MCP configuration (e.g. `mcp.json`). Some agent environments cannot access OS environment variables, so you can either reference an OS environment variable from `mcp.json` or provide the key directly in `mcp.json`.
25
+
26
+ Examples:
27
+
28
+ - Reference an OS environment variable from `mcp.json`:
29
+
30
+ ```json
31
+ {
32
+ "env": {
33
+ "GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
34
+ }
35
+ }
36
+ ```
37
+
38
+ - Provide the key directly in `mcp.json` (useful when the agent cannot access OS env vars):
39
+
40
+ ```json
41
+ {
42
+ "env": {
43
+ "GEMINI_API_KEY": "your_api_key_here"
44
+ }
45
+ }
46
+ ```
47
+
48
+ Use whichever method suits your deployment — prefer environment references when possible, but include the key directly when agent constraints require it.
49
+
50
+ ## VS Code Integration
51
+
52
+ Add to your VS Code settings (`.vscode/settings.json` or user settings), configuring the server `env` in `mcp.json` or via the VS Code MCP settings. You can reference an OS environment variable or put the key directly:
53
+
54
+ ```json
55
+ {
56
+ "mcp": {
57
+ "servers": {
58
+ "mcp-alphabanana": {
59
+ "command": "npx",
60
+ "args":["-y", "@tasopen/mcp-alphabanana"],
61
+ "env": {
62
+ "GEMINI_API_KEY": "${env:GEMINI_API_KEY}" // or "your_api_key_here"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ **Optional:** Set a custom fallback directory for write failures by adding `MCP_FALLBACK_OUTPUT` to the `env` object.
71
+
72
+ ## Antigravity (mcp_config.json)
73
+
74
+ Antigravity uses a global `mcp_config.json` to register MCP servers. Example `mcp_config.json`:
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "mcp-alphabanana": {
80
+ "command": "npx",
81
+ "args": ["-y", "@tasopen/mcp-alphabanana"],
82
+ "env": {
83
+ "GEMINI_API_KEY": "your_api_key_here"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ Note: In this repository we used an `mcp_config.json` with the `mcp-alphabanana` entry (Antigravity) and confirmed the server started and generated images successfully.
91
+
92
+ ## Claude Desktop
93
+
94
+ If you run MCP servers via Claude Desktop, add an entry in `claude_desktop_config.json`:
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "mcp-alphabanana": {
100
+ "command": "npx",
101
+ "args": ["-y", "@tasopen/mcp-alphabanana"],
102
+ "env": {
103
+ "GEMINI_API_KEY": "your_api_key_here"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ Tested: Adding the above entry in Claude Desktop and starting the server launched the MCP server and image generation worked.
111
+
112
+ ### Environment Variables
113
+
114
+ | Variable | Required | Description |
115
+ |----------|----------|-------------|
116
+ | `GEMINI_API_KEY` | Yes | Google AI Studio API Key. Configure in `mcp.json` either by referencing an OS environment variable (`${env:GEMINI_API_KEY}`) or by including the key directly (some agents cannot access OS env vars). |
117
+ | `MCP_FALLBACK_OUTPUT` | No | Fallback directory for write failures (default: `<install-dir>/fallback-output`) |
118
+
119
+ ### Output Path Best Practices
120
+
121
+ **Always use absolute paths for `outputPath`:**
122
+
123
+ ✅ **Good:** "C:/Users/you/project/assets", "/home/user/images"
124
+ ❌ **Bad:** `"./"`, `"output/"`, `"../images"`
125
+
126
+ Relative paths are resolved from the MCP server's working directory (unpredictable when running as a service), leading to unexpected file locations.
127
+
128
+ **Fallback behavior:**
129
+ - If the requested `outputPath` is writable → image saved there as usual
130
+ - If not writable (permission denied, etc.) → saves to fallback directory with `warning` in response
131
+ - Fallback directory: `MCP_FALLBACK_OUTPUT` env var, or `<install-dir>/fallback-output` by default
132
+ - If fallback also fails → returns error
133
+
134
+ ## Development
135
+
136
+ ```bash
137
+ # Development mode with MCP CLI
138
+ npm run dev
139
+
140
+ # MCP Inspector (Web UI)
141
+ npm run inspect
142
+
143
+ # Build for production
144
+ npm run build
145
+ ```
146
+
147
+ ## Tool: generate_image
148
+
149
+ Generate image assets using Gemini AI with optional transparency and reference images.
150
+
151
+ ### Parameters
152
+
153
+ | Parameter | Type | Default | Description |
154
+ |-----------|------|---------|-------------|
155
+ | `prompt` | string | *required* | Description of the image to generate |
156
+ | `outputFileName` | string | *required* | Output filename (extension auto-added if missing) |
157
+ | `outputType` | enum | `combine` | Output format: `file`, `base64`, or `combine` |
158
+ | `modelTier` | enum | *required* | Model: `flash` (Gemini 2.5 Flash, max 3 refs) or `pro` (Gemini 3 Pro, max 14 refs) |
159
+ | `sourceResolution` | enum | `1K` | Gemini source resolution: `1K`, `2K`, or `4K` (2K/4K pro-only) |
160
+ | `outputWidth` | number | `1024` | Output width in pixels (8-4096) |
161
+ | `outputHeight` | number | `1024` | Output height in pixels (8-4096) |
162
+ | `outputFormat` | enum | `png` | Output format: `png` or `jpg` |
163
+ | `outputPath` | string | *optional* | Absolute output directory path (required when saving files) |
164
+ | `transparent` | boolean | `false` | Request transparent background (PNG only) |
165
+ | `transparentColor` | string | `null` | Color to make transparent (e.g., `#FF00FF`), defaults to `#FF00FF` when null |
166
+ | `colorTolerance` | number | `30` | Tolerance for transparent color matching (0-255) |
167
+ | `fringeMode` | enum | `auto` | Fringe reduction mode: `auto`, `crisp`, `hd` (auto uses `crisp` <= 128px, otherwise `hd`) |
168
+ | `resizeMode` | enum | `crop` | Resize mode: `crop`, `stretch`, `letterbox`, or `contain` |
169
+ | `referenceImages` | array | `[]` | Reference images for style guidance (file paths) |
170
+ | `debug` | boolean | `false` | Debug mode: output intermediate images |
171
+
172
+ ### Usage Examples
173
+
174
+ #### Basic Generation
175
+
176
+ ```json
177
+ {
178
+ "prompt": "A pixel art treasure chest, golden trim, wooden texture",
179
+ "modelTier": "flash",
180
+ "outputFileName": "chest",
181
+ "outputWidth": 64,
182
+ "outputHeight": 64,
183
+ "transparent": true
184
+ }
185
+ ```
186
+
187
+
188
+ #### Transparent Sprite
189
+
190
+ ```json
191
+ {
192
+ "prompt": "Retro game-style space fighter sprite, blue-tinted silver, clean silhouette, no background, no text, no letters, no numbers, no logos",
193
+ "modelTier": "flash",
194
+ "outputFileName": "space_fighter",
195
+ "outputWidth": 64,
196
+ "outputHeight": 64,
197
+ "transparent": true
198
+ }
199
+ ```
200
+
201
+
202
+ #### Transparency + Fringe Control
203
+
204
+ ```json
205
+ {
206
+ "prompt": "Anime-style girl riding a bicycle",
207
+ "modelTier": "flash",
208
+ "outputFileName": "bicycle_girl",
209
+ "outputWidth": 1024,
210
+ "outputHeight": 576,
211
+ "transparent": true,
212
+ "colorTolerance": 30,
213
+ "fringeMode": "crisp"
214
+ }
215
+ ```
216
+
217
+
218
+ #### High-Resolution Background
219
+
220
+ ```json
221
+ {
222
+ "prompt": "Fantasy forest at twilight with glowing mushrooms",
223
+ "outputFileName": "forest_bg",
224
+ "modelTier": "pro",
225
+ "sourceResolution": "4K",
226
+ "outputWidth": 3840,
227
+ "outputHeight": 2160,
228
+ "outputFormat": "jpg",
229
+ "outputPath": "C:/Users/you/project/assets/backgrounds"
230
+ }
231
+ ```
232
+
233
+ #### With Reference Image
234
+
235
+ ```json
236
+ {
237
+ "prompt": "A matching treasure chest, open state, same pixel art style",
238
+ "modelTier": "flash",
239
+ "outputFileName": "chest_open",
240
+ "outputWidth": 64,
241
+ "outputHeight": 64,
242
+ "transparent": true,
243
+ "referenceImages": [
244
+ {
245
+ "description": "Closed chest for style reference",
246
+ "filePath": "C:/Users/you/project/assets/references/chest_closed.png"
247
+ }
248
+ ]
249
+ }
250
+ ```
251
+
252
+ ## Output Types
253
+
254
+ | Type | Saves File | Returns Base64 | MCP Image Content |
255
+ |------|-----------|----------------|-------------------|
256
+ | `file` | ✓ | ✗ | ✗ |
257
+ | `base64` | ✗ | ✓ | ✓ |
258
+ | `combine` | ✓ | ✓ | ✓ |
259
+
260
+ ## Transparency Processing
261
+
262
+ The server selects the background color by histogram analysis and hue proximity to the requested key color, then applies RGB-distance keying and despill. If no histogram candidate qualifies, it falls back to the closest-hue corner color.
263
+
264
+ ### Model Notes
265
+
266
+ - Flash is sufficient for transparent PNG output in typical use.
267
+ - `colorTolerance` around 30 performed best in tests; higher values can increase false positives.
268
+
269
+ ### Recommended Background Colors
270
+
271
+ | Color | Hex | Best For |
272
+ |-------|-----|----------|
273
+ | Magenta | `#FF00FF` | Most sprites (default, works with both models) |
274
+ | Green | `#00FF00` | Purple/pink objects |
275
+ | Cyan | `#00FFFF` | Red/orange objects |
276
+ | Blue | `#0000FF` | Yellow/green objects |
277
+
278
+ ### Examples
279
+
280
+ ```json
281
+ {
282
+ "transparent": true,
283
+ "transparentColor": "#00FF00",
284
+ "colorTolerance": 30
285
+ }
286
+ ```
287
+
288
+ ### Fringe Mode Guidance
289
+
290
+ - Use `crisp` when thin lines risk being removed (pixel art, bicycle spokes, wire meshes).
291
+ - Use `hd` for general high-resolution images where fringe is noticeable.
292
+ - Use `auto` for a size-based default (`crisp` for <= 128px, `hd` otherwise).
293
+
294
+ ## License
295
+
296
+ MIT
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * mcp-alphabanana - FastMCP server for image generation using Google Gemini AI.
4
+ * Supports transparent PNG output, multiple resolutions, and style references.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}