Stars
0
Forks
0
Language
JavaScript
Watching
1
A simple MCP server for generating images using Ali Cloud's DashScope API, with tools for task management and local image saving.
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:
generate_image
- Generate images using Alibaba Cloud DashScope API
check_task_status
- Check image generation task status
download_image
- Download generated images and save them locally
DASHSCOPE_API_KEY
: Your Alibaba Cloud DashScope API keySAVE_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())Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
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
}
}
}
}
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 inspector
The Inspector will provide a URL to access debugging tools in your browser.
How is this guide?