@tasopen/mcp-alphabanana 1.3.4 → 1.3.6
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 +21 -21
- package/README.ja.md +285 -191
- package/README.md +286 -193
- package/alphabanana.gif +0 -0
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/utils/gemini-client.js +16 -16
- package/examples/photoreal-travel-poster.jpg +0 -0
- package/examples/pixel-art-treasure-chest.png +0 -0
- package/examples/reference-image-dungeon-loot.webp +0 -0
- package/package.json +72 -52
package/LICENSE
CHANGED
|
@@ -1,21 +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.
|
|
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
CHANGED
|
@@ -1,191 +1,285 @@
|
|
|
1
|
-
# mcp-alphabanana
|
|
2
|
-
|
|
3
|
-
[
|
|
4
|
-
](https://www.npmjs.com/package/@tasopen/mcp-alphabanana)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
[English](README.md) | 日本語
|
|
7
|
+
|
|
8
|
+
mcp-alphabanana は、Google Gemini を使って画像アセットを生成する Model Context Protocol (MCP) サーバーです。高速な画像生成・透過出力・参照画像ガイダンス・柔軟な出力形式を必要とする MCP 対応クライアントやエージェントワークフロー向けに設計されています。
|
|
9
|
+
|
|
10
|
+
キーワード: MCP サーバー、Model Context Protocol、Gemini AI、画像生成、FastMCP
|
|
11
|
+
|
|
12
|
+
主な特長:
|
|
13
|
+
- Gemini Flash / Pro を使ったウルトラ高速画像生成
|
|
14
|
+
- Web・ゲームパイプライン向けの透過 PNG / WebP アセット出力
|
|
15
|
+
- ローカル参照画像を使ったマルチ画像スタイルガイダンス
|
|
16
|
+
- エージェントワークフロー向けの file / base64 / combine 出力
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
## クイックスタート
|
|
21
|
+
|
|
22
|
+
npx で MCP サーバーを起動:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y @tasopen/mcp-alphabanana
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
または MCP 設定ファイルに追加:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcp": {
|
|
33
|
+
"servers": {
|
|
34
|
+
"alphabanana": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "@tasopen/mcp-alphabanana"],
|
|
37
|
+
"env": {
|
|
38
|
+
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
起動前に `GEMINI_API_KEY` を設定してください。
|
|
47
|
+
|
|
48
|
+
## MCP サーバーについて
|
|
49
|
+
|
|
50
|
+
このリポジトリは、AI エージェントが Google Gemini を使って画像を生成できる MCP サーバーを提供します。
|
|
51
|
+
|
|
52
|
+
以下のような MCP 対応クライアントで利用できます:
|
|
53
|
+
|
|
54
|
+
- Claude Desktop
|
|
55
|
+
- VS Code MCP
|
|
56
|
+
- Cursor
|
|
57
|
+
|
|
58
|
+
[FastMCP 3](https://www.npmjs.com/package/fastmcp) を使ってシンプルなコードベースと柔軟な出力オプションを実現しています。
|
|
59
|
+
|
|
60
|
+
## 利用可能なツール
|
|
61
|
+
|
|
62
|
+
### generate_image
|
|
63
|
+
|
|
64
|
+
透過処理・ローカル参照画像・Grounding・Reasoning メタデータを任意で指定しながら、Google Gemini で画像を生成します。
|
|
65
|
+
|
|
66
|
+
主なパラメータ:
|
|
67
|
+
|
|
68
|
+
- `prompt` (string): 生成したい画像の説明
|
|
69
|
+
- `model`: `Flash3.1`、`Flash2.5`、`Pro3`、`flash`、`pro`
|
|
70
|
+
- `outputWidth` / `outputHeight`: 出力画像のピクセルサイズ
|
|
71
|
+
- `output_resolution`: `0.5K`、`1K`、`2K`、`4K`
|
|
72
|
+
- `output_format`: `png`、`jpg`、`webp`
|
|
73
|
+
- `outputType`: `file`、`base64`、`combine`
|
|
74
|
+
- `outputPath`: `outputType` が `file` または `combine` の場合に必須
|
|
75
|
+
- `transparent`: 透過 PNG / WebP 後処理を有効化
|
|
76
|
+
- `referenceImages`: ローカル参照画像ファイルの配列(任意)
|
|
77
|
+
- `grounding_type` / `thinking_mode`: Gemini 3.1 の高度な制御
|
|
78
|
+
|
|
79
|
+
### モデル選択
|
|
80
|
+
|
|
81
|
+
| 入力モデルID | 内部モデルID | 説明 |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `Flash3.1` | `gemini-3.1-flash-image-preview` | 超高速。Thinking / Grounding 対応。 |
|
|
84
|
+
| `Flash2.5` | `gemini-2.5-flash-image` | 旧 Flash 系。安定性高め。低コスト。 |
|
|
85
|
+
| `Pro3` | `gemini-3.0-pro-image-preview` | 高品質な Pro モデル。 |
|
|
86
|
+
| `flash` | `gemini-3.1-flash-image-preview` | 後方互換エイリアス。 |
|
|
87
|
+
| `pro` | `gemini-3.0-pro-image-preview` | 後方互換エイリアス。 |
|
|
88
|
+
|
|
89
|
+
### パラメータ
|
|
90
|
+
|
|
91
|
+
`generate_image` ツールの全パラメータ一覧。
|
|
92
|
+
|
|
93
|
+
| パラメータ | 型 | 既定値 | 説明 |
|
|
94
|
+
|-----------|------|---------|-------------|
|
|
95
|
+
| `prompt` | string | 必須 | 生成したい画像の説明 |
|
|
96
|
+
| `outputFileName` | string | 必須 | 出力ファイル名(拡張子がなければ自動付与) |
|
|
97
|
+
| `outputType` | enum | `combine` | `file`、`base64`、または `combine` |
|
|
98
|
+
| `model` | enum | `Flash3.1` | `Flash3.1` / `Flash2.5` / `Pro3` / `flash` / `pro` |
|
|
99
|
+
| `output_resolution` | enum | auto | `0.5K` / `1K` / `2K` / `4K`(0.5K/2K/4K は Flash3.1 のみ) |
|
|
100
|
+
| `outputWidth` | integer | 必須 | 出力幅(ピクセル) |
|
|
101
|
+
| `outputHeight` | integer | 必須 | 出力高さ(ピクセル) |
|
|
102
|
+
| `output_format` | enum | `png` | `png` / `jpg` / `webp` |
|
|
103
|
+
| `outputPath` | string | `file` / `combine` 時に必須 | 出力ディレクトリの絶対パス |
|
|
104
|
+
| `transparent` | boolean | `false` | 背景透過(PNG / WebP のみ) |
|
|
105
|
+
| `transparentColor` | string または null | `null` | 透過カラーキーの上書き指定 |
|
|
106
|
+
| `colorTolerance` | integer | `30` | 透過カラーのマッチング許容範囲 |
|
|
107
|
+
| `fringeMode` | enum | `auto` | `auto` / `crisp` / `hd` |
|
|
108
|
+
| `resizeMode` | enum | `crop` | `crop` / `stretch` / `letterbox` / `contain` |
|
|
109
|
+
| `grounding_type` | enum | `none` | `none` / `text` / `image` / `both`(Flash3.1 のみ) |
|
|
110
|
+
| `thinking_mode` | enum | `minimal` | `minimal` / `high`(Flash3.1 のみ) |
|
|
111
|
+
| `include_thoughts` | boolean | `false` | メタデータ有効時にモデルの推論フィールドを返す |
|
|
112
|
+
| `include_metadata` | boolean | `false` | JSON 出力に grounding / reasoning メタデータを含める |
|
|
113
|
+
| `referenceImages` | array | `[]` | 最大 14 ファイル(Flash3.1/Pro3)、Flash2.5 は 3 枚 |
|
|
114
|
+
| `debug` | boolean | `false` | デバッグ用途の中間ファイルを保存 |
|
|
115
|
+
|
|
116
|
+
## mcp-alphabanana を選ぶ理由
|
|
117
|
+
|
|
118
|
+
- **ウォーターマークなし:** API ネイティブ生成によるクリーンな画像。
|
|
119
|
+
- **Thinking / Grounding 対応:** 複雑なプロンプトへの忠実度向上と検索連携による正確な描写。
|
|
120
|
+
- **即戦力の出力仕様:** 透過 WebP と正確なアスペクト比に対応し、Web・ゲーム素材としてそのまま使用可能。
|
|
121
|
+
|
|
122
|
+
## 主な機能
|
|
123
|
+
|
|
124
|
+
- **超高速画像生成**(Gemini 3.1 Flash、0.5K/1K/2K/4K)
|
|
125
|
+
- **高度なマルチ画像推論**(参照画像を最大 14 枚)
|
|
126
|
+
- **Thinking / Grounding 対応**(Flash3.1 のみ)
|
|
127
|
+
- **透過 PNG / WebP 出力**(カラーキー後処理 + デスピル)
|
|
128
|
+
- **複数の出力形式**: file / base64 / combine
|
|
129
|
+
- **柔軟なリサイズモード**: crop / stretch / letterbox / contain
|
|
130
|
+
- **複数モデルティア**: Flash3.1 / Flash2.5 / Pro3 / 互換エイリアス
|
|
131
|
+
|
|
132
|
+
## 出力サンプル
|
|
133
|
+
|
|
134
|
+
mcp-alphabanana で生成したサンプルを [examples](examples) に収録しています。
|
|
135
|
+
|
|
136
|
+
| ピクセルアートアセット | 参照画像を使ったゲームシーン | フォトリアル生成 |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
|  |  |  |
|
|
139
|
+
|
|
140
|
+
## 設定
|
|
141
|
+
|
|
142
|
+
`GEMINI_API_KEY` を MCP 設定(例: `mcp.json`)で指定します。
|
|
143
|
+
|
|
144
|
+
例:
|
|
145
|
+
|
|
146
|
+
- `mcp.json` で OS 環境変数を参照する場合:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"env": {
|
|
151
|
+
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
- `mcp.json` に直接キーを記載する場合:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"env": {
|
|
161
|
+
"GEMINI_API_KEY": "your_api_key_here"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### VS Code 連携
|
|
167
|
+
|
|
168
|
+
VS Code 設定(`.vscode/settings.json` またはユーザー設定)に追加してください。`env` は `mcp.json` もしくは VS Code MCP 設定経由で指定できます。
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"mcp": {
|
|
173
|
+
"servers": {
|
|
174
|
+
"mcp-alphabanana": {
|
|
175
|
+
"command": "npx",
|
|
176
|
+
"args": ["-y", "@tasopen/mcp-alphabanana"],
|
|
177
|
+
"env": {
|
|
178
|
+
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**任意:** 書き込み失敗時の保存先を変更したい場合は、`env` に `MCP_FALLBACK_OUTPUT` を追加してください。
|
|
187
|
+
|
|
188
|
+
## 使用例
|
|
189
|
+
|
|
190
|
+
#### 基本生成
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"prompt": "金の縁取りがある木製のピクセルアート宝箱",
|
|
195
|
+
"model": "Flash3.1",
|
|
196
|
+
"outputFileName": "chest",
|
|
197
|
+
"outputType": "base64",
|
|
198
|
+
"outputWidth": 64,
|
|
199
|
+
"outputHeight": 64,
|
|
200
|
+
"transparent": true
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### 応用例(縦型ポスター + Thinking)
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"prompt": "ヨーロッパの黄金色の夕暮れの田園風景の上を翼を広げた若いカップルが手をつないで飛ぶ、縦型フォトリアル旅行ポスター。ブドウ畑・村・森・川・丘の上の中世の城が広がる風景。上部に大きな見出し FLY THE COUNTRYSIDE、下部に Magical Wings Day Tours のブランド表記。",
|
|
209
|
+
"model": "Flash3.1",
|
|
210
|
+
"output_resolution": "1K",
|
|
211
|
+
"outputFileName": "photoreal-travel-poster",
|
|
212
|
+
"outputType": "file",
|
|
213
|
+
"outputPath": "/path/to/output",
|
|
214
|
+
"outputWidth": 848,
|
|
215
|
+
"outputHeight": 1264,
|
|
216
|
+
"output_format": "jpg",
|
|
217
|
+
"thinking_mode": "high",
|
|
218
|
+
"include_metadata": true
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Grounding サンプル(検索連携)
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"prompt": "クアラルンプールの今日の天気と主要スカイラインを盛り込んだモダンな旅行ポスター",
|
|
227
|
+
"model": "Flash3.1",
|
|
228
|
+
"outputFileName": "kl_travel_poster",
|
|
229
|
+
"outputType": "base64",
|
|
230
|
+
"outputWidth": 1024,
|
|
231
|
+
"outputHeight": 1024,
|
|
232
|
+
"grounding_type": "text",
|
|
233
|
+
"thinking_mode": "high",
|
|
234
|
+
"include_metadata": true,
|
|
235
|
+
"include_thoughts": true
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
このサンプルでは Google Search Grounding を有効化し、JSON に grounding / reasoning メタデータを返します。
|
|
240
|
+
|
|
241
|
+
#### 参照画像つき生成
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"prompt": "参照画像を使って、コインと財宝で満たされた開いた宝箱を映すゲーム画面を生成して。8ビットダンジョンクローラーのスタイル、バトル報酬シーン、ダンジョン回廊の背景、画面下部に4人パーティのステータスUI",
|
|
246
|
+
"model": "Flash3.1",
|
|
247
|
+
"output_resolution": "0.5K",
|
|
248
|
+
"outputFileName": "reference-image-dungeon-loot",
|
|
249
|
+
"outputType": "file",
|
|
250
|
+
"outputPath": "/path/to/output",
|
|
251
|
+
"outputWidth": 600,
|
|
252
|
+
"outputHeight": 448,
|
|
253
|
+
"output_format": "webp",
|
|
254
|
+
"transparent": false,
|
|
255
|
+
"referenceImages": [
|
|
256
|
+
{
|
|
257
|
+
"description": "宝箱のスタイル参照",
|
|
258
|
+
"filePath": "/path/to/references/pixel-art-treasure-chest.png"
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## 透過と出力形式
|
|
265
|
+
|
|
266
|
+
- **PNG**: 完全アルファ対応、カラーキー + デスピル
|
|
267
|
+
- **WebP**: 完全アルファ対応、より高い圧縮効率(Flash3.1 以降)
|
|
268
|
+
- **JPEG**: 透過非対応(不透明背景にフォールバック)
|
|
269
|
+
|
|
270
|
+
## 開発
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# 開発モード(MCP CLI)
|
|
274
|
+
npm run dev
|
|
275
|
+
|
|
276
|
+
# MCP Inspector(Web UI)
|
|
277
|
+
npm run inspect
|
|
278
|
+
|
|
279
|
+
# 本番ビルド
|
|
280
|
+
npm run build
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## ライセンス
|
|
284
|
+
|
|
285
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,193 +1,286 @@
|
|
|
1
|
-
# mcp-alphabanana
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
](https://www.npmjs.com/package/@tasopen/mcp-alphabanana)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
English | [日本語](README.ja.md)
|
|
7
|
+
|
|
8
|
+
mcp-alphabanana is a Model Context Protocol (MCP) server for generating image assets with Google Gemini. It is built for MCP-compatible clients and agent workflows that need fast image generation, transparent outputs, reference-image guidance, and flexible delivery formats.
|
|
9
|
+
|
|
10
|
+
Keywords: MCP server, Model Context Protocol, Gemini AI, image generation, FastMCP
|
|
11
|
+
|
|
12
|
+
Key capabilities:
|
|
13
|
+
- Ultra-fast Gemini image generation across Flash and Pro tiers
|
|
14
|
+
- Transparent PNG/WebP asset output for web and game pipelines
|
|
15
|
+
- Multi-image style guidance with local reference image files
|
|
16
|
+
- Flexible file, base64, or combined outputs for agent workflows
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
Run the MCP server with npx:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y @tasopen/mcp-alphabanana
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or add it to your MCP configuration:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcp": {
|
|
33
|
+
"servers": {
|
|
34
|
+
"alphabanana": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "@tasopen/mcp-alphabanana"],
|
|
37
|
+
"env": {
|
|
38
|
+
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Set `GEMINI_API_KEY` before starting the server.
|
|
47
|
+
|
|
48
|
+
## MCP Server
|
|
49
|
+
|
|
50
|
+
This repository provides an MCP server that enables AI agents to generate images using Google Gemini.
|
|
51
|
+
|
|
52
|
+
It can be used with MCP-compatible clients such as:
|
|
53
|
+
|
|
54
|
+
- Claude Desktop
|
|
55
|
+
- VS Code MCP
|
|
56
|
+
- Cursor
|
|
57
|
+
|
|
58
|
+
Built with [FastMCP 3](https://www.npmjs.com/package/fastmcp) for a simplified codebase and flexible output options.
|
|
59
|
+
|
|
60
|
+
## Available Tools
|
|
61
|
+
|
|
62
|
+
### generate_image
|
|
63
|
+
|
|
64
|
+
Generates images using Google Gemini with optional transparency, local reference images, grounding, and reasoning metadata.
|
|
65
|
+
|
|
66
|
+
Key parameters:
|
|
67
|
+
|
|
68
|
+
- `prompt` (string): description of the image to generate
|
|
69
|
+
- `model`: `Flash3.1`, `Flash2.5`, `Pro3`, `flash`, `pro`
|
|
70
|
+
- `outputWidth` and `outputHeight`: requested final image size in pixels
|
|
71
|
+
- `output_resolution`: `0.5K`, `1K`, `2K`, `4K`
|
|
72
|
+
- `output_format`: `png`, `jpg`, `webp`
|
|
73
|
+
- `outputType`: `file`, `base64`, `combine`
|
|
74
|
+
- `outputPath`: required when `outputType` is `file` or `combine`
|
|
75
|
+
- `transparent`: enable transparent PNG/WebP post-processing
|
|
76
|
+
- `referenceImages`: optional array of local reference image files
|
|
77
|
+
- `grounding_type` and `thinking_mode`: advanced Gemini 3.1 controls
|
|
78
|
+
|
|
79
|
+
### Model Selection
|
|
80
|
+
|
|
81
|
+
| Input Model ID | Internal Model ID | Description |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `Flash3.1` | `gemini-3.1-flash-image-preview` | Ultra-fast, supports Thinking/Grounding. |
|
|
84
|
+
| `Flash2.5` | `gemini-2.5-flash-image` | Legacy Flash. High stability. Low cost. |
|
|
85
|
+
| `Pro3` | `gemini-3.0-pro-image-preview` | High-fidelity Pro model. |
|
|
86
|
+
| `flash` | `gemini-3.1-flash-image-preview` | Alias for backward compatibility. |
|
|
87
|
+
| `pro` | `gemini-3.0-pro-image-preview` | Alias for backward compatibility. |
|
|
88
|
+
|
|
89
|
+
### Parameters
|
|
90
|
+
|
|
91
|
+
Full parameter reference for the `generate_image` tool.
|
|
92
|
+
|
|
93
|
+
| Parameter | Type | Default | Description |
|
|
94
|
+
|-----------|------|---------|-------------|
|
|
95
|
+
| `prompt` | string | *required* | Description of the image to generate |
|
|
96
|
+
| `outputFileName` | string | *required* | Output filename (extension auto-added if missing) |
|
|
97
|
+
| `outputType` | enum | `combine` | `file`, `base64`, or `combine` |
|
|
98
|
+
| `model` | enum | `Flash3.1` | Model: `Flash3.1`, `Flash2.5`, `Pro3`, `flash`, `pro` |
|
|
99
|
+
| `output_resolution` | enum | auto | `0.5K`, `1K`, `2K`, `4K` (0.5K/2K/4K: Flash3.1 only) |
|
|
100
|
+
| `outputWidth` | integer | *required* | Final output width in pixels |
|
|
101
|
+
| `outputHeight` | integer | *required* | Final output height in pixels |
|
|
102
|
+
| `output_format` | enum | `png` | `png`, `jpg`, `webp` |
|
|
103
|
+
| `outputPath` | string | required for `file` / `combine` | Absolute output directory path |
|
|
104
|
+
| `transparent` | boolean | `false` | Transparent background (PNG/WebP only) |
|
|
105
|
+
| `transparentColor` | string or null | `null` | Color key override for transparency extraction |
|
|
106
|
+
| `colorTolerance` | integer | `30` | Transparency color matching tolerance |
|
|
107
|
+
| `fringeMode` | enum | `auto` | `auto`, `crisp`, `hd` |
|
|
108
|
+
| `resizeMode` | enum | `crop` | `crop`, `stretch`, `letterbox`, `contain` |
|
|
109
|
+
| `grounding_type` | enum | `none` | `none`, `text`, `image`, `both` (Flash3.1 only) |
|
|
110
|
+
| `thinking_mode` | enum | `minimal` | `minimal`, `high` (Flash3.1 only) |
|
|
111
|
+
| `include_thoughts` | boolean | `false` | Return model reasoning fields when metadata is enabled |
|
|
112
|
+
| `include_metadata` | boolean | `false` | Include grounding and reasoning metadata in JSON output |
|
|
113
|
+
| `referenceImages` | array | `[]` | Up to 14 local reference files (Flash3.1/Pro3), 3 for Flash2.5 |
|
|
114
|
+
| `debug` | boolean | `false` | Save intermediate debug artifacts |
|
|
115
|
+
|
|
116
|
+
## Why alphabanana?
|
|
117
|
+
|
|
118
|
+
- **Zero Watermarks:** API-native clean images.
|
|
119
|
+
- **Thinking/Grounding Support:** Higher prompt adherence and search-backed accuracy.
|
|
120
|
+
- **Production Ready:** Supports transparent WebP and exact aspect ratios for web and game assets.
|
|
121
|
+
|
|
122
|
+
## Features
|
|
123
|
+
|
|
124
|
+
- **Ultra-fast image generation** (Gemini 3.1 Flash, 0.5K/1K/2K/4K)
|
|
125
|
+
- **Advanced multi-image reasoning** (up to 14 reference images)
|
|
126
|
+
- **Thinking/Grounding support** (Flash3.1 only)
|
|
127
|
+
- **Transparent PNG/WebP output** (color-key post-processing, despill)
|
|
128
|
+
- **Multiple output formats**: file, base64, or both
|
|
129
|
+
- **Flexible resize modes**: crop, stretch, letterbox, contain
|
|
130
|
+
- **Multiple model tiers**: Flash3.1, Flash2.5, Pro3, legacy aliases
|
|
131
|
+
|
|
132
|
+
## Example Outputs
|
|
133
|
+
|
|
134
|
+
These sample outputs were generated with mcp-alphabanana and stored in [examples](examples).
|
|
135
|
+
|
|
136
|
+
| Pixel art asset | Reference-image game scene | Photorealistic generation |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
|  |  |  |
|
|
139
|
+
|
|
140
|
+
## Configuration
|
|
141
|
+
|
|
142
|
+
Configure the `GEMINI_API_KEY` in your MCP configuration (for example, `mcp.json`).
|
|
143
|
+
|
|
144
|
+
Examples:
|
|
145
|
+
|
|
146
|
+
- Reference an OS environment variable from `mcp.json`:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"env": {
|
|
151
|
+
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
- Provide the key directly in `mcp.json`:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"env": {
|
|
161
|
+
"GEMINI_API_KEY": "your_api_key_here"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### VS Code Integration
|
|
167
|
+
|
|
168
|
+
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.
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"mcp": {
|
|
173
|
+
"servers": {
|
|
174
|
+
"mcp-alphabanana": {
|
|
175
|
+
"command": "npx",
|
|
176
|
+
"args": ["-y", "@tasopen/mcp-alphabanana"],
|
|
177
|
+
"env": {
|
|
178
|
+
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Optional:** Set a custom fallback directory for write failures by adding `MCP_FALLBACK_OUTPUT` to the `env` object.
|
|
187
|
+
|
|
188
|
+
## Usage Examples
|
|
189
|
+
|
|
190
|
+
#### Basic Generation
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"prompt": "A pixel art treasure chest, golden trim, wooden texture",
|
|
195
|
+
"model": "Flash3.1",
|
|
196
|
+
"outputFileName": "chest",
|
|
197
|
+
"outputType": "base64",
|
|
198
|
+
"outputWidth": 64,
|
|
199
|
+
"outputHeight": 64,
|
|
200
|
+
"transparent": true
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### Advanced (Vertical poster and thinking)
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"prompt": "A vertical, photorealistic travel poster advertising Magical Wings Day Tours. A joyful young couple flies high above a breathtaking European countryside at golden hour, holding hands as they soar through a partly cloudy sky. Below them are vineyards, villages, forests, a winding river, and a hilltop medieval castle. The poster uses large, elegant typography with the headline FLY THE COUNTRYSIDE at the top and Magical Wings Day Tours branding near the bottom.",
|
|
209
|
+
"model": "Flash3.1",
|
|
210
|
+
"output_resolution": "1K",
|
|
211
|
+
"outputFileName": "photoreal-travel-poster",
|
|
212
|
+
"outputType": "file",
|
|
213
|
+
"outputPath": "/path/to/output",
|
|
214
|
+
"outputWidth": 848,
|
|
215
|
+
"outputHeight": 1264,
|
|
216
|
+
"output_format": "jpg",
|
|
217
|
+
"thinking_mode": "high",
|
|
218
|
+
"include_metadata": true
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Grounding Sample (Search-backed)
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"prompt": "A modern travel poster featuring today's weather and skyline highlights in Kuala Lumpur",
|
|
227
|
+
"model": "Flash3.1",
|
|
228
|
+
"outputFileName": "kl_travel_poster",
|
|
229
|
+
"outputType": "base64",
|
|
230
|
+
"outputWidth": 1024,
|
|
231
|
+
"outputHeight": 1024,
|
|
232
|
+
"grounding_type": "text",
|
|
233
|
+
"thinking_mode": "high",
|
|
234
|
+
"include_metadata": true,
|
|
235
|
+
"include_thoughts": true
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
This sample enables Google Search grounding and returns grounding and reasoning metadata in JSON.
|
|
240
|
+
|
|
241
|
+
#### With Reference Images
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"prompt": "Use the reference image to create a game screen showing an opened treasure chest filled with coins and treasure, 8-bit dungeon crawler style, after-battle reward scene, dungeon corridor background, four-party status UI at the bottom",
|
|
246
|
+
"model": "Flash3.1",
|
|
247
|
+
"output_resolution": "0.5K",
|
|
248
|
+
"outputFileName": "reference-image-dungeon-loot",
|
|
249
|
+
"outputType": "file",
|
|
250
|
+
"outputPath": "/path/to/output",
|
|
251
|
+
"outputWidth": 600,
|
|
252
|
+
"outputHeight": 448,
|
|
253
|
+
"output_format": "webp",
|
|
254
|
+
"transparent": false,
|
|
255
|
+
"referenceImages": [
|
|
256
|
+
{
|
|
257
|
+
"description": "Treasure chest style reference",
|
|
258
|
+
"filePath": "/path/to/references/pixel-art-treasure-chest.png"
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Transparency & Output Formats
|
|
265
|
+
|
|
266
|
+
- **PNG**: Full alpha, color-key + despill
|
|
267
|
+
- **WebP**: Full alpha, better compression (Flash3.1+)
|
|
268
|
+
- **JPEG**: No transparency (falls back to solid background)
|
|
269
|
+
|
|
270
|
+
## Development
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Development mode with MCP CLI
|
|
274
|
+
npm run dev
|
|
275
|
+
|
|
276
|
+
# MCP Inspector (Web UI)
|
|
277
|
+
npm run inspect
|
|
278
|
+
|
|
279
|
+
# Build for production
|
|
280
|
+
npm run build
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## License
|
|
284
|
+
|
|
285
|
+
MIT
|
|
286
|
+
|
package/alphabanana.gif
ADDED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,10 @@ import * as path from 'path';
|
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
13
|
const __dirname = path.dirname(__filename);
|
|
14
|
+
const PACKAGE_VERSION = JSON.parse(fsSync.readFileSync(path.resolve(__dirname, '../package.json'), 'utf8'));
|
|
15
|
+
const SERVER_VERSION = /^\d+\.\d+\.\d+$/.test(PACKAGE_VERSION.version ?? '')
|
|
16
|
+
? PACKAGE_VERSION.version
|
|
17
|
+
: '0.0.0';
|
|
14
18
|
import { selectAspectRatio } from './utils/aspect-ratio.js';
|
|
15
19
|
import { generateWithGemini, } from './utils/gemini-client.js';
|
|
16
20
|
import { postProcess, postProcessWithDebug, saveDebugImage } from './utils/post-processor.js';
|
|
@@ -115,12 +119,12 @@ const GenerateImageParams = z.object({
|
|
|
115
119
|
// Create FastMCP server
|
|
116
120
|
const server = new FastMCP({
|
|
117
121
|
name: 'mcp-alphabanana',
|
|
118
|
-
version:
|
|
119
|
-
instructions: `
|
|
120
|
-
Image asset generation server using Google Gemini AI.
|
|
121
|
-
Supports transparent PNG output, multiple resolutions, and style references.
|
|
122
|
-
Use outputType to control whether results are returned as files, base64, or both.
|
|
123
|
-
Preserve user prompts as-is. Do not summarize or translate; only add transparency-related hints when needed.
|
|
122
|
+
version: SERVER_VERSION,
|
|
123
|
+
instructions: `
|
|
124
|
+
Image asset generation server using Google Gemini AI.
|
|
125
|
+
Supports transparent PNG output, multiple resolutions, and style references.
|
|
126
|
+
Use outputType to control whether results are returned as files, base64, or both.
|
|
127
|
+
Preserve user prompts as-is. Do not summarize or translate; only add transparency-related hints when needed.
|
|
124
128
|
`,
|
|
125
129
|
});
|
|
126
130
|
// Register the generate_image tool
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,kBAAkB,GAKnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9F,kDAAkD;AAClD,MAAM,qBAAqB,GAA8D;IACvF,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,WAAoB;IACtE,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,qBA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E9D,iCAAiC;YACjC,IAAI,WAAW,GAAG,sBAAsB,YAAY,EAAE,CAAC;YACvD,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;gBACtF,WAAW,GAAG,qDAAqD,CAAC;YACtE,CAAC;iBAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;gBACzD,WAAW,GAAG,gDAAgD,CAAC;YACjE,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACnB,OAAO,EAAE,KAAK;4BACd,OAAO,EAAE,WAAW;4BACpB,KAAK,EAAE,CAAC;4BACR,MAAM,EAAE,CAAC;4BACT,MAAM,EAAE,EAAE;yBACX,CAAC;qBACH,CAAC;aACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,eAAe;AACf,MAAM,CAAC,KAAK,CAAC;IACX,aAAa,EAAE,OAAO;CACvB,CAAC,CAAC"}
|
|
@@ -200,22 +200,22 @@ export async function generateWithGemini(options) {
|
|
|
200
200
|
// Use chroma key terminology for better color accuracy.
|
|
201
201
|
// Note: even if the model doesn't produce the exact colour, the post-processor
|
|
202
202
|
// auto-detects the actual background colour and applies despill to clean edges.
|
|
203
|
-
enhancedPrompt = `Subject: ${enhancedPrompt}
|
|
204
|
-
|
|
205
|
-
CRITICAL BACKGROUND REQUIREMENT:
|
|
206
|
-
The background MUST be a solid, uniform chroma key screen in ${bgColor} (${colorDesc}).
|
|
207
|
-
This is a technical requirement for image compositing.
|
|
208
|
-
- Fill the ENTIRE background with a single flat solid colour as close to ${bgColor} as possible
|
|
209
|
-
- The background must be completely uniform — NO gradients, NO patterns, NO variation
|
|
210
|
-
- Subject must have sharp, clean edges against the background
|
|
211
|
-
- NO feathering or colour blending between subject and background
|
|
212
|
-
- Think of this as a green screen / blue screen studio setup
|
|
213
|
-
|
|
214
|
-
SUBJECT COLOR RESTRICTION:
|
|
215
|
-
The subject itself must NOT contain any ${avoidedColors} tones.
|
|
216
|
-
These colors are too close to the chroma key background and will be damaged during compositing.
|
|
217
|
-
If the subject naturally has such colors, shift them to a clearly different hue.
|
|
218
|
-
|
|
203
|
+
enhancedPrompt = `Subject: ${enhancedPrompt}
|
|
204
|
+
|
|
205
|
+
CRITICAL BACKGROUND REQUIREMENT:
|
|
206
|
+
The background MUST be a solid, uniform chroma key screen in ${bgColor} (${colorDesc}).
|
|
207
|
+
This is a technical requirement for image compositing.
|
|
208
|
+
- Fill the ENTIRE background with a single flat solid colour as close to ${bgColor} as possible
|
|
209
|
+
- The background must be completely uniform — NO gradients, NO patterns, NO variation
|
|
210
|
+
- Subject must have sharp, clean edges against the background
|
|
211
|
+
- NO feathering or colour blending between subject and background
|
|
212
|
+
- Think of this as a green screen / blue screen studio setup
|
|
213
|
+
|
|
214
|
+
SUBJECT COLOR RESTRICTION:
|
|
215
|
+
The subject itself must NOT contain any ${avoidedColors} tones.
|
|
216
|
+
These colors are too close to the chroma key background and will be damaged during compositing.
|
|
217
|
+
If the subject naturally has such colors, shift them to a clearly different hue.
|
|
218
|
+
|
|
219
219
|
The background uniformity is critical for post-processing.`;
|
|
220
220
|
}
|
|
221
221
|
// Build content parts
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,52 +1,72 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tasopen/mcp-alphabanana",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "MCP server for image generation using Google Gemini AI",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"mcp-alphabanana": "
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/",
|
|
12
|
-
"README.md",
|
|
13
|
-
"README.ja.md",
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"test
|
|
25
|
-
"test:
|
|
26
|
-
"test:
|
|
27
|
-
"test:transparency
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tasopen/mcp-alphabanana",
|
|
3
|
+
"version": "1.3.6",
|
|
4
|
+
"description": "MCP server for image generation using Google Gemini AI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"mcp-alphabanana": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"README.md",
|
|
13
|
+
"README.ja.md",
|
|
14
|
+
"examples/",
|
|
15
|
+
"alphabanana.gif",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"prepublishOnly": "npm run build && npm run test:sanity",
|
|
21
|
+
"dev": "npx fastmcp dev src/index.ts",
|
|
22
|
+
"inspect": "npx fastmcp inspect src/index.ts",
|
|
23
|
+
"start": "node dist/index.js",
|
|
24
|
+
"test": "vitest run test/sanity.test.ts",
|
|
25
|
+
"test:sanity": "vitest run test/sanity.test.ts",
|
|
26
|
+
"test:full": "vitest run",
|
|
27
|
+
"test:transparency": "vitest run test/transparency.test.ts",
|
|
28
|
+
"test:transparency:flash": "cross-env TEST_MODEL=flash vitest run test/transparency.test.ts",
|
|
29
|
+
"test:transparency:pro": "cross-env TEST_MODEL=pro vitest run test/transparency.test.ts"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"mcp",
|
|
33
|
+
"mcp-server",
|
|
34
|
+
"model-context-protocol",
|
|
35
|
+
"gemini",
|
|
36
|
+
"google-gemini",
|
|
37
|
+
"image-generation",
|
|
38
|
+
"ai-image-generation",
|
|
39
|
+
"transparent-png",
|
|
40
|
+
"reference-images",
|
|
41
|
+
"fastmcp"
|
|
42
|
+
],
|
|
43
|
+
"author": "tasopen",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/tasopen/mcp-alphabanana.git"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/tasopen/mcp-alphabanana#readme",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/tasopen/mcp-alphabanana/issues"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@google/genai": "^1.0.0",
|
|
59
|
+
"fastmcp": "^3.31.0",
|
|
60
|
+
"sharp": "^0.34.0",
|
|
61
|
+
"zod": "^3.23.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@modelcontextprotocol/sdk": "^1.3.1",
|
|
65
|
+
"@types/node": "^22.0.0",
|
|
66
|
+
"cross-env": "^10.1.0",
|
|
67
|
+
"ts-node": "^10.9.2",
|
|
68
|
+
"tsx": "^4.21.0",
|
|
69
|
+
"typescript": "^5.5.0",
|
|
70
|
+
"vitest": "^2.1.9"
|
|
71
|
+
}
|
|
72
|
+
}
|