• Docs
  • API reference
  • SDKs & tools
  • Models
  • Changelog
Sign inGet an API key
DocsAPI referenceSDKs & toolsModelsChangelog

TypeScript SDK

OverviewInstallationClientGenerating mediaTasks and pollingErrors

CLI

OverviewLogging inCommands

Integrations

ConvexTanStack Start

Agents

MCP serverllms.txtSkillsAgent prompt
  1. SDKs & tools
  2. /
  3. Agents

MCP server

Connect an MCP client to https://api.mynth.io/mcp with OAuth or an API key to generate images and video, manage tasks, and configure Mynth.

PreviousTanStack StartNextllms.txt

On this page

ConnectConnect with an API keyToolsArgumentsHow generation worksImages from your machineErrorsNext steps

Mynth runs a remote MCP server at https://api.mynth.io/mcp. It uses Streamable HTTP, runs statelessly, and supports both MCP 2026-07-28 and 2025 clients.

Connect

Sign in with your Mynth account through OAuth. When your client connects for the first time, it opens a browser window to approve access. There is no key to copy or store.

Codex reads ~/.codex/config.toml, Cursor reads .cursor/mcp.json, and VS Code reads .vscode/mcp.json.

claude mcp add --transport http mynth https://api.mynth.io/mcp

In Claude on the web or desktop, open Settings, go to Connectors, choose Add custom connector, and enter https://api.mynth.io/mcp.

Connect with an API key

For CI or headless agents where a browser login is not practical, pass a mak_ API key in the Authorization header instead of using OAuth:

claude mcp add --transport http mynth https://api.mynth.io/mcp --header "Authorization: Bearer $MYNTH_API_KEY"

The key's scopes decide which tools the server advertises and allows. OAuth signs in as the account owner and sees every tool. Public access tokens (pat_) are not accepted on /mcp.

Tools

ToolWhat it doesScope (API key)
get_accountReturns the account, auth details, and available balanceAny
get_balanceReturns the account balancemanage
list_modelsLists image and video models with pricing and capabilitiesAny
generate_imageCreates an image generation taskgenerate
estimate_image_costEstimates an image generation request without charginggenerate
upload_imagesUploads base64-encoded images and returns their URLsgenerate
rate_imageCreates an image content rating taskgenerate
describe_imageCreates an alt text generation taskgenerate
review_imageCreates an image quality review taskgenerate
remove_backgroundCreates a background removal taskgenerate
upscale_imageCreates an image upscaling taskgenerate
generate_videoCreates a video generation taskgenerate
estimate_video_costEstimates a video generation request without charginggenerate
list_tasksLists recent tasksgenerate
get_taskReturns the full record for one taskgenerate
wait_for_taskPolls a task until it settles or the timeout elapsesgenerate
list_destinationsLists storage destinationsmanage
get_destinationReturns one destination by idmanage
create_destinationCreates a storage destinationmanage
update_destinationUpdates a storage destinationmanage
delete_destinationDeletes a storage destinationmanage
test_destinationSends a test write to a destinationmanage
create_webhookCreates a webhook endpointmanage
update_webhookUpdates a webhook endpointmanage
delete_webhookDeletes a webhook endpointmanage
list_api_keysLists API keys on the accountkeys
create_api_keyCreates an API key and returns the raw key oncekeys
update_api_keyUpdates an API key's scopes or spending limitkeys
delete_api_keyDeletes an API key immediatelykeys

Arguments

Tools that stand for a REST endpoint with a body take that body as request. The request object is exactly the REST body, so the API reference documents every field. Task-creating tools also take an optional idempotency_key:

{
  "request": { "model": "black-forest-labs/flux.2-pro", "prompt": "A lighthouse at dusk" },
  "idempotency_key": "lighthouse-1"
}

The same key with the same request returns the original task instead of creating and charging a second one, and the result then carries replayed: true. The estimate tools take request alone.

  • Create tools (create_destination, create_webhook, create_api_key) take the REST body directly.
  • Update tools take { id, <resource> }, where the resource is the full new configuration: destination, webhook or api_key.
  • get_task and wait_for_task take task_id. wait_for_task also takes timeout_seconds.
  • List tools return { items: [...] }. Delete tools return { id, deleted: true }.

How generation works

Every generation and analysis tool creates a task and returns the task_id and estimated_cost at once. Call wait_for_task with that task_id to collect the output.

wait_for_task polls for up to 55 seconds (default 45) and returns the full result as soon as the task settles. If the task is still running when the timeout elapses, wait_for_task returns the current status instead of failing so the agent can call it again. When the client sends a progress token, each poll is reported as a progress notification.

Costs are reserved on your balance when the task is created, just like the REST API. estimate_image_cost and estimate_video_cost are free. A 402 (insufficient_balance) means the account needs a top-up.

Images from your machine

upload_images accepts base64-encoded image data and returns URLs, served for one day, that you can pass to inputs. Keep one call under about 24 MB of images and split larger batches across calls. If an image is already at a public URL, pass that URL straight into inputs instead of uploading it.

Errors

A tool error carries the same code, message and validation issues as the REST API, in structuredContent.error. Arguments that do not match the tool's schema are rejected by the MCP layer before the tool runs, with a plain-text validation error. See Errors for every error code.

Next steps

  • Authentication: mak_ keys, scopes, and spending limits.
  • Tasks: statuses, partial failure, and file lifetimes.
  • Skills: the Mynth skill for coding agents.
  • llms.txt: read these docs as plain markdown.