Skip to main content
Glama

AgentScope Media MCP

Python MCP 服务:通过 AgentScope Platform 调用语音、图片、ASR 和视频模型。无网页、无本地模型、无账户 JWT 接口。

状态:开发版本。已开始真实接口联调,逐项结果见 验证记录。已发布到 PyPI,版本 0.1.0。

本地启动

安装 uv 后,在项目目录运行:

uv sync --locked
uv run agentscope-media-mcp

stdio 服务由 MCP 客户端启动;直接在终端运行时等待协议输入属于正常行为。 密钥通过启动进程的 AGENTSCOPE_API_KEY 环境变量提供,不要写进源码。 未填写密钥仍可以初始化和列出工具,调用媒体接口时会返回配置错误。

本地客户端配置:

{
  "mcpServers": {
    "agentscope-media": {
      "command": "uv",
      "args": ["--directory", "/home/fanxing/repos/agentscope-media-mcp", "run", "--locked", "agentscope-media-mcp"],
      "env": {"AGENTSCOPE_API_KEY": "<填写模型API Key>"}
    }
  }
}

Related MCP server: MiniMax MCP JS

模型与工具

工具

模型/功能

list_models

九个模型的静态清单,可按能力筛选

synthesize_speech

qwen-audio-3.0-tts-flash / qwen-audio-3.0-tts-plus

generate_image / edit_image

qwen-image-3.0

transcribe_audio

qwen-audio-3.0-asr-flash

generate_video

happyhorse-1.1-t2v / i2v / r2v、wan3.0-video

edit_video

happyhorse-1.0-video-edit

upload_media

将 base64 data URL 上传到平台

get_task

根据上游 task_id 查询结果

TTS 必须指定该模型支持的 voice,避免猜测音色。Wan 文本输入已通过一次真实生成测试,其他输入模式尚未验证。 480P、720P、1080P 可作为视频分辨率输入;实际可用性以具体模型和网关验证为准。 图片尺寸使用 1024*1024 形式,不保证任意尺寸都被模型接受。

调用流程

  • 配音:选择 Flash 或 Plus,填写文本和有效 voice ID,调用 synthesize_speech。

  • 图生视频:先取得公共图片 URL,再指定 happyhorse-1.1-i2v 和 image_url。

  • 参考生视频:指定 happyhorse-1.1-r2v 和 reference_urls,可在提示词中引用 [Image 1]。

  • 视频任务提交后保存 task_id,间隔查询 get_task,直到成功或失败。

  • 图片、音频结果直接返回媒体 URL 或文本;如果上游返回任务,则保留任务编号。

服务不下载任意 URL,不读取调用者电脑上的路径,不永久保存作品。 API 返回链接可能过期,需要由调用者及时保存。 生成 POST 请求不自动重试;submission_unknown 表示受理结果不明,不应盲目重复生成。

配置

环境变量

默认值

AGENTSCOPE_API_KEY

无;生成请求必需

AGENTSCOPE_MEDIA_BASE_URL

https://platform.agentscope.io/api/v1

AGENTSCOPE_HTTP_CONCURRENCY

4

AGENTSCOPE_CONNECT_TIMEOUT

15 秒

AGENTSCOPE_READ_TIMEOUT

180 秒

AGENTSCOPE_UPLOAD_MAX_BYTES

10485760(10 MiB)

并发限制是同时进行的 HTTP 请求数,不是上游运行中的视频任务数。 不连接 Credits、定价和用户信息接口,无费用审批。 媒体 HTTP 客户端使用直连,不继承本机代理变量;不会修改系统或其他应用的网络配置。

测试和打包

uv sync --locked --group dev
uv run pytest
uv run ruff check .
uv build
uv run python scripts/check_wheel.py

魔搭部署

已发布到 PyPI。魔搭选择 uvx,固定已验证版本:

{
  "mcpServers": {
    "agentscope-media": {
      "command": "uvx",
      "args": ["agentscope-media-mcp==0.1.0"],
      "env": {"AGENTSCOPE_API_KEY": "<部署时填写>"}
    }
  }
}

魔搭托管运行 stdio 进程并提供远程连接,程序本身不监听 HTTP 端口。 平台的密钥填写和托管限制需实际部署验证。

请求字段参考及验证边界见 接口说明。

Available Tools

9 tools
edit_imageC

Edit reference images using qwen-image-3.0 and public image URLs.

Inputs: prompt (required), image_urls (required), seed, size. Returns: object

edit_videoC

Submit HappyHorse video editing with up to five reference images; returns task_id.

Inputs: prompt (required), video_url (required), seed, resolution, +1 more. Returns: object

generate_imageC

Generate an image with qwen-image-3.0. Optional size uses width*height syntax.

Inputs: prompt (required), seed, size, negative_prompt. Returns: object

generate_videoA

Submit video generation; query task_id later. i2v needs image_url; r2v needs 1–9 reference_urls. Wan text-only mapping passed one smoke test; other modes are unverified. Omit optional parameters to use upstream defaults.

Inputs: model (required), prompt (required), seed, ratio, +4 more. Returns: object

get_taskB

Query an upstream task using the same API Key. Keep polling explicitly at intervals; pending/running is not generation success. UNKNOWN may mean the task expired.

Inputs: task_id (required). Returns: object

list_modelsB

List all nine configured models; no credentials or network access required.

Inputs: capability. Returns: object

synthesize_speechC

Synthesize speech. Supply a voice ID supported by the chosen model; none is guessed.

Inputs: text (required), voice (required), model, format, +2 more. Returns: object

transcribe_audioC

Transcribe a public audio URL using qwen-audio-3.0-asr-flash.

Inputs: audio_url (required), language, enable_itn. Returns: object

upload_mediaA

Upload base64 image/audio/video data (default decoded limit 10 MiB). Returns media URLs. Prefer existing public URLs for large files; local paths are not accepted.

Inputs: data_url (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool targets a distinct resource+action (models, image gen/edit, video gen/edit, TTS, ASR, upload, task polling). The generate_image/edit_image and generate_video/edit_video pairs could superficially be confused, but descriptions clarify the difference (from-scratch vs reference-based).

    Naming Consistency5/5

    All nine tools follow a consistent snake_case verb_noun pattern (list_models, generate_image, edit_video, synthesize_speech, transcribe_audio, get_task, upload_media). No mixed conventions.

    Tool Count5/5

    Nine tools is well-scoped for a media generation/editing server, with one tool per major capability plus task polling and media upload. No redundancy or dead weight.

    Completeness4/5

    Surface covers the full media lifecycle: generation, editing, upload, transcription, TTS, and async task polling. Minor gaps remain — no way to discover valid voice IDs (required by synthesize_speech but 'none is guessed'), and no task cancel/list operations.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers