Assets Generation MCP Server
Generates images using Google Gemini models, including Gemini Flash and Imagen, for AI image generation.
Generates images using OpenAI-compatible models, including GPT-image and DALL-E series, for AI image generation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Assets Generation MCP Servergenerate an image of a serene lake at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Assets Generation MCP Server
An MCP server for AI image generation with dual-provider support for OpenAI-compatible models and Google Gemini. It returns standard MCP ImageContent blocks.
Features
Automatically selects the provider from the model name
When both OpenAI and Gemini are configured, provider selection is still based on the requested model; if no model is provided,
DEFAULT_MODELis usedReturns images as MCP-standard
ImageContent({ type: "image", data, mimeType })Supports three transports: stdio (default), SSE, and HTTP
Supports custom API proxy endpoints (
OPENAI_BASE_URL/GEMINI_BASE_URL)Automatically loads
.env, and also supports CLI arguments for MCP clients that cannot passenvProviders without valid API keys are disabled automatically without affecting the other provider
Quick Start
npm install
npm run build
cp .env.example .envEnvironment Variables
Variable | Required | Default | Description |
| One provider required | - | Google Gemini API key |
| One provider required | - | OpenAI-compatible API key |
| No |
| Default model when the tool call does not provide |
| No | - | Gemini API proxy endpoint |
| No | - | OpenAI-compatible API proxy endpoint |
| No |
| OpenAI-compatible image model used in integration tests |
| No |
| Transport mode: |
| No |
| Enable startup/runtime logs in stdio mode (set |
| No |
| Host for SSE/HTTP mode |
| No |
| Port for SSE/HTTP mode |
Configure at least one of
GEMINI_API_KEYorOPENAI_API_KEY.Placeholder values in
.envsuch asyour-gemini-api-keyare ignored automatically.Configuration precedence is: CLI arguments > process environment variables >
.envin the current working directory > built-in defaults.
Tool: generate_image
Parameter | Required | Default | Description |
| Yes | - | Detailed image description |
| No |
| Model name — see supported models below |
| No |
| Image dimensions for OpenAI-compatible models |
| No |
|
|
| No |
| Number of images (gpt-image-*: 1–10; dall-e-3: 1; Gemini: 1) |
| No |
| Gemini-only: |
| No |
|
|
| No |
| Max wait time in seconds. Increase for slow proxies or high-quality models |
Supported model families:
OpenAI / OpenAI-compatible:
gpt-image-2,gpt-image-1,dall-e-3,dall-e-2,doubao-*,volcengine/doubao-*Gemini:
gemini-2.5-flash-image,gemini-2.0-flash-exp,imagen-3.0-generate-001
Response Format
The response_format parameter controls how image URLs and file paths are returned alongside the base64 ImageContent blocks:
Value | Behavior |
| Always returns a local file path in the response text ( |
| Returns |
| Always returns a file path or URL in the response text: • If the API returns a • If the API returns only base64 → the image is saved to |
Security: files saved to the temp directory use
crypto.randomBytes(16)for filenames withwx(exclusive-create) and0o600(owner-only) flags — no path-traversal risk, no file-overwrite collisions.
Usage
Claude Desktop / Kiro (stdio mode)
{
"mcpServers": {
"assets-gen": {
"command": "node",
"args": ["/path/to/assets-gen-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-key",
"GEMINI_BASE_URL": "https://your-proxy.com"
}
}
}
}If your MCP client cannot pass env, use CLI arguments instead:
{
"mcpServers": {
"assets-gen": {
"command": "npx",
"args": [
"-y",
"@ayaka209/assets-gen-mcp",
"--openai-api-key",
"your-key",
"--openai-base-url",
"https://your-proxy.com/gptapi",
"--default-model",
"gpt-image-2"
]
}
}
}macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\\Claude\\claude_desktop_config.json
MCP SDK Client
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "node",
args: ["dist/index.js"],
env: { GEMINI_API_KEY: "your-key" },
});
const client = new Client({ name: "my-app", version: "1.0.0" }, { capabilities: {} });
await client.connect(transport);
const result = await client.callTool({
name: "generate_image",
arguments: { prompt: "A cat in space" },
});
// result.content -> [{ type: "image", data: "<base64>", mimeType: "image/png" }]Provider Selection Rules
If
modelis provided, the provider is chosen from the model prefixIf
modelis omitted,DEFAULT_MODELis usedgpt-image-*/dall-e-*/doubao-*/volcengine/doubao-*go to the OpenAI-compatible pathgemini-*/imagen-*go to the Gemini path
SSE / HTTP Mode
MCP_TRANSPORT=sse MCP_PORT=3000 node dist/index.jsEndpoints:
GET /sse- SSE connectionPOST /message?sessionId=xxx- Send messagesGET /- Health check
OpenAI-Compatible Proxy Testing
Run the full integration tests:
OPENAI_API_KEY=your-key
OPENAI_BASE_URL=https://your-openai-compatible-endpoint
OPENAI_IMAGE_MODEL=gpt-image-2
npm run test:integrationFor a single end-to-end smoke test:
OPENAI_API_KEY=your-key
OPENAI_BASE_URL=https://your-openai-compatible-endpoint
OPENAI_IMAGE_MODEL=gpt-image-2
npm run test:openai-proxyThis script verifies:
A direct
images.generatecall againstOPENAI_BASE_URLA stdio MCP round-trip through this repository's
generate_imagetool
To inspect which OpenAI-compatible models your endpoint exposes:
OPENAI_API_KEY=your-key
OPENAI_BASE_URL=https://your-openai-compatible-endpoint
npm run models:openaiIf your MCP client cannot pass env, you can launch it directly with CLI arguments:
npx -y @ayaka209/assets-gen-mcp --openai-api-key sk-... --openai-base-url https://your-openai-compatible-endpoint --default-model gpt-image-2Show all supported CLI options:
npx -y @ayaka209/assets-gen-mcp --helpDevelopment
npm run build # Build
npm run watch # Watch TypeScript
npm test # Unit tests
npm run test:integration # Integration tests (requires API keys)
npm run test:openai-proxy # One-command OpenAI-compatible smoke test
npm run models:openai # List OpenAI-compatible models visible to the endpoint
npm run models # List available Gemini modelsTech Stack
@modelcontextprotocol/sdk- MCP server/client SDK@google/genai- Google Gemini SDKopenai- OpenAI SDK
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/ayaka209/assets-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server