tongyi-wanx
MCP server from Suixinlei/tongyi-wanx-mcp-server
claude mcp add --transport stdio suixinlei-tongyi-wanx-mcp-server npx -y tongyi-wanx-mcp-server@latest \ --env DASHSCOPE_API_KEY="<你的通义万相 API 密钥>"
How to use
This MCP server integrates 阿里云通义万相's 文生图 (Text-to-Image) and 文生视频 (Text-to-Video) capabilities and exposes them via the MCP protocol so that compatible LLMs can directly request image and video generation. It supports asynchronous task handling: you start a generation task and poll for the result until your image or video URL is available. The server exposes tools for initiating image generation, retrieving results, starting video generation, and retrieving video results. To use it, configure the MCP client to call the wanx-t2i-image-generation tool with a prompt and optional negative_prompt to generate an image, and use the wanx-t2i-image-generation-result tool with the returned task_id to fetch the resulting image URL. Similarly, use wanx-t2v-video-generation with a prompt to start a video generation task and wanx-t2v-video-generation-result with the task_id to obtain the final video URL. The server also supports long-running tasks and status polling, making it suitable for high-complexity prompts and longer video renders.
How to install
Prerequisites:
- Node.js >= 16.x
- npm >= 8.x or pnpm
installation steps:
- Install dependencies
# 使用 npm
npm install
# 或使用 pnpm
pnpm install
- 构建与运行
# 构建项目
npm run build
# 或
pnpm run build
# 运行服务器
npm start
# 或
pnpm start
- 可选:Debug 模式
# 使用调试工具运行
npm run debug
# 或
pnpm run debug
- 配置 MCP 调用信息
- 将以下 mcpServers 配置添加到你的 MCP 管理环境中,确保替换并提供有效的 API Key(DASHSCOPE_API_KEY)以及你已授权的通义万相访问权限。
Additional notes
提示和注意事项:
- 请确保环境中已正确设置通义万相 API 的访问权限和密钥。
- 图像生成是异步过程,结果可能需要几秒到几十秒。
- 视频生成通常更耗时,可能需要数分钟到十几分钟,且状态查询可能会多次失败,系统会自动重试。
- 调整轮询间隔(pollingInterval)和最大重试次数(maxRetries)以适应您的使用场景。
- 高分辨率图像和长视频请注意 API 费用与速率限制。
- 如果遇到网络或认证问题,检查 API Key、权限、以及是否正确传递至环境变量中。
- 参考资料:通义万相 API 文档、Model Context Protocol (MCP) 规范。
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud