A powerful Model Context Protocol (MCP) server that brings Midjourney's AI image generation directly to Claude Desktop and other MCP-compatible applications.
Quick Start β’ Installation β’ Features β’ Documentation
Transform your Claude Desktop into a powerful AI art studio! This MCP server seamlessly integrates Midjourney's image generation capabilities, allowing you to create stunning artwork directly through natural conversation with Claude.
- π Zero-config setup - Works out of the box with
npx
- π― Midjourney-focused - Optimized specifically for Midjourney API
- πΌοΈ Direct image display - See your creations instantly in Claude
- π§ Full parameter support - Access all Midjourney features
- β‘ Real-time tracking - Monitor generation progress
- π¨ Advanced tools - Upscale, variations, blending, and more
npx midjourney-mcp@latest
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"midjourney": {
"command": "npx",
"args": ["midjourney-mcp@latest"],
"env": {
"MJ_API_KEY": "sk-your-api-key-here"
}
}
}
}
Restart Claude Desktop and try:
"Create a cyberpunk cityscape at night with neon lights, 16:9 aspect ratio"
π That's it! You're now ready to generate amazing AI artwork through Claude.
# Run directly without installation (always gets latest version)
npx midjourney-mcp@latest
# Install globally
npm install -g midjourney-mcp
# Run anywhere
midjourney-mcp
git clone https://github.com/z23cc/MJ-MCP.git
cd MJ-MCP
npm install
npm run build
npm run dev
Variable | Description | Default | Required |
---|---|---|---|
MJ_API_KEY |
Your Midjourney API key | - | β |
MJ_BASE_URL |
API base URL | https://aiclound.vip |
β |
MJ_TIMEOUT |
Request timeout (ms) | 30000 |
β |
MJ_MAX_RETRIES |
Max retry attempts | 3 |
β |
- π Visit https://aiclound.vip
- π Register an account or log in
- π³ Purchase credits or choose a plan
- π Generate your API key from the dashboard
- π Copy the key (format:
sk-xxxxxxxxxx
)
β οΈ Important: Make sure your chosen provider supports the Midjourney API format that this MCP server expects. If you use a different provider, you may need to update theMJ_BASE_URL
environment variable.
Once you have your API key, you can use it in two ways:
Method 1: Environment Variable
export MJ_API_KEY="sk-your-actual-api-key-here"
Method 2: Claude Desktop Config (Recommended)
Add it directly to your claude_desktop_config.json
as shown in the Quick Start section.
If you're using a different API provider (not AICloud), you may need to customize the base URL:
{
"mcpServers": {
"midjourney": {
"command": "npx",
"args": ["midjourney-mcp@latest"],
"env": {
"MJ_API_KEY": "your-api-key-here",
"MJ_BASE_URL": "https://your-provider-api-url.com"
}
}
}
}
Common API Base URLs:
- AICloud:
https://aiclound.vip
(default) - Custom: Check your provider's documentation
- π¨ Text-to-Image: Create stunning artwork from text descriptions
- π Aspect Ratios: Support for all standard ratios (1:1, 16:9, 9:16, etc.)
- π Style Control: Raw, stylize, and model-specific styling
- π² Chaos & Variation: Control randomness and artistic interpretation
- π Upscaling: Enhance image resolution (U1-U4 buttons)
- π Variations: Generate alternative versions (V1-V4 buttons)
- π Blending: Combine multiple images seamlessly
- π Image Description: Reverse-engineer prompts from images
- β‘ Custom Actions: Zoom, pan, and other advanced operations
- π Real-time Progress: Track generation status with duration
- πΌοΈ Direct Display: Images appear instantly in Claude
- π Stuck Task Detection: Automatic warnings for long-running tasks
- π‘ Smart Suggestions: Helpful tips and next steps
π¨ midjourney_imagine - Generate images from text prompts
Description: Create stunning AI artwork using natural language descriptions.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
prompt |
string | β | Text description of the image |
aspect_ratio |
string | β | 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 5:4, 4:5 |
quality |
string | β | low, medium, high |
style |
string | β | raw, stylize |
model |
string | β | midjourney, niji, niji-5, niji-6 |
chaos |
number | β | 0-100 (variation amount) |
stylize |
number | β | 0-1000 (artistic level) |
weird |
number | β | 0-3000 (unusual results) |
seed |
number | β | For reproducible results |
no |
string | β | Negative prompt (things to avoid) |
reference_images |
array | β | Base64 encoded reference images |
Example:
"Create a majestic dragon flying over a medieval castle, 16:9 aspect ratio, high quality"
π midjourney_get_task - Check task status and results
Description: Monitor the progress of any Midjourney generation task.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
task_id |
string | β | The ID of the task to check |
Example:
"Check the status of task 1748526068622289"
π midjourney_upscale - Enhance image resolution
Description: Upscale a specific image from a completed 4-image generation.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
task_id |
string | β | ID of the completed generation task |
index |
number | β | Which image to upscale (1-4) |
Example:
"Upscale image 1 from my last generation"
π² midjourney_variation - Create image variations
Description: Generate alternative versions of a specific image.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
task_id |
string | β | ID of the completed generation task |
index |
number | β | Which image to vary (1-4) |
Example:
"Create variations of image 2"
π midjourney_reroll - Regenerate with same prompt
Description: Generate new results using the same prompt but different randomization.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
task_id |
string | β | ID of the task to reroll |
Example:
"Reroll my last generation"
π midjourney_blend - Combine multiple images
Description: Blend 2-5 images together to create a new combined artwork.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
images |
array | β | 2-5 base64 encoded images |
aspect_ratio |
string | β | Aspect ratio for result |
Example:
"Blend these two images together with a 16:9 aspect ratio"
π midjourney_describe - Generate prompts from images
Description: Analyze an image and generate text descriptions that could recreate it.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
image |
string | β | Base64 encoded image |
Example:
"Describe this image and suggest prompts"
β‘ midjourney_action - Execute advanced actions
Description: Perform zoom, pan, and other advanced operations on completed tasks.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
task_id |
string | β | ID of the task with available actions |
action |
string | β | Action to perform (button label or ID) |
Example:
"Zoom out on my last generation"
"Create a beautiful sunset over mountains with 16:9 aspect ratio"
"Generate a portrait of a cat in high quality using niji model"
"Make an abstract art piece with high chaos and stylization"
π‘ Pro Tip: Always use
npx midjourney-mcp@latest
to ensure you're running the newest version with the latest features and bug fixes!
"Check the status of task 1748519117239161"
"Upscale image 1 from my last generation"
"Create variations of image 2"
"Reroll my last generation for different results"
"Blend these two landscape photos together"
"Describe this image and suggest similar prompts"
"Zoom out on the generated image"
- Generate:
"Create a cyberpunk cityscape, neon lights, 16:9"
- Check Status:
"How is my generation going?"
- Upscale:
"Upscale image 3, it looks amazing!"
- Variations:
"Create variations of image 1"
- π Server Startup: MCP protocol compliance verified
- π οΈ All 8 Tools: Registered and responding correctly
- π¨ Image Generation: Successfully tested with task
1748526068622289
- π Status Tracking: Real-time progress monitoring working
- π§ Parameter Validation: Comprehensive error handling
- π API Authentication: Secure communication established
- π₯οΈ Claude Desktop: Integration tested and verified
β
Prompt: "η»δΈͺε°η«οΌδΈεͺε―η±ηε°η«οΌη¨ε‘ιι£ζ Όη»εΆοΌεΈ¦ζζεηθ²ε½©εζ’¦εΉ»θ¬ηθζ―"
β
Parameters: 1:1 aspect ratio, medium quality
β
Result: Task completed successfully in 3m 20s
β
Actions: U1-U4 upscale and V1-V4 variation options available
midjourney-mcp/
βββ src/
β βββ index.ts # π Main server entry point
β βββ tools/
β β βββ midjourney.ts # π¨ Midjourney tool implementations
β βββ types/
β β βββ midjourney.ts # π TypeScript definitions
β βββ utils/
β βββ config.ts # βοΈ Configuration management
βββ build/ # π¦ Compiled JavaScript output
βββ package.json # π Project configuration
βββ tsconfig.json # π§ TypeScript configuration
npm run build # π¨ Compile TypeScript to JavaScript
npm run watch # π Watch for changes and recompile
npm run dev # π Build and run the server locally
npm run inspector # π Debug with MCP inspector tool
- π΄ Fork the repository
- πΏ Create a feature branch (
git checkout -b feature/amazing-feature
) - πΎ Commit your changes (
git commit -m 'Add amazing feature'
) - π€ Push to the branch (
git push origin feature/amazing-feature
) - π Open a Pull Request
- π Documentation: Check this README for comprehensive guides
- π Issues: Report bugs on GitHub Issues
- π‘ Feature Requests: Suggest improvements via GitHub Issues
- π§ Contact: Reach out to the maintainer for direct support
- π¦ npm Package: https://www.npmjs.com/package/midjourney-mcp
- π MCP Protocol: https://modelcontextprotocol.io/
- π¨ Midjourney: https://midjourney.com/
- π€ Claude Desktop: https://claude.ai/
- π Get API Key: https://aiclound.vip (Recommended provider)
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use allowed
- β Modification allowed
- β Distribution allowed
- β Private use allowed
- β Liability not provided
- β Warranty not provided
Made with β€οΈ for the AI art community
β Star this repo if you find it useful! β
Report Bug β’ Request Feature β’ Contribute