@chrischall/gemini-mcp 0.1.0
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/.claude-plugin/marketplace.json +37 -0
- package/.claude-plugin/plugin.json +24 -0
- package/.mcp.json +13 -0
- package/README.md +40 -0
- package/SKILL.md +135 -0
- package/dist/bundle.js +31361 -0
- package/dist/client.js +86 -0
- package/dist/images.js +51 -0
- package/dist/index.js +15 -0
- package/dist/models.js +20 -0
- package/dist/tools/generate.js +48 -0
- package/dist/tools/models.js +11 -0
- package/dist/tools/set.js +44 -0
- package/dist/tools/shared.js +35 -0
- package/dist/version.js +2 -0
- package/package.json +35 -0
- package/server.json +43 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
|
|
3
|
+
"name": "gemini-mcp",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "Chris Hall",
|
|
6
|
+
"email": "chris.c.hall@gmail.com"
|
|
7
|
+
},
|
|
8
|
+
"metadata": {
|
|
9
|
+
"description": "MCP server for Google Gemini image generation and editing — generate and edit images via the Gemini API",
|
|
10
|
+
"version": "0.1.0"
|
|
11
|
+
},
|
|
12
|
+
"plugins": [
|
|
13
|
+
{
|
|
14
|
+
"name": "gemini-mcp",
|
|
15
|
+
"displayName": "Gemini Images",
|
|
16
|
+
"source": "./",
|
|
17
|
+
"description": "Generate and edit images with Google Gemini image models (Nano Banana / Nano Banana Pro) via natural language prompts",
|
|
18
|
+
"version": "0.1.0",
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "Chris Hall"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/chrischall/gemini-mcp",
|
|
23
|
+
"repository": "https://github.com/chrischall/gemini-mcp",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"gemini",
|
|
27
|
+
"nano-banana",
|
|
28
|
+
"image-generation",
|
|
29
|
+
"image-editing",
|
|
30
|
+
"text-to-image",
|
|
31
|
+
"google-gemini",
|
|
32
|
+
"mcp"
|
|
33
|
+
],
|
|
34
|
+
"category": "media"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gemini-mcp",
|
|
3
|
+
"displayName": "Gemini Images",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "MCP server for Google Gemini image generation and editing — generate and edit images via the Gemini API",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Chris Hall",
|
|
8
|
+
"email": "chris.c.hall@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/chrischall/gemini-mcp",
|
|
11
|
+
"repository": "https://github.com/chrischall/gemini-mcp",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"gemini",
|
|
15
|
+
"nano-banana",
|
|
16
|
+
"image-generation",
|
|
17
|
+
"image-editing",
|
|
18
|
+
"text-to-image",
|
|
19
|
+
"google-gemini",
|
|
20
|
+
"mcp"
|
|
21
|
+
],
|
|
22
|
+
"skills": "./SKILL.md",
|
|
23
|
+
"mcp": "./.mcp.json"
|
|
24
|
+
}
|
package/.mcp.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"gemini": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": ["${CLAUDE_PLUGIN_ROOT}/dist/index.js"],
|
|
6
|
+
"env": {
|
|
7
|
+
"GEMINI_API_KEY": "${GEMINI_API_KEY}",
|
|
8
|
+
"GEMINI_IMAGE_MODEL": "${GEMINI_IMAGE_MODEL}",
|
|
9
|
+
"GEMINI_OUTPUT_DIR": "${GEMINI_OUTPUT_DIR}"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# gemini-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for Google Gemini image generation and editing. Exposes four tools to Claude over stdio: list available models, generate images from text prompts, edit or compose images with text instructions, and generate a consistent set of images from a master prompt. Images are written to disk by default (path returned) or returned inline as base64. Built on the Gemini v1beta API (`generativelanguage.googleapis.com`) using the Nano Banana / Nano Banana Pro model family.
|
|
4
|
+
|
|
5
|
+
Developed and maintained by AI (Claude Code).
|
|
6
|
+
|
|
7
|
+
## Environment Variables
|
|
8
|
+
|
|
9
|
+
| Variable | Required | Description |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `GEMINI_API_KEY` | Yes | Your Google Gemini API key ([aistudio.google.com/apikey](https://aistudio.google.com/apikey)) |
|
|
12
|
+
| `GEMINI_IMAGE_MODEL` | No | Override the default image model (default: `gemini-3-pro-image`) |
|
|
13
|
+
| `GEMINI_OUTPUT_DIR` | No | Default directory for generated images (default: current working directory) |
|
|
14
|
+
|
|
15
|
+
## Tools
|
|
16
|
+
|
|
17
|
+
| Tool | Description |
|
|
18
|
+
|------|-------------|
|
|
19
|
+
| `gemini_list_models` | List available Gemini image models and the current default |
|
|
20
|
+
| `gemini_generate_image` | Generate image(s) from a text prompt |
|
|
21
|
+
| `gemini_edit_image` | Edit or compose one or more input images with a text instruction |
|
|
22
|
+
| `gemini_generate_set` | Generate a master image plus N consistent images referencing it |
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"gemini": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "@chrischall/gemini-mcp"],
|
|
32
|
+
"env": {
|
|
33
|
+
"GEMINI_API_KEY": "your-api-key-here"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
See [SKILL.md](./SKILL.md) for full usage documentation.
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gemini-mcp
|
|
3
|
+
description: Generate and edit images with Google Gemini image models via MCP. Use when the user asks to generate, create, or edit images using Gemini or Nano Banana models, wants to produce a consistent set of images from a prompt, or needs to compose/blend multiple images. Triggers on phrases like "generate an image of", "edit this image with Gemini", "create a set of consistent images", "use Nano Banana to make", or any request to produce images via the Gemini image API. Requires the @chrischall/gemini-mcp package installed and the gemini server registered (see Setup below).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gemini-mcp
|
|
7
|
+
|
|
8
|
+
MCP server for Google Gemini image generation and editing — natural-language image creation via the Gemini API (Nano Banana / Nano Banana Pro models).
|
|
9
|
+
|
|
10
|
+
- **npm:** [npmjs.com/package/@chrischall/gemini-mcp](https://www.npmjs.com/package/@chrischall/gemini-mcp)
|
|
11
|
+
- **Source:** [github.com/chrischall/gemini-mcp](https://github.com/chrischall/gemini-mcp)
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
### Option A — npx (recommended)
|
|
16
|
+
|
|
17
|
+
Add to `.mcp.json` in your project or `~/.claude/mcp.json`:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"gemini": {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "@chrischall/gemini-mcp"],
|
|
25
|
+
"env": {
|
|
26
|
+
"GEMINI_API_KEY": "your-api-key-here"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Option B — from source
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/chrischall/gemini-mcp
|
|
37
|
+
cd gemini-mcp
|
|
38
|
+
npm install && npm run build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then add to `.mcp.json`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"gemini": {
|
|
47
|
+
"command": "node",
|
|
48
|
+
"args": ["/path/to/gemini-mcp/dist/index.js"],
|
|
49
|
+
"env": {
|
|
50
|
+
"GEMINI_API_KEY": "your-api-key-here"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or use a `.env` file in the project directory with `GEMINI_API_KEY=<value>`.
|
|
58
|
+
|
|
59
|
+
### Getting your API key
|
|
60
|
+
|
|
61
|
+
1. Go to [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
|
62
|
+
2. Create an API key (requires a Google account)
|
|
63
|
+
3. Copy the key and set it as `GEMINI_API_KEY`
|
|
64
|
+
|
|
65
|
+
Note: Image generation requires a billing-enabled Google Cloud project.
|
|
66
|
+
|
|
67
|
+
## Environment Variables
|
|
68
|
+
|
|
69
|
+
| Variable | Required | Description |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `GEMINI_API_KEY` | Yes | Your Google Gemini API key |
|
|
72
|
+
| `GEMINI_IMAGE_MODEL` | No | Override the default image model (default: `gemini-3-pro-image`) |
|
|
73
|
+
| `GEMINI_OUTPUT_DIR` | No | Default directory for saved images (default: current working directory) |
|
|
74
|
+
|
|
75
|
+
## Tools
|
|
76
|
+
|
|
77
|
+
### Models
|
|
78
|
+
| Tool | Description |
|
|
79
|
+
|------|-------------|
|
|
80
|
+
| `gemini_list_models` | List available Gemini image models and the current default |
|
|
81
|
+
|
|
82
|
+
### Image Generation
|
|
83
|
+
| Tool | Description |
|
|
84
|
+
|------|-------------|
|
|
85
|
+
| `gemini_generate_image(prompt, count?, model?, aspect_ratio?, image_size?, output_dir?, inline?)` | Generate image(s) from a text prompt |
|
|
86
|
+
| `gemini_edit_image(prompt, images[], model?, aspect_ratio?, image_size?, output_dir?, inline?)` | Edit or compose one or more input images with a text instruction |
|
|
87
|
+
| `gemini_generate_set(master_prompt, scenes? \| count?, reference_mode?, model?, ...)` | Generate a master image plus N consistent images referencing it |
|
|
88
|
+
|
|
89
|
+
## Workflows
|
|
90
|
+
|
|
91
|
+
**Generate a single image:**
|
|
92
|
+
```
|
|
93
|
+
gemini_generate_image(prompt: "a red maple leaf on white background, studio photo")
|
|
94
|
+
→ returns path to saved PNG
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Generate multiple variations:**
|
|
98
|
+
```
|
|
99
|
+
gemini_generate_image(prompt: "a cartoon fox", count: 4, output_dir: "/tmp/foxes")
|
|
100
|
+
→ returns paths to 4 PNG files
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Edit an existing image:**
|
|
104
|
+
```
|
|
105
|
+
gemini_edit_image(prompt: "make the background blue", images: ["/path/to/image.png"])
|
|
106
|
+
→ returns path to edited PNG
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Generate a consistent set (master + scenes):**
|
|
110
|
+
```
|
|
111
|
+
gemini_generate_set(
|
|
112
|
+
master_prompt: "a cartoon fox named Rusty, orange fur, blue scarf",
|
|
113
|
+
scenes: ["Rusty waving hello", "Rusty eating an apple", "Rusty sleeping"]
|
|
114
|
+
)
|
|
115
|
+
→ returns paths to master + 3 scene images, all consistent
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Generate variations of a concept:**
|
|
119
|
+
```
|
|
120
|
+
gemini_generate_set(
|
|
121
|
+
master_prompt: "minimalist logo for a coffee shop",
|
|
122
|
+
count: 5
|
|
123
|
+
)
|
|
124
|
+
→ returns master + 5 variations
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Notes
|
|
128
|
+
|
|
129
|
+
- `output_dir` per-call overrides `$GEMINI_OUTPUT_DIR` which overrides the current working directory
|
|
130
|
+
- `inline: true` returns image bytes directly in the response instead of writing to disk
|
|
131
|
+
- `count` and `scenes` are mutually exclusive in `gemini_generate_set`
|
|
132
|
+
- `reference_mode: "chain"` makes each scene reference the previous image (vs. all referencing master)
|
|
133
|
+
- Aspect ratios: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `2:3`, `3:2`, and others
|
|
134
|
+
- Image sizes: `1K`, `2K`, `4K`
|
|
135
|
+
- Server logs to stderr only — stdout is reserved for JSON-RPC
|