MiniMax MCP JS
Official
MiniMax MCP JS
MiniMax MCP 的 JavaScript/TypeScript 实现,提供图像生成、视频生成、文本转语音等功能。
文档
Related MCP server: MiniMax MCP JS
特征
文本转语音 (TTS)
图像生成
视频生成
语音克隆
动态配置(支持环境变量和请求参数)
与 MCP 平台托管兼容(ModelScope 和其他 MCP 平台)
安装
# Install with pnpm (recommended)
pnpm add minimax-mcp-js快速入门
MiniMax MCP JS 实现了模型上下文协议(MCP)规范,可以作为服务器与兼容 MCP 的客户端(例如 Claude AI)进行交互。
MCP 客户端快速入门
从MiniMax 国际平台获取您的 API 密钥。
确保你已经安装了Node.js 和 npm
重要提示:API HOST&KEY 在不同地区有所不同,它们必须匹配,否则您将收到
Invalid API key错误。
地区 | 全球的 | 大陆 |
MINIMAX_API_密钥 | 从MiniMax获取 | |
MINIMAX_API_主机 | https://api.minimaxi.chat (注意多余的**“i”** ) |
与 MCP 客户端一起使用(推荐)
配置您的 MCP 客户端:
克劳德桌面
转到Claude > Settings > Developer > Edit Config > claude_desktop_config.json以包含:
{
"mcpServers": {
"minimax-mcp-js": {
"command": "npx",
"args": [
"-y",
"minimax-mcp-js"
],
"env": {
"MINIMAX_API_HOST": "<https://api.minimaxi.chat|https://api.minimax.chat>",
"MINIMAX_API_KEY": "<your-api-key-here>",
"MINIMAX_MCP_BASE_PATH": "<local-output-dir-path, such as /User/xxx/Desktop>",
"MINIMAX_RESOURCE_MODE": "<optional, [url|local], url is default, audio/image/video are downloaded locally or provided in URL format>"
}
}
}
}光标
转到Cursor → Preferences → Cursor Settings → MCP → Add new global MCP Server来添加上述配置。
⚠️注意:如果您在将 MiniMax MCP JS 与 Cursor 结合使用时遇到“未找到工具”错误,请将 Cursor 更新到最新版本。更多信息,请参阅此讨论帖。
就是这样。您的 MCP 客户端现在可以通过这些工具与 MiniMax 进行交互。
对于本地开发:在本地开发时,您可以使用npm link来测试您的更改:
# In your project directory
npm link然后,按照上面步骤配置 Claude Desktop 或 Cursor 使用 npx。这将自动使用你链接的版本。
⚠️注意:API Key 需要与主机地址匹配,全球版本和中国大陆版本使用不同的主机:
全球主机:
https://api.minimaxi.chat(注意多余的“i”)中国大陆主机:
https://api.minimaxi.chat
交通方式
MiniMax MCP JS 支持三种传输模式:
特征 | stdio(默认) | 休息 | 上交所 |
环境 | 仅限本地 | 本地或云部署 | 本地或云部署 |
沟通 | 通过 | 通过 | 通过 |
用例 | 本地 MCP 客户端集成 | API服务,跨语言调用 | 需要服务器推送的应用程序 |
输入限制 | 支持 | 云端部署时建议输入 | 云端部署时建议输入 |
配置
MiniMax-MCP-JS 提供了多种灵活的配置方式,以适应不同的使用场景。配置优先级从高到低如下:
1. 请求参数配置(最高优先级)
在平台托管环境中(如 ModelScope 或其他 MCP 平台),您可以通过请求参数中的meta.auth对象为每个请求提供独立的配置:
{
"params": {
"meta": {
"auth": {
"api_key": "your_api_key_here",
"api_host": "<https://api.minimaxi.chat|https://api.minimaxi.chat>",
"base_path": "/path/to/output",
"resource_mode": "url"
}
}
}
}此方法支持多租户使用,其中每个请求可以使用不同的 API 密钥和配置。
2. API配置
当在其他项目中作为模块使用时,可以通过startMiniMaxMCP函数传递配置:
import { startMiniMaxMCP } from 'minimax-mcp-js';
await startMiniMaxMCP({
apiKey: 'your_api_key_here',
apiHost: 'https://api.minimaxi.chat', // Global Host - https://api.minimaxi.chat, Mainland Host - https://api.minimax.chat
basePath: '/path/to/output',
resourceMode: 'url'
});3. 命令行参数
全局安装 CLI 工具:
# Install globally
pnpm install -g minimax-mcp-js当用作 CLI 工具时,您可以通过命令行参数提供配置:
minimax-mcp-js --api-key your_api_key_here --api-host https://api.minimaxi.chat --base-path /path/to/output --resource-mode url4. 环境变量(最低优先级)
最基本的配置方法是通过环境变量:
# MiniMax API Key (required)
MINIMAX_API_KEY=your_api_key_here
# Base path for output files (optional, defaults to user's desktop)
MINIMAX_MCP_BASE_PATH=~/Desktop
# MiniMax API Host (optional, defaults to https://api.minimaxi.chat, Global Host - https://api.minimaxi.chat, Mainland Host - https://api.minimax.chat)
MINIMAX_API_HOST=https://api.minimaxi.chat
# Resource mode (optional, defaults to 'url')
# Options: 'url' (return URLs), 'local' (save files locally)
MINIMAX_RESOURCE_MODE=url配置优先级
当使用多种配置方法时,适用以下优先级顺序(从高到低):
请求级配置(通过每个 API 请求中的
meta.auth)命令行参数
环境变量
配置文件
默认值
这种优先级确保了跨不同部署场景的灵活性,同时保持了多租户环境的每个请求的配置功能。
配置参数
范围 | 描述 | 默认值 |
api密钥 | MiniMax API 密钥 | 无(必填) |
api主机 | MiniMax API 主机 | 全球主机 - https://api.minimaxi.chat ,大陆主机 - https://api.minimax.chat |
基础路径 | 输出文件的基本路径 | 用户的桌面 |
资源模式 | 资源处理模式,“url”或“local” | 网址 |
⚠️注意:API Key 需要与主机地址匹配,全球版本和中国大陆版本使用不同的主机:
全球主机:
https://api.minimaxi.chat(注意多余的“i”)中国大陆主机:
https://api.minimax.chat
示例用法
⚠️警告:使用这些工具可能会产生费用。
1. 播放一段晚间新闻
2. 克隆声音
3. 生成视频
4. 生成图像
可用工具
文本转音频
将文本转换为语音音频文件。
工具名称: text_to_audio
参数:
text:要转换的文本(必需)model:模型版本,选项有‘speech-02-hd’、‘speech-02-turbo’、‘speech-01-hd’、‘speech-01-turbo’、‘speech-01-240228’、‘speech-01-turbo-240228’,默认为‘speech-02-hd’voiceId:语音ID,默认为'male-qn-qingse'speed:语速,范围0.5-2.0,默认为1.0vol:音量,范围0.1-10.0,默认为1.0pitch:音高,范围 -12 到 12,默认值为 0emotion:情绪,可选值为“高兴”、“悲伤”、“愤怒”、“恐惧”、“厌恶”、“惊讶”、“中性”,默认为“高兴”。注意:此参数仅适用于“speech-02-hd”、“speech-02-turbo”、“speech-01-turbo”和“speech-01-hd”型号。format:音频格式,选项有 'mp3', 'pcm', 'flac', 'wav',默认为 'mp3'sampleRate:采样率(Hz),选项有 8000、16000、22050、24000、32000、44100,默认为 32000bitrate:比特率(bps),选项有 64000、96000、128000、160000、192000、224000、256000、320000,默认为 128000channel:音频通道,可选1或2,默认为1languageBoost:语言增强,默认为“自动”latexRead:启用 LaTeX 公式读取pronunciationDict:发音词典stream:启用流输出subtitleEnable:启用字幕生成outputDirectory:保存输出文件的目录(可选)outputFile:保存输出文件的路径(可选,如果未提供则自动生成)
播放音频
播放音频文件。支持 WAV 和 MP3 格式。不支持视频。
工具名称: play_audio
参数:
inputFilePath:要播放的音频文件的路径(必需)isUrl:音频文件是否为URL,默认为false
语音克隆
从音频文件中克隆声音。
工具名称: voice_clone
参数:
audioFile:音频文件路径(必需)voiceId:语音 ID(必填)text:演示音频的文本(可选)outputDirectory:保存输出文件的目录(可选)
文本转图像
根据文本提示生成图像。
工具名称: text_to_image
参数:
prompt:图片描述(必填)model:模型版本,默认为 'image-01'aspectRatio:宽高比,默认为“1:1”,选项为“1:1”,“16:9”,“4:3”,“3:2”,“2:3”,“3:4”,“9:16”,“21:9”n:要生成的图像数量,范围 1-9,默认为 1promptOptimizer:是否优化提示,默认为 truesubjectReference:字符引用的本地图像文件或公共 URL 的路径(可选)outputDirectory:保存输出文件的目录(可选)outputFile:保存输出文件的路径(可选,如果未提供则自动生成)asyncMode:是否使用异步模式。默认为 False。如果为 True,则视频生成任务将异步提交,响应将返回 task_id。应使用query_video_generation工具检查任务状态并获取结果。(可选)
生成视频
根据文字提示生成视频。
工具名称: generate_video
参数:
prompt:视频描述(必填)model:模型版本,选项有“T2V-01”、“T2V-01-Director”、“I2V-01”、“I2V-01-Director”、“I2V-01-live”、“S2V-01”,默认为“T2V-01”firstFrameImage:第一帧图像的路径(可选)outputDirectory:保存输出文件的目录(可选)outputFile:保存输出文件的路径(可选,如果未提供则自动生成)asyncMode:是否使用异步模式。默认为 False。如果为 True,则视频生成任务将异步提交,响应将返回 task_id。应使用query_video_generation工具检查任务状态并获取结果。(可选)
查询视频生成状态
查询视频生成任务的状态。
工具名称: query_video_generation
参数:
taskId:要查询的任务 ID。如果async_mode为 True,则应为generate_video工具返回的 task_id。(必填)outputDirectory:保存输出文件的目录(可选)
常问问题
1. 如何在异步模式下使用generate_video
在开始之前定义完成规则:或者,可以在 IDE 设置中配置这些规则(例如,Cursor):
发展
设置
# Clone the repository
git clone https://github.com/MiniMax-AI/MiniMax-MCP-JS.git
cd minimax-mcp-js
# Install dependencies
pnpm install建造
# Build the project
pnpm run build跑步
# Run the MCP server
pnpm start执照
麻省理工学院
Available Tools
10 toolsgenerate_videoA
Generate a video based on text prompts.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: prompt (required), asyncMode, duration, firstFrameImage, +4 more.
image_to_videoA
Generate a video based on an image.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: firstFrameImage (required), prompt (required), asyncMode, model, +2 more.
list_voicesA
List all available voices. Only supported when api_host is https://api.minimax.chat.
Inputs: voiceType.
music_generationA
Create a music generation task using AI models. Generate music from prompt and lyrics.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: lyrics (required), prompt (required), bitrate, format, +2 more.
play_audioC
Play an audio file. Supports WAV and MP3 formats. Does not support video.
Inputs: inputFilePath (required), isUrl.
query_video_generationB
Query the status of a video generation task.
Inputs: taskId (required), outputDirectory.
text_to_audioA
Convert text to audio with a given voice and save the output audio file to a given directory. If no directory is provided, the file will be saved to desktop. If no voice ID is provided, the default voice will be used.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: text (required), bitrate, channel, emotion, +11 more.
text_to_imageA
Generate images based on text prompts.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: prompt (required), aspectRatio, model, n, +3 more.
voice_cloneA
Clone a voice using the provided audio file. New voices will incur costs when first used.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: audioFile (required), voiceId (required), isUrl, outputDirectory, +1 more.
voice_designA
Generate a voice based on description prompts.
Note: This tool calls MiniMax API and may incur costs. Use only when explicitly requested by the user.
Inputs: previewText (required), prompt (required), outputDirectory, voiceId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose targeting different media generation tasks (video, image, audio, voice) with no overlap. Tools like generate_video and image_to_video are differentiated by input type, while text_to_audio and voice_clone serve separate audio functions.
All tools follow a consistent verb_noun or verb_to_noun pattern (e.g., generate_video, text_to_image, list_voices) with snake_case throughout. The naming is predictable and clearly indicates each tool's action and target resource.
With 10 tools, the set is well-scoped for a media generation API server, covering video, image, audio, and voice operations. Each tool earns its place without redundancy, and the count aligns with the domain's complexity.
The toolset provides strong coverage for media generation tasks, including creation, querying, and listing operations. A minor gap is the lack of tools for deleting or managing generated media files, but core workflows are well-supported.
Maintenance
Related MCP Connectors
MCP server for Hailuo (MiniMax) AI video generation
MCP server for MiniMax H3 multimodal video generation
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images and videos, synthesize speech, clone voices, and design custom voices through MiniMax APIs.468 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images and videos, synthesize speech, clone voices, and design custom voices via MiniMax's APIs.468 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images and videos, synthesize speech, and clone or design custom voices through MiniMax's AI APIs, with configurable local or URL resource output. Supports stdio, REST, and SSE transports for both local and cloud deployment.468 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images, videos, and speech, clone or design voices, and manage the resulting media through MiniMax APIs.468 npmMIT