NIMGEN
Generates and edits images using NVIDIA NIM FLUX models (FLUX.1 Dev, Schnell, and Kontext) via your NVIDIA API key, providing text-to-image and image-to-image capabilities.
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., "@NIMGENgenerate a scenic mountain landscape 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.
Why NIMGEN?
NIMGEN is the first MCP server specifically built for NVIDIA NIM FLUX models.
Most image generation MCP servers require separate API keys from providers like Replicate, Stability AI, or OpenAI. NIMGEN uses your existing NVIDIA API key — the same one you already use for LLM inference via NIM.
Feature | NIMGEN | Other MCPs |
Uses existing NVIDIA key | ✅ | ❌ |
No extra subscription | ✅ | ❌ |
FLUX.1 models via NIM | ✅ | Some (via Replicate) |
Image editing (Kontext) | ✅ | Rare |
Free NIM credits (1000+) | ✅ | Varies |
Self-hosted option | ✅ | Limited |
Related MCP server: Flux Schnell Server
Quick Start
1. Get your NVIDIA API Key
If you don't have one already:
Go to build.nvidia.com
Sign in or create a free account
Navigate to API Keys section
Click Generate Key
Copy your key (starts with
nvapi-...)
Free tier includes 1,000+ credits for testing!
2. Set the environment variable
# Windows (PowerShell)
$env:NVIDIA_API_KEY = "nvapi-your-key-here"
# Linux / macOS
export NVIDIA_API_KEY="nvapi-your-key-here"
# Verify it's set (optional)
echo $env:NVIDIA_API_KEY # Windows
echo $NVIDIA_API_KEY # Linux/macOS3. Add to your MCP client
OpenCode / Oh-My-OpenCode
Add to your opencode.jsonc:
{
"mcp": {
"nimgen": {
"type": "local",
"command": ["npx", "-y", "nimgen"],
"environment": {
"NVIDIA_API_KEY": "{env:NVIDIA_API_KEY}"
},
"enabled": true,
"timeout": 60000
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"nimgen": {
"command": "npx",
"args": ["-y", "nimgen"],
"env": {
"NVIDIA_API_KEY": "nvapi-your-key-here"
}
}
}
}Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"servers": {
"nimgen": {
"command": "npx",
"args": ["-y", "nimgen"],
"env": {
"NVIDIA_API_KEY": "nvapi-your-key-here"
}
}
}
}Glossary
New to AI image generation or MCP? Here's what the terms mean:
Term | Definition |
MCP | Model Context Protocol — a standard for connecting AI assistants to external tools and data sources |
NIM | NVIDIA Inference Microservices — NVIDIA's API platform for running AI models in the cloud |
FLUX.1 | A family of state-of-the-art image generation models by Black Forest Labs |
FLUX.1 Dev | High-quality model for detailed, artistic images (slower, better quality) |
FLUX.1 Schnell | Fast model for quick prototyping (4 steps, optimized for speed) |
FLUX.1 Kontext | Image-to-image model for editing existing images with text prompts |
cfg_scale | Classifier-Free Guidance Scale — controls how closely the AI follows your prompt (1-20). Higher = more faithful, lower = more creative. Default: 5 |
steps | Number of inference iterations. More steps = better quality but slower. FLUX.1 Dev: 20-50, Schnell: 4 |
seed | A number that controls randomness. Same seed + same prompt = same image every time. Use 0 for random |
negative_prompt | Things to exclude from the image (e.g., "blurry, low quality, watermark") |
Tools
generate_image
Generate an image from a text description using NVIDIA NIM FLUX models.
Parameter | Type | Required | Default | Description |
| string | ✅ | — | Text description of the image (max 2000 chars) |
| string | — |
| Model: |
| number | — | auto | Inference steps (more = better quality) |
| number | — |
| Prompt adherence (1-20) |
| string | — | — | Things to exclude |
| number | — |
| Seed for reproducibility |
edit_image
Edit an existing image using text instructions (FLUX.1-Kontext).
Parameter | Type | Required | Default | Description |
| string | ✅ | — | Edit instructions |
| string | ✅ | — | Path to source image (PNG, JPEG, WebP, GIF) |
| number | — |
| Inference steps (1-30) |
| number | — |
| Prompt adherence (1-20) |
| number | — |
| Seed for reproducibility |
Note: image_path must be within the output directory or current working directory for security.
list_models
List all available FLUX models on NVIDIA NIM and their capabilities.
Models
Model | Key | Type | Speed | Quality | Best For |
FLUX.1 Dev |
| Text → Image | Medium | ⭐⭐⭐⭐⭐ | Final art, production assets |
FLUX.1 Schnell |
| Text → Image | Fast | ⭐⭐⭐ | Prototyping, quick drafts |
FLUX.1 Kontext |
| Image → Image | Medium | ⭐⭐⭐⭐ | Photo editing, mockups |
Configuration
All configuration is via environment variables:
Variable | Required | Default | Description |
| ✅ | — | Your NVIDIA API key ( |
| — |
| Directory to save generated images |
| — |
| Custom NIM endpoint |
Self-Hosted NIM
If you're running NIM locally with Docker, set the base URL:
export NIMGEN_BASE_URL="http://localhost:8000/v1"Limitations
Limit | Value | Notes |
Max prompt length | 2,000 characters | Longer prompts are rejected |
Max image size | 50 MB | For input images in edit_image |
Supported formats | PNG, JPEG, WebP, GIF | Both input and output |
Max steps (Dev) | 50 | Higher doesn't always mean better |
Max steps (Schnell) | 4 | Model is optimized for 4 steps |
Max steps (Kontext) | 30 | For image editing |
Rate Limits
NVIDIA NIM has rate limits based on your account tier:
Free tier: ~1,000 credits (varies)
Paid tier: Higher limits
When you hit rate limits, you'll see: "Rate limit exceeded. Please wait a moment and try again."
Examples
Social Media Post
Generate an image: Professional tech company social media banner
with gradient background from dark blue to purple, abstract
geometric shapes, and clean modern aesthetic.Product Mockup
Edit this image: Add a holographic logo floating above
the laptop screen with volumetric lighting and lens flare.Tattoo Preview
Edit this image: Add a realistic Japanese dragon tattoo
covering the forearm, black and gray style with fine
line work, photorealistic skin texture.Website Hero Image
Generate an image: Futuristic data center with rows of
glowing server racks, blue and green LED lighting,
cinematic perspective.FAQ
General
Q: What is NIMGEN? A: NIMGEN is an MCP (Model Context Protocol) server that lets you generate and edit images using NVIDIA's FLUX.1 models through your existing NVIDIA API key.
Q: Do I need a separate subscription? A: No! NIMGEN uses your existing NVIDIA NIM API key. If you already use NVIDIA for LLM inference, you're all set.
Q: Is it free? A: NVIDIA offers free credits (1,000+) when you sign up. After that, you pay per image generated through NVIDIA's pricing.
Q: Which model should I use?
A: Use flux-1-dev for high-quality final images, flux-1-schnell for quick prototypes, and flux-1-kontext for editing existing images.
Troubleshooting
Q: I get "NVIDIA_API_KEY environment variable is required" A: Make sure you've set the environment variable:
Windows:
$env:NVIDIA_API_KEY = "nvapi-your-key"Linux/macOS:
export NVIDIA_API_KEY="nvapi-your-key"
Q: I get "Invalid NVIDIA API key"
A: Your key might be incorrect or expired. Get a new key at build.nvidia.com. Make sure it starts with nvapi-.
Q: I get "Rate limit exceeded" A: You've hit NVIDIA's API limits. Wait a few seconds and try again. Consider upgrading your NVIDIA account for higher limits.
Q: I get "Access denied: path outside allowed directories"
A: For security, edit_image only accepts images from the output directory or current working directory. Move your image there first.
Q: I get "Invalid image format" A: NIMGEN supports PNG, JPEG, WebP, and GIF. Make sure your image is in one of these formats.
Q: I get "Image too large" A: Maximum image size is 50MB. Compress your image or use a smaller file.
Q: I get "Prompt too long" A: Maximum prompt length is 2,000 characters. Shorten your prompt.
Q: Generation is slow
A: FLUX.1 Dev takes 20-50 steps and can take 30-60 seconds. Use flux-1-schnell for faster generation (4 steps, ~5-10 seconds).
Q: I get "NVIDIA NIM service temporarily unavailable" A: NVIDIA's servers are experiencing issues. Wait a few minutes and try again.
Technical
Q: What Node.js version do I need? A: Node.js 18.0.0 or higher is required.
Q: Can I use NIMGEN with self-hosted NIM?
A: Yes! Set NIMGEN_BASE_URL to your local NIM endpoint:
export NIMGEN_BASE_URL="http://localhost:8000/v1"Q: Where are images saved?
A: By default, images are saved to ./nimgen-output/. Change with NIMGEN_OUTPUT_DIR.
Q: Can I generate multiple images at once? A: Currently, NIMGEN generates one image per call. Batch generation is on the roadmap.
Troubleshooting
Common Errors
Error | Cause | Solution |
| Environment variable not set | Set |
| Wrong or expired key | Get a new key at build.nvidia.com |
| Too many requests | Wait a moment and retry |
| Image outside allowed dirs | Move image to output dir or cwd |
| Unsupported file type | Use PNG, JPEG, WebP, or GIF |
| File exceeds 50MB | Compress or use smaller file |
| Exceeds 2000 chars | Shorten your prompt |
| NVIDIA servers down | Wait and retry |
Debug Mode
To see more details about what's happening:
# Run directly to see startup logs
NVIDIA_API_KEY=nvapi-... npx nimgenDevelopment
# Clone and install
git clone https://github.com/gabriel-ferraresi/NIMGEN.git
cd NIMGEN
npm install
# Build
npm run build
# Run locally
NVIDIA_API_KEY=nvapi-... node dist/index.jsLicense
Apache-2.0 — see LICENSE for details.
Available Tools
3 toolsedit_imageA
Edit an existing image using text instructions via FLUX.1-Kontext. Provide a source image path and describe the desired changes. Great for mockups, style transfer, and contextual editing.
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for reproducibility. Use 0 for random. | |
| steps | No | Number of inference steps (1-30). Default: 20. | |
| prompt | Yes | Text description of the desired edit. Be specific about changes. Example: 'Add a realistic dragon tattoo on the forearm' | |
| cfg_scale | No | Guidance scale (1-20). Default: 7. | |
| image_path | Yes | Absolute or relative path to the source image to edit. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It mentions the model and use cases but does not explain whether the original image is preserved, what the return format is, or any side effects. This is insufficient for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, with two sentences that front-load the purpose. Every word earns its place, and the structure is clear and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers purpose and basic usage but lacks details on return values, side effects, and explicit alternative guidance. Given no output schema and no annotations, the description should provide more context to be fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all parameters. The description reinforces the key parameters (image_path, prompt) but adds no additional semantic detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool edits an existing image using text instructions via FLUX.1-Kontext, with specific use cases. It distinguishes itself from sibling tools like generate_image by emphasizing 'existing image'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides clear usage context with examples like mockups, style transfer, and contextual editing, implying when to use the tool. However, it does not explicitly name alternatives or exclusion criteria relative to generate_image.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
Generate an image from a text prompt using NVIDIA NIM FLUX models. Returns the file path of the saved image. Use 'flux-1-dev' for high quality or 'flux-1-schnell' for speed.
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for reproducibility. Use 0 for random. Same seed + same prompt = same image. | |
| model | No | Model to use. 'flux-1-dev' = high quality (30 steps), 'flux-1-schnell' = fast (4 steps). | flux-1-dev |
| steps | No | Number of inference steps. More steps = higher quality but slower. Default: 30 for flux-1-dev, 4 for flux-1-schnell. | |
| prompt | Yes | Text description of the image to generate. Be detailed and specific. Example: 'A futuristic cityscape at sunset with flying cars and neon lights, photorealistic, high detail, cinematic lighting' | |
| cfg_scale | No | Classifier-free guidance scale (1-20). Higher = more faithful to prompt, lower = more creative. Default: 5. | |
| negative_prompt | No | Things to exclude from the image. Example: 'blurry, low quality, watermark, text' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the transparency burden. It discloses the core behavior (generation, saving, and returning a file path), but omits details about where the file is saved, whether it overwrites existing files, or network/API dependencies (e.g., NIM service). This is adequate but leaves gaps for a tool with side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long, front-loaded with the primary action and return value. It avoids redundancy and every sentence contributes useful information, making it highly concise and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the full schema and no output schema, the description covers the essential context: what the tool does, what it returns, and model selection tradeoffs. It does not explain where the saved image is stored or how to access it, but the schema covers parameter semantics sufficiently, so the description is largely complete for an agent to invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides detailed descriptions for all six parameters (100% coverage), including examples and defaults. The description's mention of model quality duplicates the schema's 'model' parameter description, adding no new semantic meaning beyond what the schema already offers.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Generate an image from a text prompt using NVIDIA NIM FLUX models', specifying a concrete action and resource. It also distinguishes the tool from siblings (list_models and edit_image) by focusing on creation rather than listing or modifying images.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear in-tool guidance on model selection ('Use 'flux-1-dev' for high quality or 'flux-1-schnell' for speed'), which helps agents choose the right model. However, it does not explicitly compare when to use generate_image versus the sibling tools (list_models, edit_image), so it lacks exclusions or alternative tool references.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsA
List all available FLUX models on NVIDIA NIM and their capabilities.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It communicates a safe, read-only 'List' operation with no side effects, but does not disclose potential return format, pagination, or what 'capabilities' means specifically. This is acceptable but leaves room for more behavioral detail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that immediately states the action and resource. Every word is useful, and there is no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters, no annotations, no output schema), the description gives enough context: it names the resource and the type of output (available models + capabilities). It could be more explicit about the return format, but the simple nature makes it largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool accepts zero parameters, and the schema coverage is 100% (empty schema). Per the baseline for no parameters, a score of 4 is appropriate. The description adds no parameter-specific information because there are no parameters to describe, and it correctly references the output content.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and identifies the exact resource ('available FLUX models on NVIDIA NIM') plus additional value ('their capabilities'). This clearly distinguishes it from sibling tools like generate_image and edit_image, which perform actions rather than listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool should be used when an agent needs to know which FLUX models are available and what they can do. While it doesn't explicitly exclude alternatives or mention sibling tools, the context is clear and unambiguous for a listing tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a distinct purpose: generate_image creates new images, edit_image modifies existing ones, and list_models provides model information. No functional overlap exists, so an agent can select the correct tool without ambiguity.
All tool names follow the same verb_noun pattern with clear, action-oriented verbs (generate, list, edit) and consistent snake_case formatting. The pattern is predictable and easy to extend.
Three tools is well within the typical 3-15 range and perfectly scoped for an image generation/editing server. Each tool serves a necessary role with no bloat or redundancy.
The toolset covers the core workflow: generating new images, editing existing ones, and discovering available models. There are no obvious dead ends or missing operations critical to the domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Flux AI image generation
Official FLUX MCP server. Generate, edit, vary, and browse images from Black Forest Labs.
MCP server for Qwen Image 3 AI image generation
MCP server for Luma Dream Machine AI video generation
Related MCP Servers
- FlicenseCqualityDmaintenanceAn MCP server that generates images based on text prompts using Black Forest Lab's FLUX model, allowing for customized image dimensions, prompt upsampling, safety settings, and batch generation.31
- FlicenseBqualityDmaintenanceAn MCP image generation server based on the Flux Schnell model that provides API access for generating images from text prompts with customizable dimensions and seeds.11
- FlicenseBqualityNot gradedmaintenanceAn MCP server that enables generating and editing high-quality images with natural language using Black Forest Labs' FLUX.1 Kontext Pro model.25
- AlicenseAqualityDmaintenanceMCP server for Krea.ai enabling AI image and video generation using models like Flux, Hailuo, Runway, Kling, and others via natural language prompts.9319Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/gabriel-ferraresi/NIMGEN'
If you have feedback or need assistance with the MCP directory API, please join our Discord server