Skip to main content
Glama

TopMediAi-MCP

English · 日本語 · 한국어 · Deutsch · Français · Español · Italiano · 繁體中文

A local TypeScript stdio MCP server with Codex and Cursor integration for TopMediai. Version 1.0.0 supports image generation, image-to-image, music, video, mixed-media reference video, text-to-speech (TTS), and speech-to-speech (STS). It includes model catalogs, cost estimates, budget validation, task recovery, and image/audio/video previews. Denoising, voice cloning, and music videos are not available.

Generation uses the signed-in account's entitlements. Query the model catalog and obtain an exact quote before submitting, then apply the user's budget and the current conversation's confirmation preferences. Uploading reference files requires permission for external storage; uploaded URLs may be publicly accessible. See Data and privacy.

Installation and sign-in

Requires Node.js >= 22.18 and access to the official connection page. The Codex installer also requires the Codex CLI; the Cursor installer does not. The browser and MCP server must run on the same computer. Windows system credential storage has been tested; complete macOS/Linux client flows still require acceptance testing. Linux requires a desktop D-Bus session and a Secret Service provider such as GNOME Keyring. Use npm.cmd in PowerShell; other supported shells can use npm.

Run from the project directory:

npm.cmd ci
npm.cmd test
npm.cmd run install:codex

The plugin appears in Codex as TopMediAi-MCP, with installation identifier topmediai-mcp@topmediai-local.

For Cursor, use npm.cmd run install:cursor after installing dependencies. Add -- --project './my-project' for a project-only installation; otherwise it installs globally. See the Cursor guide for configuration, backups, and client limitations.

Installation creates a local plugin/.mcp.json without storing tokens or cookies in the plugin. This file contains local executable paths and must not be committed or distributed. Reinstall after moving the project or switching computers.

Call get_service_status in the current chat. If sign-in is required, use start_login, verify the account on the official page, and approve the connection. Keep calling wait_for_login with the same login_id until credentials are saved or the session ends. After saving, call get_service_status and get_balance in the same chat and resume the original request. Restarting Codex or the MCP server is not required.

Fallback CLI commands:

npm.cmd run login
npm.cmd run login:status
npm.cmd run logout

Sign-in waits for up to ten minutes. Private connection links are hidden by default. If the browser cannot open automatically, use --show-private-link locally. This link is for the local browser only; never share it, screenshot it, or paste it into chat.

The installation self-check only proves that a separate MCP process can start. It does not prove that the current chat has loaded its tools or that account credentials are valid. If tools are missing, check plugin enablement, refresh the plugin package, and reconnect MCP; start a new chat if needed. Never attribute another generator's output to TopMediai.

Related MCP server: Image Context Runtime

Environment and configuration

The public installer, server, and CLI commands support production only, with built-in production website and API endpoints. New users do not need to create .env, select an environment, enter hostnames, or copy tokens. Optional overrides are documented in .env.example. See Production installation and configuration.

  • Production uses direct APIs by default. Service addresses must be valid HTTPS origins; explicitly empty required values are rejected. The legacy gateway is enabled only by an explicit TOPMEDIAI_PRODUCTION_GATEWAY_HOST and has limited capabilities.

  • Installation reads shell configuration and freezes service addresses, environment, and upload settings. Set overrides before installation. See the example comments for direct startup and sign-in CLI behavior.

  • Normal installations use private saved credentials. TOPMEDIAI_TOKEN is an explicit override and must never appear in public files, screenshots, or issue reports. Standard installation clears this override to avoid inheriting old credentials.

  • Credentials are saved in Windows Credential Manager, macOS Keychain, or Linux Secret Service and reread before every tool call. get_service_status.credential_source is system-store when a saved credential is loaded; credential_storage identifies the system store. Account switches select the corresponding task directory; requests already in flight retain their original account.

  • Generation and uploads need no extra feature switches. Uploads still require authorization for specific files and a dedicated directory. After changing endpoints, upload settings, or code, refresh the installed configuration and plugin package, then reconnect MCP.

  • Local logout deletes and verifies removal of the saved system credential. If verification fails, the outcome remains unconfirmed. It does not sign out the website, revoke server-side tokens, or cancel submitted tasks.

Upgrading from JSON credential storage: reconnect your account after upgrading. Old JSON credentials are not read, migrated, or automatically deleted. The former credential directory is now used only for login-lock metadata; handle any legacy secret files separately and never include them in a release. If the system store is locked, denied, or unavailable, resolve the system prompt or service issue; there is no plaintext fallback. Enter your computer password only in the operating system's dialog, never in chat. Codex and Cursor running as the same OS user share the production credential; signing out or switching accounts affects subsequent calls in both clients. System storage does not isolate all processes running as that user.

Refresh configuration with:

npm.cmd run setup:plugin

After updating the plugin, verify get_service_status.server_version. Do not assume the entire application needs a restart.

Client identity is configured per launch with MCP_CLIENT_SOURCE: 6 for Codex, 7 for Claude Code, and 8 for Cursor. Unknown clients omit the business source header. Codex/Cursor installers set their own values; the existing TOPMEDIAI_SOURCE request-body channel remains separate. Reinstall or refresh launch settings and reconnect after updating. See Client identity.

Tools and creative workflow

Purpose

Main tools

Status and sign-in

get_service_status, start_login, wait_for_login, cancel_login

Account and plans

get_balance, review_generation_plan

Images

list_image_models, estimate_image_cost, generate_image, get_image_task

Image references and previews

upload_reference_image, preview_image_task

Music

list_music_models, estimate_music_cost, generate_music

Video

list_video_models, estimate_video_cost, generate_video, upload_reference_media, preview_video_task

Speech

list_voices, get_voice_detail, list_tts_models, list_sts_models, get_speech_entitlements, upload_speech_audio, estimate_tts_cost, generate_tts, estimate_sts_cost, generate_sts

Multimedia status and playback

get_generation_capabilities, get_generation_task, preview_audio_task

The actual loaded tool list is authoritative. When no model is specified, use the default returned by the current catalog; do not switch models based on price or style. Read parameters, reference limits, voice languages, and capabilities from that catalog. A listed model is not proof that quoting or generation is available.

Video operations with an audio switch default to sound on when generate_audio is omitted. Set false for an explicit silent-video request. Models without a switch retain provider behavior; forced-audio models cannot be muted. Keep catalog, quote, and submission settings consistent and requote after changes.

Obtain a valid quote before submitting with a stable request_id and an explicit budget. review_generation_plan summarizes quotes for the current flow. By default, confirmation is required for designated high-price models or an estimated flow total strictly above 1000 credits. Explicit user preferences take precedence. Reassess expired quotes, changed inputs, or higher prices. The tool does not replace user consent, and a local budget is not a server-enforced spending cap.

Timeouts, cancellations, disconnects, and unknown submission outcomes do not prove that generation or billing did not occur. Preserve the original task identifiers, check the account's history, and never automatically regenerate. If an account or configuration change hides an old task, check its history first.

Prefer image previews after completion. For expired image links, query the original task with get_image_task({request_id, refresh_result:true}); link renewal is not guaranteed. Deliver audio through a player or named links and video through an inline player with named original links. Distinguish preview failures from generation failures, and deliver successful artifacts even when other stages fail.

Video ad skills

Codex and Cursor include two skills for making video ads. Refresh the plugin or rerun the Cursor installer after updating, then check that both skills appear in the client.

  • ugc-video-ad uses product photos and selling points to draft or produce presenter, unboxing, and review videos. You can ask for a script or prompt only.

  • clone-video-ad analyzes a reference ad and can hand off an adapted concept to ugc-video-ad for production. Its optional depth workflow sets up local dependencies and a model on first use. See reference media upload requirements before using a depth clip as a reference.

Video preview

When video completes, call preview_video_task with the original task_handle to show a read-only inline player and include named original video links. The player supports click-to-play, pause, seeking, volume, fullscreen, and retry. Show successful versions for partial results without reopening unchanged cards.

Preview reads saved account-scoped results without backend polling, local media downloads, generation, spending, or stored-task changes. It loads media only from approved production video CDN origins without account credentials. Unsupported UI, formats, or playback failures retain original links and never justify regeneration. Browser navigation, screenshots, and downloads require explicit user requests.

Refresh the plugin package and reconnect MCP after updating. Verify server_version=1.0.0, 35 tools, and preview_video_task. Card display and fullscreen depend on host support.

Uploading reference media

No extra upload switch is required. Select only user-authorized files from a dedicated directory; never broaden access to personal or credential directories. For example:

$env:TOPMEDIAI_UPLOAD_ROOT = 'C:\path\to\upload-inputs'
npm.cmd run setup:plugin

Create the directory and place authorized files there, then refresh plugin configuration and reconnect MCP.

  • Images: PNG/JPEG, up to 5 MiB. Use the returned reference_image_id; never guess IDs or reuse them across accounts. See Image uploads and references.

  • Video references: MP4/WAV/MP3. Requires the dedicated directory and local FFmpeg/FFprobe. Read count, size, duration, and combination limits from the operation's model catalog. Uploaded IDs and ordering are bound to the quote.

  • STS source audio: MP3/WAV/AAC/FLAC/AIFF/OGG, up to 50 MiB and 300 seconds. Requires the dedicated directory and local FFmpeg/FFprobe. See TTS and STS guide.

Local validation and metadata removal do not make cloud files private. Upload URLs, result links, and full local reports must not be copied directly into public issue reports.

Local diagnostics and shared reports

# Read-only queries; does not submit generation
npm.cmd run diagnose
# Also create a redacted copy for sharing
npm.cmd run diagnose -- --share-report

Console output contains a summary by default. The full report at .data/diagnostic-runs/latest-production.json is private. The shared copy at .data/diagnostic-runs/shared-production.json hides account identifiers, prompts, cost amounts, media URLs, private links, and local paths. Inspect the shared copy before sharing; renaming the full report does not redact it.

Normal MCP results still provide real balances and usable result links. Diagnostic redaction applies only to shared reports and console summaries.

Development and release checks

npm.cmd test
npm.cmd run check:public
npm.cmd run check:public -- --build
npm.cmd run prepare:public

prepare:public creates an independent public snapshot from reviewed files and initializes a local Git repository without inheriting the original history. Publish only a snapshot that passes checks. Editing current files does not remove earlier history. See Public release checks.

License

Original project code is licensed under the MIT License, copyright TopMediai. Third-party code and dependencies retain their respective licenses and copyright notices.

The source license does not grant free use of TopMediai cloud services. Sign-in, generation, uploads, and other services remain subject to applicable account entitlements, pricing, and service terms. The TopMediai name, trademarks, and brand icon are excluded from this project's MIT grant and require appropriate authorization for use.

Available Tools

35 tools
cancel_loginA

Cancel the current start_login attempt only when the user asks to cancel or stop. Does not remove saved credentials, undo completed login, log out the website or cancel paid tasks.

Inputs: login_id (required).

estimate_image_costA

Estimate image credits and save a 10-minute quote bound to the exact prompt, model options and uploaded reference IDs. Unless the user specified a model, pass default_model_type from list_image_models. Select the model’s image operation and reference limits from that catalog. Does not submit generation.

Inputs: quality (required), model_type (required), description (required), number, +3 more.

estimate_music_costA

Save a 10-minute music quote bound to exact input. Unless the user specified a model, pass default_mv from list_music_models. Returns alternative entitlement costs for internal budgets; show only universal credits from display.estimated_costs, never specialized credits or alternative-branch wording. Does not generate.

Inputs: mv (required), style (required), title, action, +2 more.

estimate_sts_costC

Save an STS quote using the authoritative speech backend preview. Show only display.estimated_costs as estimated credits, including when the selected entitlement uses characters. Raw costs retain the selected entitlement for budgets; do not show billable characters/seconds as the price. Does not synthesize.

Inputs: voice_id (required), speech_asset_id (required), stability, similarity, +1 more.

estimate_tts_costB

Estimate TTS locally using backend text/SSML counting rules, account multipliers and current voice/account entitlements from existing APIs. Final settlement is performed by the synthesis backend. Show only display.estimated_costs as estimated credits, including when the selected entitlement uses characters. Raw costs retain the selected entitlement for budgets; do not show billable characters/seconds as the price. Does not synthesize.

Inputs: text (required), accent (required), voice_id (required), pitch, +8 more.

estimate_video_costA

Save a 10-minute video quote bound to exact input. Unless the user specified a model, pass default_model_type from list_video_models. Returns alternative entitlement costs for internal budgets; show only universal credits from display.estimated_costs, never specialized credits or alternative-branch wording. Does not generate.

Inputs: mode (required), content (required), duration (required), model_type (required), +9 more.

generate_imageA
Idempotent

Submit a quoted image request in the configured environment and consume that account credits. Requires a valid quote, stable request_id and maximum estimated credit budget. Identical retries return the saved task; uncertain submissions are never retried automatically.

Inputs: quote_id (required), request_id (required), max_credits (required).

generate_musicA
Idempotent

Submit one quoted music generation. Requires paid and business switches, a stable request_id and budgets for every quoted resource. Budgets are local quote checks, not backend hard caps. Never automatically retry uncertain submission.

Inputs: budget (required), quote_id (required), request_id (required).

generate_stsA
Idempotent

Generate STS synchronously: this call waits for audio and returns the completed result with model and available voice name. After success call preview_audio_task with the returned task_handle to show the inline player, and include a named original audio link. No extra get_generation_task polling is required. Label this as the converted result, not the source audio. Requires a quote, stable request_id and budget for the selected credits or characters. Timeout or cancellation may leave backend synthesis running; unknown submissions are never retried.

Inputs: budget (required), quote_id (required), request_id (required).

generate_ttsA
Idempotent

Generate TTS synchronously: this call waits for audio and returns the completed result with model and available voice name. After success call preview_audio_task with the returned task_handle to show the inline player, and include a named original audio link. No extra get_generation_task polling is required. The card uses article_title and labels this as synthesized speech. Requires a quote, stable request_id and budget for the selected credits or characters. Timeout or cancellation may leave backend synthesis running; unknown submissions are never retried.

Inputs: budget (required), quote_id (required), request_id (required).

generate_videoA
Idempotent

Submit one quoted video generation. Requires paid and business switches, a stable request_id and budgets for every quoted resource. Budgets are local quote checks, not backend hard caps. Never automatically retry uncertain submission.

Inputs: budget (required), quote_id (required), request_id (required).

get_balanceA

Get the configured TopMediai account tp_all entitlements. Membership queries may initialize first-use entitlements.

Inputs: no named parameters.

get_generation_capabilitiesA
Read-only

Inspect implementation readiness and approved route availability for Music, Video, TTS, STS, denoise, clone and MV. Does not call a backend.

Inputs: no named parameters.

get_generation_taskA
Read-only

Read an account-scoped task_handle created by this MCP. For music and video, wait poll_after_seconds (normally 20 seconds) after each successful status query before querying this task again. Earlier or concurrent calls return cached:true with saved state and the remaining wait, without another backend request. Stop normal polling on completed or failed. Synchronous speech reads saved local results without HTTP polling; successful speech calls already return audio. Music/video results resolve supported encoded addresses into artifacts[].url. When completed audio is available, call preview_audio_task once to show all successful versions in a player, and include named original audio links. Do not reopen the same card for unchanged polls. Deliver every successful artifact with model, voice where applicable, estimated consumption with its credit type, and known actual output duration. Do not mention missing actual consumption. When completed video is available, call preview_video_task once to show a video player, and include named original video links. Do not reopen unchanged cards. Browser navigation, screenshots and media downloads require an explicit user request. Never accepts arbitrary backend IDs. Uncertain submissions require website history reconciliation; no generation is retried.

Inputs: task_handle (required).

get_image_taskA
Read-only

Query a task created by TopMediAi-MCP using its request_id. After a successful status query, wait poll_after_seconds (normally 20 seconds) before querying this task again. Earlier or concurrent calls return cached:true with saved state and the remaining wait, without another backend request. Different tasks run independently without holding the store lock during network requests. Stop normal polling on completed or failed. Returns result URLs and image resource links. When images are available use preview_image_task and include clickable original links. Does not submit or charge for another generation.

Inputs: request_id (required), refresh_result.

get_music_entitlementsA

Query music entitlements. Display only universal credits from display.balances; music_credits are internal settlement data and must not be shown even when nonzero. The backend may initialize first-use entitlements.

Inputs: no named parameters.

get_service_statusA
Read-only

Check the environment, refreshed credential source, login guidance and whether generation is enabled. A configured token is not proof of a valid backend login. Does not perform a network login or reveal credentials.

Inputs: no named parameters.

get_speech_entitlementsA

Read speech characters, universal credits and full TTS generation permission from existing membership APIs. Voice-specific characters and multipliers are checked during a TTS estimate.

Inputs: no named parameters.

get_video_entitlementsA

Query video entitlements through the membership backend. Display current universal credits only; legacy video_units are internal settlement data and must not be shown even when nonzero. May initialize first-use entitlements.

Inputs: no named parameters.

get_voice_detailA
Read-only

Read accent and emotion metadata for a public voice previously returned by list_voices in this session. Does not authorize or perform TTS.

Inputs: voice_id (required).

list_image_modelsA
Read-only

List the complete Web image model catalog and per-model capabilities, with live price rows in each model.pricing and independent pricing_status. When the user has not specified a model, use the returned default_model_type. Missing prices never hide models; use an exact quote before generation.

Inputs: no named parameters.

list_music_modelsA
Read-only

List the complete current Web music catalog with capabilities and independent live pricing_status; prices never filter model visibility. When the user has not specified a model, use the returned default_mv. Current mv values: v6-pro, v6-wild-pro, v6-mini.

Inputs: no named parameters.

list_sts_modelsB
Read-only

List STS channels and parameters. Select a public voice_id using list_voices with operation=sts. Generation is synchronous and returns the audio directly.

Inputs: no named parameters.

list_tts_modelsA
Read-only

List TTS channels and parameters. Select a public voice_id using list_voices with operation=tts. Generation is synchronous and returns the audio directly.

Inputs: no named parameters.

list_video_modelsA
Read-only

List the complete current Web video catalog with capabilities and independent live pricing_status; prices never filter model visibility. When the user has not specified a model, use the returned default_model_type. Select text_to_video (default), image_to_video, image_to_video_start_end, reference_to_video or omni_reference_to_video. Variable duration models require the backend duration protocol ID and real_duration in seconds from capabilities. Select generate_audio to match the quote.

Inputs: operation, generate_audio.

list_voicesB
Read-only

List public voices for operation tts (default) or sts. Uses bounded local pagination. Read get_voice_detail, then obtain an exact speech quote before generation.

Inputs: lang, page, operation, page_size, +1 more.

preview_audio_taskA
Read-only

Show generated music (vocal or instrumental) or speech from an owned locally saved task in an inline player. Call once when completed audio becomes available; shows separate versions, playback/seek controls, retry and original links. Playback starts only on user click. Reads saved results only: no backend polling, media download, generation, spending or configuration changes. Always also include named original audio links for hosts without UI support.

Inputs: task_handle (required).

preview_image_taskA
Read-only

Show already generated images from a locally saved task in a read-only preview card with load/error/retry/original-link controls. Call after get_image_task returns images. Does not query the backend, download media, submit generation or spend credits. Host UI support is required; always also provide original result links.

Inputs: request_id (required).

preview_video_taskA
Read-only

Show generated videos from an owned locally saved task in an inline player. Call once when completed video becomes available; includes native playback, seek, volume, fullscreen, retry and original links. Playback starts only on user click. Reads saved results only: no backend polling, media download, generation, spending or configuration changes. Always also include named original video links for hosts without UI support.

Inputs: task_handle (required).

review_generation_planA

Review the complete current creative flow before a new paid submission, using saved account-scoped quotes and submitted request IDs. Deduplicates retries, displays universal credits only, identifies configured high-price models and universal-credit totals strictly greater than 1000. Specialized entitlement costs remain internal for settlement and budgets. Use the latest explicit confirmation mode in this conversation; a new conversation defaults to conditional. Pass a returned confirmed_plan_id only after human approval of that plan here. Queries do not authorize generation or record consent. Expired/missing pending quotes must be renewed even when confirmation is off.

Inputs: steps (required), flow_id (required), submitted_steps, confirmation_mode, +1 more.

start_loginA

Start official website login on this computer and return an opaque login_id. Reuses an active attempt without opening another page. Never returns a token or private handoff link. Keep the turn active: call wait_for_login until saved or a terminal outcome, then verify status/balance and resume the original request.

Inputs: no named parameters.

upload_reference_imageA

Upload a user-authorized local PNG/JPEG for image-to-image or video first/last frames from the configured dedicated image directory to the original TopMediai upload service. May create a publicly retrievable OSS URL. Removes image metadata, limits size to 5 MiB, verifies login and returns an account-scoped reference_image_id. Upload requires a configured dedicated directory. Does not generate or debit credits; never automatically retry an uncertain upload.

Inputs: file_path (required).

upload_reference_mediaA

Upload one user-authorized local MP4 video or WAV/MP3 audio for omni reference video generation. Requires a dedicated upload directory, user authorization for the specified files and local FFmpeg/FFprobe. Validates the real container and duration, re-encodes media and removes metadata, verifies login and returns an account-scoped reference_media_id. Existing storage URLs may be public. Does not generate or spend credits; never automatically retry an uncertain upload.

Inputs: file_path (required), media_type (required), model_type.

upload_speech_audioA

Upload one externally authorized audio file from TOPMEDIAI_UPLOAD_ROOT using existing upload and STS registration APIs. Maximum 50 MiB and 300 seconds; local FFmpeg/FFprobe required. Existing upload URLs may be public. Returns a local account-scoped speech_asset_id. No synthesis or automatic retry.

Inputs: file_path (required).

wait_for_loginA
Read-only

Wait up to 25 seconds for the start_login attempt. waiting means call this tool again with the same login_id; do not end the reply or ask the user to say continue. saved means verify get_service_status/get_balance and resume the original request. Does not open a page, submit generation or retry a paid request.

Inputs: login_id (required), wait_seconds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 35 tools

    Disambiguation4/5

    Most tools are cleanly separated by resource and action (image/music/video/TTS/STS each have their own list/estimate/generate/get/preview family), and login, upload, and entitlement tools are distinct. There is minor overlap risk between get_image_task and get_generation_task, and among the several get_*_entitlements/get_balance tools, but the very detailed descriptions disambiguate them.

    Naming Consistency5/5

    Nearly every tool follows a predictable verb_noun pattern with resource-qualified names (list_image_models, estimate_video_cost, generate_music, preview_audio_task, get_voice_detail). The convention is applied uniformly across login, upload, estimation, generation, and preview categories.

    Tool Count3/5

    35 tools is heavy and above the comfortable range, though the breadth of features (five media types each with list/estimate/generate/get/preview, plus login and multiple upload flows) partly justifies it. Each tool nominally earns its place, but the surface is large enough to feel overwhelming.

    Completeness4/5

    Coverage is strong: login lifecycle, entitlements/balance, model catalogs, cost estimation, generation, task polling, previews, and uploads are all present for every supported medium. Minor gaps exist (no explicit logout/credential removal or generation-cancellation tool), which agents can work around.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables local image generation control and storyboard planning within Codex, supporting continuous image editing, formal image writing, video prompt management, and user-configured video connectors.
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables Codex to run image generation and inspection as durable, restart-reconcilable local jobs that keep provider-returned media behind the tool boundary and hand back only bounded text, hashes, relative references, and Job IDs. It also supports idempotent submission, job history, and an offline deterministic mock provider for validating transport and persistence behavior without spending API credits.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Codex image generation and inspection workflows to run as durable local jobs while keeping provider media bytes outside the public MCP boundary and returning only bounded text handoffs, hashes, relative references, and Job IDs. It supports idempotent submission, restart recovery, an offline mock provider, and optional OpenAI-backed generation or inspection with artifacts written to configured workspace paths.
      MIT