Skip to main content
Glama
HappyWan API MCP Server

HappyWan API MCP Server

by Anil-matcha
README.md
# HappyWan 1.0 API (Happy-Wan 1.0 API) MCP Server

> **HappyWan 1.0 API (also written Happy-Wan 1.0 API, HappyWan API or Happy Wan 1.0 API) is available now on MuAPI** with dedicated **HappyWan** text-to-video, image-to-video and reference-to-video endpoints (**up to 50 references, clips up to 45 seconds**), alongside the **Wan 3.0** and **HappyHorse 1.1** model families it builds on. Get a key at [muapi.ai/access-keys](https://muapi.ai/access-keys); see the [HappyWan API page](https://muapi.ai/happywan) and the [MuAPI MCP docs](https://muapi.ai/docs/mcp).

[![Powered by MuAPI](https://img.shields.io/badge/Powered%20by-MuAPI-6366f1?style=flat-square)](https://muapi.ai)
[![MCP compatible](https://img.shields.io/badge/MCP-compatible-green?style=flat-square)](https://modelcontextprotocol.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

A focused MCP server for HappyWan, Wan 3.0 and HappyHorse 1.1 video workflows through MuAPI. HappyWan tools call MuAPI's dedicated `happywan-*` routes; Wan 3.0 and HappyHorse 1.1 tools call those model families directly. Requests are asynchronous: generation tools return a `request_id`, and `happywan_get_result` retrieves the status and output.

## Related Projects

- [HappyWan 1.0 API (Happy-Wan 1.0 API) on MuAPI](https://muapi.ai/happywan) — HappyWan (up to 50 references, 45-second clips), Wan 3.0 and HappyHorse 1.1 text, image and reference to video.
- [HappyWan Spicy API](https://muapi.ai/happywan-spicy) — high-intensity Wan 3.0 Spicy tier.
- [HappyWan-API](https://github.com/Anil-matcha/HappyWan-API) — Python client and cURL examples for text, image and reference to video.
- [happywan-comfyui](https://github.com/Anil-matcha/happywan-comfyui) — HappyWan-API ComfyUI nodes.
- [n8n-nodes-happywan](https://github.com/Anil-matcha/n8n-nodes-happywan) — HappyWan n8n node.

## Tools

| Tool | Model / route | Purpose |
| --- | --- | --- |
| `happywan_text_to_video` | HappyWan · `happywan-text-to-video` | Generate clips up to 45 seconds from a prompt |
| `happywan_image_to_video` | HappyWan · `happywan-image-to-video` | Animate one source image |
| `happywan_reference_to_video` | HappyWan · `happywan-reference-to-video` | Guide generation with up to 50 references |
| `wan3_text_to_video` | Wan 3.0 · `wan3.0-text-to-video` | Generate from a prompt |
| `wan3_image_to_video` | Wan 3.0 · `wan3.0-image-to-video` | Animate a starting image, with optional end frame |
| `wan3_reference_to_video` | Wan 3.0 · `wan3.0-reference-to-video` | Guide generation with image, video, and audio references |
| `happyhorse_1_1_text_to_video` | HappyHorse 1.1 · `happy-horse-1.1-text-to-video` | Generate from a prompt |
| `happyhorse_1_1_image_to_video` | HappyHorse 1.1 · `happy-horse-1.1-image-to-video` | Animate one source image |
| `happyhorse_1_1_reference_to_video` | HappyHorse 1.1 · `happy-horse-1.1-reference-to-video` | Guide generation with 1–9 reference images |
| `happyhorse_1_1_video_edit` | HappyHorse 1.1 · `happy-horse-1.1-video-edit` | Edit an existing video from an instruction |
| `happywan_get_result` | MuAPI predictions | Fetch a request's status and output |

Generation inputs use public media URLs. HappyWan reference-to-video accepts up to 50 references and all HappyWan tools accept durations up to 45 seconds. Wan 3.0 reference-to-video accepts up to 10 images, 5 videos, and 5 audio references. HappyHorse image-to-video takes exactly one image in `images_list`; its reference-to-video workflow accepts 1–9 images. HappyHorse video edits accept optional reference images and `audio_setting` (`auto` or `origin`).

## Quick start

```bash
git clone https://github.com/Anil-matcha/happywan-mcp.git
cd happywan-mcp
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
export MUAPI_API_KEY=your_muapi_key_here
python mcp_stdio.py
```

Get a key from [MuAPI API Keys](https://muapi.ai/access-keys). The stdio server uses `MUAPI_API_KEY` (or legacy `MUAPIAPP_API_KEY`).

## MCP client configuration

Use the `mcp.json` entry or add the server to Cursor, Claude Desktop, or another stdio MCP client:

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

Example: call `wan3_text_to_video` with a `prompt`, then call `happywan_get_result` with the returned `request_id`. The result tool returns once by default. Set `wait_until_done: true` to keep polling until the request completes, fails, or reaches `MUAPI_POLL_TIMEOUT`.

## HTTP bridge

```bash
python mcp_server.py   # http://localhost:8000/docs
```

The bridge exposes tool discovery at `GET /mcp/tools`, asynchronous calls at `POST /mcp/tools/{tool_name}/call`, and task status/SSE at `/mcp/predictions/{request_id}` and `/mcp/predictions/{request_id}/stream`.

## Docker

```bash
docker build -t happywan-mcp .
docker run --rm -p 8000:8000 -e MUAPI_API_KEY="$MUAPI_API_KEY" happywan-mcp
```

## Configuration

| Variable | Default | Purpose |
| --- | --- | --- |
| `MUAPI_API_KEY` | — | MuAPI API key |
| `HAPPYWAN_API_BASE_URL` (or `MUAPI_BASE_URL`) | `https://api.muapi.ai/api/v1` | Override the API base URL |
| `MUAPI_HTTP_TIMEOUT` | `120` | Per-request timeout in seconds |
| `MUAPI_POLL_INTERVAL` | `3` | Interval for `wait_until_done` polling |
| `MUAPI_POLL_TIMEOUT` | `900` | Maximum wait for a terminal result |

Each submit route can also be overridden for compatible MuAPI deployments: `HAPPYWAN_T2V_ENDPOINT`, `HAPPYWAN_I2V_ENDPOINT`, `HAPPYWAN_R2V_ENDPOINT`, `WAN3_T2V_ENDPOINT`, `WAN3_I2V_ENDPOINT`, `WAN3_R2V_ENDPOINT`, `HAPPYHORSE11_T2V_ENDPOINT`, `HAPPYHORSE11_I2V_ENDPOINT`, `HAPPYHORSE11_R2V_ENDPOINT`, and `HAPPYHORSE11_EDIT_ENDPOINT`.

## Development

The seed repo's unittest layout is retained:

```bash
python -m unittest discover -s tests -v
```

## API references

- [Wan 3.0 API](https://muapi.ai/wan-3)
- [Wan 3.0 text-to-video](https://muapi.ai/playground/wan3.0-text-to-video/api)
- [Wan 3.0 reference-to-video](https://muapi.ai/playground/wan3.0-reference-to-video/api)
- [HappyHorse 1.1 API](https://muapi.ai/happyhorse-1.1)
- [HappyHorse 1.1 text-to-video](https://muapi.ai/playground/happy-horse-1.1-text-to-video/api)
- [HappyHorse 1.1 image-to-video](https://muapi.ai/playground/happy-horse-1.1-image-to-video/api)
- [HappyHorse 1.1 reference-to-video](https://muapi.ai/playground/happy-horse-1.1-reference-to-video/api)
- [HappyHorse 1.1 video edit](https://muapi.ai/playground/happy-horse-1.1-video-edit/api)
- [MuAPI API keys](https://muapi.ai/access-keys)

## HappyWan Spicy & Uncensored HappyWan API (Happy-Wan Spicy)

Looking for an **uncensored HappyWan API** or **HappyWan Spicy API**? On MuAPI, "Spicy" is the high-intensity tier: bolder contrast, stronger motion and more dramatic scenes. The Spicy tier for the HappyWan workflow is **Wan 3.0 Spicy**, live now with text, image and reference inputs (HappyHorse 1.1 has no Spicy tier):

| Endpoint | Input |
| --- | --- |
| `wan3.0-spicy-text-to-video` | Text prompt |
| `wan3.0-spicy-image-to-video` | Start image + prompt |
| `wan3.0-spicy-reference-to-video` | Reference images / videos / audio + prompt |

The routes are the same MuAPI submit-and-poll flow as the standard endpoints; only the model route changes. The nodes/tools in this package currently cover the standard Wan 3.0 and HappyHorse 1.1 routes; for Wan 3.0 Spicy use the routes above directly or the [HappyWan-API Python client](https://github.com/Anil-matcha/HappyWan-API). Details: [Wan Spicy API on MuAPI](https://muapi.ai/wan-spicy).

> **Content policy:** Spicy is a separate model tier, not a moderation bypass and not an anything-goes endpoint. Output must comply with MuAPI's terms and applicable law. Do not generate content involving minors, non-consensual imagery or other prohibited material.

<sub>Keywords: HappyWan API, Happy-Wan API, HappyWan Spicy, uncensored HappyWan, uncensored Happy-Wan API, spicy AI video API, uncensored AI video generator API.</sub>

## License

MIT. See [LICENSE](LICENSE).

<sub>Keywords: HappyWan 1.0 API, Happy-Wan 1.0 API, Happy Wan 1.0 API, HappyWan 1.0, Happy-Wan 1.0, HappyWan API, Happy-Wan API.</sub>