Skip to main content
Glama
README.md
# MiniMax H4 MCP Server (works today with MiniMax H3) for Claude, Cursor and any MCP client

> **Status notice: MiniMax H4 is an unconfirmed watchlist item.** MiniMax has not announced an H4 model, and [Muapi](https://muapi.ai) has no H4 endpoint. This repository does not claim any H4 specs, pricing or availability. What it does today is expose the **live MiniMax H3** video endpoints on Muapi as MCP tools, with the model slug prefix configurable so it can be pointed at a newer model if and when Muapi publishes one. Watch [muapi.ai/minimax-h4](https://muapi.ai/minimax-h4) for status.

An [MCP](https://modelcontextprotocol.io) server that lets Claude Desktop, Cursor, and any MCP-compatible client generate MiniMax video through one [Muapi](https://muapi.ai) API key. Get a key at [muapi.ai/access-keys](https://muapi.ai/access-keys). Live model page: [muapi.ai/minimax-h3](https://muapi.ai/minimax-h3).

## Tools

| Tool | What it does | Default Muapi endpoint |
| --- | --- | --- |
| `minimax_text_to_video` | Text prompt to video | `minimax-h3-text-to-video` |
| `minimax_image_to_video` | Animate an image, optional `last_image_url` | `minimax-h3-image-to-video` |
| `minimax_reference_to_video` | Guide a video with reference images/videos (audio optional) | `minimax-h3-reference-to-video` |
| `minimax_get_result` | Check or wait for a request (`request_id`) | `GET /predictions/{request_id}/result` |

Parameters (current H3 contract): `aspect_ratio` (`21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`; not used by image-to-video), `resolution` (`2k`), `duration` (5 to 15 seconds), optional `webhook_url`. Reference-to-video needs at least one `reference_images` (max 5) or `reference_videos` (max 3) entry; `reference_audios` (max 2) cannot be used alone.

Generation tools return immediately with a `request_id`; call `minimax_get_result` until `status` is `completed`.

## Install

```bash
git clone https://github.com/Anil-matcha/minimax-h4-mcp.git
cd minimax-h4-mcp
pip install -r requirements.txt
export MUAPI_API_KEY=your_key
```

### Claude Desktop

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "minimax": {
      "command": "python",
      "args": ["/absolute/path/to/minimax-h4-mcp/mcp_stdio.py"],
      "env": { "MUAPI_API_KEY": "your_key" }
    }
  }
}
```

### Cursor

Add to `~/.cursor/mcp.json` (or the project's `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "minimax": {
      "command": "python",
      "args": ["/absolute/path/to/minimax-h4-mcp/mcp_stdio.py"],
      "env": { "MUAPI_API_KEY": "your_key" }
    }
  }
}
```

### HTTP bridge / Docker

`python mcp_server.py` starts a small FastAPI bridge on port 8000 (`/mcp/tools`, `/mcp/tools/{name}/call`, `/mcp/predictions/{id}`). A `Dockerfile` and `smithery.yaml` are included.

## Configuration

| Variable | Default | Purpose |
| --- | --- | --- |
| `MUAPI_API_KEY` | none (required) | Your Muapi key |
| `MINIMAX_MODEL` | `minimax-h3` | Slug prefix; endpoints become `<prefix>-text-to-video`, `<prefix>-image-to-video`, `<prefix>-reference-to-video` |
| `MUAPI_BASE_URL` | `https://api.muapi.ai/api/v1` | API base |
| `MUAPI_POLL_INTERVAL` / `MUAPI_POLL_TIMEOUT` | `5` / `900` | Polling seconds when waiting |

**About H4:** if Muapi later publishes an H4 model, setting `MINIMAX_MODEL=minimax-h4` is the expected way to use it. That slug naming is an **unverified assumption**, not a confirmed endpoint, and an H4 model may take different parameters than the H3 schema enforced here. Until Muapi lists it, leave the default.

## Raw API equivalent

```bash
curl -X POST https://api.muapi.ai/api/v1/minimax-h3-text-to-video \
  -H "x-api-key: $MUAPI_API_KEY" -H "Content-Type: application/json" \
  -d '{"prompt":"A cinematic tracking shot at dusk","aspect_ratio":"16:9","resolution":"2k","duration":5}'

curl https://api.muapi.ai/api/v1/predictions/<request_id>/result -H "x-api-key: $MUAPI_API_KEY"
```

## Tests

```bash
pip install -r requirements.txt pytest
python -m pytest tests -q
```

## Related Projects

- [Anil-matcha/MiniMax-H3-API](https://github.com/Anil-matcha/MiniMax-H3-API): Python SDK for the live MiniMax H3 endpoints.
- [Anil-matcha/minimax-h3-comfyui](https://github.com/Anil-matcha/minimax-h3-comfyui): ComfyUI nodes for MiniMax H3.
- [Anil-matcha/MiniMax-H4-API](https://github.com/Anil-matcha/MiniMax-H4-API): MiniMax H4 API watchlist and SDK sibling.
- [Anil-matcha/minimax-h4-comfyui](https://github.com/Anil-matcha/minimax-h4-comfyui): ComfyUI sibling for the H4 watchlist.
- [Anil-matcha/n8n-nodes-minimax-h4](https://github.com/Anil-matcha/n8n-nodes-minimax-h4): n8n nodes sibling for the H4 watchlist.

## License

MIT