Сервер Flaq AI MCP

Flaq MCP Server Tutorial for AI Image and Video Generation

Give Cursor, OpenAI Codex, Claude Code, Hermes, and Grok Build direct access to Flaq AI media generation through one hosted MCP endpoint. Flaq MCP wraps Flaq's image and video generation APIs so an agent can discover available models, submit generation tasks, and poll for completed results without a separate REST API integration.

Подключить агента
Удаленная конечная точка MCP
https://api.flaq.ai/mcp
Аутентификация: Токен Bearer с использованием клиентского ключа OpenAPI

Возможности

One MCP Endpoint for AI Image and Video Workflows

Flaq MCP exposes the core media generation workflows agents need through a compact tool surface. The current catalog spans image and video generation across text and image inputs, and agents can discover supported models at runtime with list_models.

Text to Image

Generate images from natural-language prompts with selectable models, aspect ratios, resolutions, and seeds.

Image to Image

Edit or transform public HTTPS images with a prompt and optional multi-image references.

Text to Video

Create video clips from text prompts with model-specific duration, ratio, resolution, sound, and negative prompt options.

Image to Video

Animate a public HTTPS image by sending an image URL with the shared video generation tool.

Подключение

Connect Flaq MCP to Your Agent

Follow these steps once for your preferred client. Flaq uses direct stateless HTTP with an Authorization header and does not require mcp-remote, mcp-session-id, sticky sessions, or any locally installed MCP server package.

1

Get Your API Key

Create or copy your API Key from Flaq, then keep it ready for the client configuration. Replace <YOUR_API_KEY> with the real key; do not leave the placeholder in the saved file.

2

Add Flaq MCP to Your Agent

Choose your MCP client below, copy its configuration into the indicated file, and preserve any unrelated settings already present in that file.

Add Flaq as a global Cursor MCP server so its media generation tools are available across workspaces.

Cursor MCP configuration

~/.cursor/mcp.json
{  "mcpServers": {    "flaq-ai": {      "url": "https://api.flaq.ai/mcp",      "headers": {        "Authorization": "Bearer <YOUR_API_KEY>"      }    }  }}

After saving the file, open Cursor Settings, go to MCP, and restart flaq-ai.

3

Save, Restart, and Verify the Connection

Save the configuration and restart or reload the MCP connection. Ask the agent to call list_models; a successful response confirms that the endpoint is connected and the Flaq tools are discoverable.

Copy this prompt into your connected agent after it restarts.

Verify Flaq MCP with list_models

Use the Flaq MCP server to call list_models and show me the available text-to-image models.
4

Run Your First Media Generation

After model discovery succeeds, ask the agent to generate an image. The agent should submit the task once, keep the returned taskId, and call get_task_result until the task succeeds or fails.

This prompt tests model discovery, paid submission, and result polling in one guided request.

Generate a First Image with Flaq MCP

Use the Flaq MCP server to generate a 1:1 image of a cinematic red fox in a snowy forest at sunrise. Choose a supported text-to-image model, use one idempotency key for the submission, and poll the returned task until it succeeds or fails.

Рабочий процесс

From Model Discovery to Finished Media

The MCP server uses an asynchronous task workflow. A successful submission means the task was accepted; the agent must continue polling until it succeeds or fails.

01

Discover Models

Call list_models to find available image and video models and their supported operations.

02

Submit a Task

Call text_to_image, image_to_image, or generate_video once and save the returned taskId.

03

Poll the Result

Call get_task_result with the task ID and media type until processing changes to succeed or failed.

04

Use the Output

When the task succeeds, read the generated image or video links from the urls array.

Send a UUID as idempotency_key with every paid submission. If an agent retries, reuse the same key instead of creating another charged task. If you already have a taskId, continue polling that task rather than submitting again.

Инструменты

MCP Tools for Agent-Controlled Generation

The server keeps discovery, submission, and polling separate so agents can choose a compatible model, avoid duplicate submissions, and wait for asynchronous media generation safely.

list_models
Ключ API не нуженБез списания

Discover available models

list_models returns the current model catalog and the operations supported by each image or video model.

text_to_image
Требуется ключ APIСписывает кредиты

Generate an image from text

text_to_image accepts a prompt and optional model, ratio, resolution, seed, translation, and idempotency settings.

image_to_image
Требуется ключ APIСписывает кредиты

Edit or transform an image

image_to_image accepts a prompt and a public HTTPS image URL, with optional additional image references and generation settings.

generate_video
Требуется ключ APIСписывает кредиты

Generate video from text or an image

generate_video creates text-to-video when image_url is omitted and image-to-video when a public image URL is provided.

get_task_result
Требуется ключ APIБез списания

Poll an asynchronous task

get_task_result returns processing, succeed, or failed and includes generated URLs when the task completes successfully.

Быстрый старт

Verify the MCP Endpoint with cURL

These direct JSON-RPC requests are useful for checking the endpoint before configuring an agent. Listing models is free; submitting a generation task consumes credits.

Confirm that the public MCP endpoint responds and returns the current model catalog.

1. List models without an API Key

curl -sS 'https://api.flaq.ai/mcp' \  -X POST \  -H 'Content-Type: application/json' \  -H 'Accept: application/json, text/event-stream' \  -d '{    "jsonrpc": "2.0",    "id": 1,    "method": "tools/call",    "params": {      "name": "list_models",      "arguments": {}    }  }'

Replace the API Key and UUID placeholders before running this paid request.

2. Submit a text-to-image task

curl -sS 'https://api.flaq.ai/mcp' \  -X POST \  -H 'Content-Type: application/json' \  -H 'Accept: application/json, text/event-stream' \  -H 'Authorization: Bearer <YOUR_API_KEY>' \  -d '{    "jsonrpc": "2.0",    "id": 2,    "method": "tools/call",    "params": {      "name": "text_to_image",      "arguments": {        "prompt": "A cinematic red fox in a snowy forest at sunrise.",        "model_name": "gpt-image-2",        "aspect_ratio": "1:1",        "resolution": "1k",        "idempotency_key": "<YOUR_UUID>"      }    }  }'
  • Replace the task ID with the taskId returned by the submission response.
  • If the result is processing, call get_task_result again.
  • Polling does not consume additional credits.

3. Poll the task result

curl -sS 'https://api.flaq.ai/mcp' \  -X POST \  -H 'Content-Type: application/json' \  -H 'Accept: application/json, text/event-stream' \  -H 'Authorization: Bearer <YOUR_API_KEY>' \  -d '{    "jsonrpc": "2.0",    "id": 3,    "method": "tools/call",    "params": {      "name": "get_task_result",      "arguments": {        "task_id": "<YOUR_TASK_ID>",        "media_type": "image",        "wait_timeout_sec": 20      }    }  }'

MCP tool responses wrap the generation result as a JSON string in result.content[0].text. Parse that text value to read status, taskId, errorCode, and urls.

Справочник

Default Models and Connection Limits

Call list_models for the current catalog instead of relying on a hard-coded model list. When model_name is omitted, Flaq selects the defaults below for each workflow.

Модели по умолчанию

Text to image
gpt-image-2
Image to image
gpt-image-2-edit
Text to video
seedance-v2.0-mini-text-to-video
Image to video
seedance-v2.0-mini-image-to-video

Важные ограничения

  • Each API Key can have up to two generation submissions in progress at the same time.

  • Prompts can contain up to 4,000 characters.

  • Image inputs must be publicly accessible HTTPS URLs; local file paths are not supported.

  • A polling call waits up to 50 seconds by default and should remain below the client tool timeout.

Submitting text_to_image, image_to_image, or generate_video consumes credits. list_models and result polling do not consume credits.

The MCP server does not currently support first-and-last-frame video, reference-to-video, or video editing workflows.

Устранение неполадок

Flaq MCP Frequently Asked Questions

Start Building Media Workflows with Flaq MCP

Create an API Key, connect your preferred agent, and let it discover the image and video models available through Flaq.

Обзор моделей

Generated media links and model availability may change over time. Use list_models at runtime and store the taskId returned by every submission.