ali-flux-mcp
A simple MCP server for generating images using Ali Cloud's DashScope API, with tools for task management and local image saving.
Documentation
Ali-Flux MCP Server
A Model Context Protocol server for Alibaba Cloud DashScope API
This is a TypeScript-based MCP server that provides functionality to interact with Alibaba Cloud DashScope API for generating images and saving them locally. It demonstrates core MCP concepts by providing:
- Tools for generating images using Alibaba Cloud DashScope API
- Tools for checking task status
- Tools for downloading generated images and saving them locally
Features
Tools
- `generate_image` - Generate images using Alibaba Cloud DashScope API
- Takes prompt as required parameter
- Optional parameters: size, seed, steps
- Submits image generation task to DashScope API
- `check_task_status` - Check image generation task status
- Takes task_id as required parameter
- Returns the current status of the image generation task
- `download_image` - Download generated images and save them locally
- Takes task_id as required parameter
- Optional parameter: save_path for custom save location (must be an absolute path)
- Optional parameter: base_dir for resolving relative paths (defaults to WORK_DIR environment variable)
- Downloads all generated images and saves them to the specified directory
Development
Prerequisites
- Node.js and npm
- Alibaba Cloud DashScope API key
Environment Variables
- `DASHSCOPE_API_KEY`: Your Alibaba Cloud DashScope API key
- `SAVE_DIR`: Directory to save generated images (default: ~/Desktop/flux-images)
- `MODEL_NAME`: DashScope model name (default: flux-merged)
- `WORK_DIR`: Work directory (default: process.cwd())
Setup
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchInstallation
Configuration
To use with Claude Desktop or other MCP-compatible clients, add the server config:
On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
{
"mcpServers": {
"ali-flux": {
"command": "/path/to/ali-flux/build/index.js",
"env": {
"DASHSCOPE_API_KEY": "your-api-key-here",
"SAVE_DIR": "/custom/save/path" // Optional
}
}
}
}Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspectorThe Inspector will provide a URL to access debugging tools in your browser.
Frequently asked questions
What is ali-flux-mcp?
ali-flux-mcp is A simple MCP server for generating images using Ali Cloud's DashScope API, with tools for task management and local image saving.
How do I install ali-flux-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is ali-flux-mcp open source?
Yes — it is hosted on GitHub at https://github.com/echozyr2001/ali-flux-mcp.
Related MCP tools
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients. JavaScript-based implementation.
Shrimp Task Manager is a task tool built for AI Agents, emphasizing chain-of-thought, reflection, and style consistency.
A model context protocol server to work with JetBrains IDEs: IntelliJ, PyCharm, WebStorm, etc. Also, works with Android Studio
A model context protocol server to work with JetBrains IDEs: IntelliJ, PyCharm, WebStorm, etc. Also, works with Android Studio
A server that integrates Linear's project management system with the Model Context Protocol (MCP) to allow LLMs to interact with Linear.
AWS MCP Servers — helping you get the most out of AWS, wherever you use MCP. Python-based implementation. Trusted by 6900+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP