> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AihubMax MCP

> Call AihubMax's media-generation capabilities directly from MCP clients like Claude Desktop, Claude Code, and Cursor

## Overview

**AihubMax MCP** is the official [MCP](https://modelcontextprotocol.io) server for [AihubMax](https://api.aihubmax.com/console). It wraps the platform's image / video / audio / document generation, media understanding, and async task system into a set of tools, so agents inside Claude Desktop, Claude Code, Cursor, Cline, and other MCP clients can **discover models, generate media, and retrieve results** — all within the conversation.

It is the third official integration form, alongside the CLI base-URL setup in the Integration Guide and the Skills.

<Info>
  All you need is an AihubMax API Key starting with `sk-`. Get one from the [AihubMax console](https://api.aihubmax.com/console).
</Info>

## Prerequisites

<CardGroup cols={2}>
  <Card title="Node.js 18+" icon="node-js">
    Launching the MCP server via `npx` requires Node.js 18 or later. [Download Node.js →](https://nodejs.org/en/download/)
  </Card>

  <Card title="AihubMax API Key" icon="key">
    A valid API Key starting with `sk-`. [Go to console →](https://api.aihubmax.com/console)
  </Card>
</CardGroup>

## Installation

Add the following to your MCP client's config file, replacing `sk-your-key` with your own API Key:

```json theme={null}
{
  "mcpServers": {
    "aihub": {
      "command": "npx",
      "args": ["-y", "github:cookaihq/aihub-mcp"],
      "env": { "AIHUBMAX_API_KEY": "sk-your-key" }
    }
  }
}
```

<Tip>
  On first launch, `npx` downloads and compiles automatically — give it a moment. Subsequent launches are fast.
</Tip>

Config file locations per client:

<CodeGroup>
  ```text Claude Desktop theme={null}
  macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  Windows: %APPDATA%\Claude\claude_desktop_config.json
  ```

  ```text Claude Code theme={null}
  .mcp.json in your project root, or use the command:
  claude mcp add aihub --env AIHUBMAX_API_KEY=sk-your-key -- npx -y github:cookaihq/aihub-mcp
  ```

  ```text Cursor theme={null}
  Settings → MCP → Add new server, fill in the command / args / env above
  ```
</CodeGroup>

Restart the client after configuring. You're ready once the `aihub` server shows as connected and its tools are loaded.

## Tools

Once configured, the agent can use these 14 tools:

| Tool                                                                         | Purpose                                                                                     |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `list_models`                                                                | List available generation models (image/video/audio/document) with availability and pricing |
| `describe_model`                                                             | View a model's parameters, examples, endpoint, and pricing                                  |
| `generate_image` / `generate_video` / `generate_audio` / `generate_document` | Submit generation tasks; images can be shown inline in the conversation                     |
| `get_task` / `wait_for_task`                                                 | Query / block-wait on async tasks (with progress)                                           |
| `download_asset`                                                             | Download results to local disk                                                              |
| `upload_file`                                                                | Local file / URL / base64 → a referenceable public URL                                      |
| `analyze_media`                                                              | Multimodal understanding: image / video / audio → text                                      |
| `ask_model`                                                                  | Ask another LLM (second opinion / trial)                                                    |
| `create_embeddings`                                                          | Text vector embeddings                                                                      |
| `get_credits`                                                                | Query balance and usage                                                                     |

## Example

Just drive it with natural language in the conversation, for example:

<Steps>
  <Step title="Discover models">
    "List the available video models and their prices" — the agent calls `list_models` and returns the model list, availability, and per-call price.
  </Step>

  <Step title="Generate media">
    "Generate a video of a seaside sunset with veo-3.1-text-to-video" — the agent calls `generate_video` to submit the task and `wait_for_task` to wait for the result URL.
  </Step>

  <Step title="Save / view">
    "Download that video to \~/Downloads" — `download_asset` saves it; image results are shown inline in the conversation.
  </Step>
</Steps>

<Note>
  Result URLs are valid for 24 hours — save them promptly with `download_asset`.
</Note>

## Notes

* This MCP is distinct from the built-in **documentation-search MCP** (`docs.aihubmax.com/mcp`, for searching this site): the former calls generation APIs, the latter only reads and searches docs.
* Authentication uses the `AIHUBMAX_API_KEY` environment variable (or pass `--api-key sk-...`); the Base URL defaults to `https://api.aihubmax.com` and can be overridden with `AIHUBMAX_BASE_URL`.
* Source and issues: [GitHub](https://github.com/cookaihq/aihub-mcp)
