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

# MCP Server

> Connect Claude, ChatGPT, VS Code, Cursor, and other AI tools to varg.ai

Connect your AI tools to varg.ai for image, video, speech, and music generation — no code required. The varg MCP server gives any MCP-compatible client access to 19 tools with inline media previews.

## Connect

<Tabs>
  <Tab title="Claude.ai">
    Connect via Custom Connectors on [claude.ai](https://claude.ai).

    <Steps>
      <Step title="Open connectors">
        Go to [Settings → Connectors](https://claude.ai/customize/connectors) in Claude.
      </Step>

      <Step title="Add custom connector">
        Click **+** → **Add custom connector**, then paste:

        ```
        https://mcp.varg.ai/mcp
        ```
      </Step>

      <Step title="Authorize">
        Click **Add**. A browser window opens — log in to your varg.ai account and click **Approve**. You're connected.
      </Step>
    </Steps>

    <Tip>
      Available on Free, Pro, Max, Team, and Enterprise plans. Free users are limited to one custom connector.
    </Tip>
  </Tab>

  <Tab title="Claude Desktop">
    Add to your `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "varg": {
          "url": "https://mcp.varg.ai/mcp"
        }
      }
    }
    ```

    Restart Claude Desktop. A browser window opens — log in and click **Approve**.

    <Info>
      On macOS, the config file is at `~/Library/Application Support/Claude/claude_desktop_config.json`.
    </Info>
  </Tab>

  <Tab title="ChatGPT">
    Connect via Custom Connectors on [chatgpt.com](https://chatgpt.com).

    <Steps>
      <Step title="Open connectors">
        Go to [Settings → Connectors](https://chatgpt.com/settings/connectors) in ChatGPT.
      </Step>

      <Step title="Add custom connector">
        Click **Add custom connector**, then enter the server URL:

        ```
        https://mcp.varg.ai/mcp
        ```

        For **Registration method**, select **DCR** (Dynamic Client Registration). Leave Client ID and Client Secret blank.
      </Step>

      <Step title="Authorize">
        Click **Add**. A browser window opens — log in to your varg.ai account and click **Approve**. You're connected.
      </Step>
    </Steps>

    <Tip>
      Available on Free, Plus, Pro, and Team plans. You can also use varg via the [OpenAI Responses API](https://platform.openai.com/docs/guides/tools-connectors-mcp) by passing `server_url` directly.
    </Tip>
  </Tab>

  <Tab title="Claude Code">
    Add the remote MCP server to your project's `.mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "varg": {
          "url": "https://mcp.varg.ai/mcp"
        }
      }
    }
    ```

    Or add via the CLI:

    ```bash theme={null}
    claude mcp add varg --url https://mcp.varg.ai/mcp
    ```

    Claude Code will prompt you to authorize on first use.

    <Info>
      For local mode without OAuth, use `npx @vargai/mcp` with stdio transport instead. See the [Claude Code setup guide](/ai-agents/claude-code) for the full skill installation.
    </Info>
  </Tab>

  <Tab title="VS Code">
    Add to `.vscode/mcp.json` in your project:

    ```json theme={null}
    {
      "servers": {
        "varg": {
          "url": "https://mcp.varg.ai/mcp"
        }
      }
    }
    ```

    Or add globally via command line:

    ```bash theme={null}
    code --add-mcp '{"name":"varg","url":"https://mcp.varg.ai/mcp"}'
    ```

    VS Code will prompt you to authorize on first use.
  </Tab>

  <Tab title="Cursor">
    Add to `.cursor/mcp.json` in your project:

    ```json theme={null}
    {
      "mcpServers": {
        "varg": {
          "url": "https://mcp.varg.ai/mcp"
        }
      }
    }
    ```

    Cursor will prompt you to authorize on first use.
  </Tab>

  <Tab title="npx (local)">
    Run the MCP server locally via stdio — no remote connection needed:

    ```bash theme={null}
    npx @vargai/mcp
    ```

    Uses your API key from `~/.varg/credentials` or `VARG_API_KEY` env var.

    Log in first if you haven't:

    ```bash theme={null}
    bunx vargai login
    ```
  </Tab>
</Tabs>

## Available tools

The MCP server exposes 23 tools:

| Tool              | Description                                                                          |
| ----------------- | ------------------------------------------------------------------------------------ |
| `generate_image`  | Generate images with FLUX, Recraft, Seedream, Nano Banana, and more                  |
| `generate_video`  | Generate videos with Kling v3, Minimax, Seedance, Sora, and more                     |
| `generate_speech` | Text-to-speech with ElevenLabs (50+ voices)                                          |
| `generate_music`  | Generate background music with MiniMax Music                                         |
| `probe_media`     | Inspect a video/audio file — duration, dimensions, codec, fps, bitrate               |
| `trim_video`      | Cut a segment from a video by start/end time or start/duration                       |
| `resize_video`    | Scale a video to new dimensions (contain, cover, or stretch)                         |
| `slice_video`     | Split a video into segments with first-frame thumbnails                              |
| `run_ffmpeg`      | Run any FFmpeg command in the cloud (arbitrary filters, concat, extract audio, etc.) |
| `list_models`     | List all available AI models with pricing                                            |
| `check_balance`   | Check your credit balance                                                            |
| `list_templates`  | Browse video templates                                                               |
| `get_template`    | Get template details and variables                                                   |
| `render_template` | Render a video from a template                                                       |
| `get_job`         | Check generation job status                                                          |
| `list_voices`     | List available TTS voices                                                            |

Plus tools for lipsync, upscaling, transcription, and file uploads.

## How it works

```
Your AI tool (Claude, ChatGPT, VS Code, Cursor)
    │
    │  OAuth 2.1 (automatic)
    ▼
mcp.varg.ai (MCP server)
    │
    │  API key (managed for you)
    ▼
api.varg.ai (varg API, /v2)
    │
    ▼
AI providers (fal, ElevenLabs, Higgsfield, HeyGen, PiAPI, etc.)
```

When you connect for the first time, the MCP server walks you through an OAuth flow:

1. You log in to your varg.ai account (or create one)
2. You approve the connection
3. An API key is created automatically and stored securely on the server
4. All subsequent requests use this key — no manual key management needed

## Inline media previews

Tools that generate media return inline previews directly in your chat:

* **Images** — displayed inline with click-to-open fullscreen
* **Videos** — embedded player with play/pause controls
* **Audio** — compact player with progress bar and seek

These work in Claude Desktop, claude.ai, and VS Code (via MCP Apps).

## Pricing

varg uses a credit system. 1 credit = \$0.01 USD.

| Generation                         | Credits | Cost   |
| ---------------------------------- | ------- | ------ |
| Image (Flux Schnell)               | 5       | \$0.05 |
| Image (Flux Pro)                   | 10      | \$0.10 |
| Image (Nano Banana Pro)            | 5       | \$0.05 |
| Image (Recraft v3)                 | 10      | \$0.10 |
| Image (Recraft v4 Pro)             | 30      | \$0.30 |
| Image (Grok Imagine)               | 3       | \$0.03 |
| Video (Kling v3, 5s)               | 150     | \$1.50 |
| Video (Kling v3 Standard, 5s)      | 100     | \$1.00 |
| Video (Wan 2.5, 5s)                | 80      | \$0.80 |
| Video (Minimax, 5s)                | 80      | \$0.80 |
| Video (Seedance 2, 5s)             | 250     | \$2.50 |
| Video (LTX-2, 5s)                  | 50      | \$0.50 |
| Speech (ElevenLabs v3)             | 25      | \$0.25 |
| Speech (ElevenLabs Turbo)          | 20      | \$0.20 |
| Music                              | 30      | \$0.30 |
| Lipsync (Sync v2 Pro)              | 80      | \$0.80 |
| Lipsync (OmniHuman)                | 100     | \$1.00 |
| Transcription (Whisper)            | 10      | \$0.10 |
| Transcription (Groq Whisper Turbo) | 3       | \$0.03 |
| FFmpeg Trim                        | 5       | \$0.05 |
| FFmpeg Resize                      | 5       | \$0.05 |
| FFmpeg Slice                       | 5       | \$0.05 |
| FFmpeg (custom command)            | 5       | \$0.05 |
| Probe Media                        | 5       | \$0.05 |

Cached results are free. Use `check_balance` to see your remaining credits.

<CardGroup cols={2}>
  <Card title="Get API Key" icon="key" href="https://app.varg.ai">
    Sign up and get your API key
  </Card>

  <Card title="AI Models" icon="sparkles" href="/models">
    Browse all available models with pricing
  </Card>

  <Card title="Templates" icon="film" href="/templates">
    Pre-built video templates
  </Card>

  <Card title="API Reference" icon="code" href="/api">
    Full REST API documentation
  </Card>
</CardGroup>
