Skip to main content
Glama

agnes-2.5-flash-mcp — Image / Video (agnes-image/video-2.5-flash)

English | 中文

作者的话 / Why I built this

前段时间接触到了 Agnes 免费的图片和视频生成模型(agnes-image-2.5-flash / agnes-video-2.5-flash),实测效果不错,而且免费额度很实在。

但每次都要切到网页或拼脚本去调用,在 Cursor / Claude 这些工具里来回复制 URL 实在麻烦。本着「在多个工具里调用方便」的初衷,我把常用的生图、生视频 能力包成了这个 MCP:配好一次 Key,在任何支持 MCP 的 IDE 里一句话就能用。

顺手开源出来,分享给大家使用。欢迎提 issue / PR,一起把它打磨得更好用。


I stumbled upon Agnes's free image & video models a while ago (agnes-image-2.5-flash / agnes-video-2.5-flash) — surprisingly good, and genuinely free to try.

But switching to a web page or hand-rolling scripts every time, copying URLs back and forth between Cursor / Claude, got old fast. So I wrapped the bits I actually use — image + video generation — into this MCP: configure the key once, then just talk to your agent in any MCP-compatible IDE.

Sharing it here in case it helps you too. Issues and PRs are very welcome.


2.5-flash-only MCP edition. If you need 2.0/2.1 or agnes-video-v2.0, use agnes-mcp (MSWEIMZ) instead. This package targets only agnes-image-2.5-flash + agnes-video-2.5-flash with Flash-strict validation.

仅做 2.5-flash 专版。如需 2.0/2.1 或 v2.0,请用社区 agnes-mcp

Any MCP-compatible IDE works: Cursor / Claude Desktop / VSCode / Cline / Windsurf / Cherry Studio / Opencode.

Models & endpoints (see official docs):

  • Image: POST https://apihub.agnes-ai.com/v1/images/generations, model agnes-image-2.5-flash

  • Video: POST /v1/videos create + GET /agnesapi?video_id=&model_name=agnes-video-2.5-flash poll, model agnes-video-2.5-flash (size fixed 720P)

Related MCP server: Photo AI Studio MCP Server

Install / 安装

pip install agnes-2.5-flash-mcp
# or from source:
pip install -e .

Requires Python ≥ 3.10.

API key / 配置 Key

Recommended: put the key in your MCP client config (per-project or global), do NOT commit real keys. Priority: tool arg api_key > MCP environment.AGNES_API_KEY > system env > .env file.

{ "mcp": { "agnes-2-5-flash": { "environment": { "AGNES_API_KEY": "YOUR_KEY" } } } }

Alternatives:

setx AGNES_API_KEY "YOUR_KEY"
copy .env.example .env

Proxy note: if ALL_PROXY=socks5://... breaks httpx (socksio is not installed), keep ALL_PROXY/all_proxy empty in opencode.json.example, or use HTTP_PROXY=http://127.0.0.1:10808, or pip install "httpx[socks]" "httpcore[socks]".

Connect / 接入各 IDE (stdio)

Cursor (.cursor/mcp.json or global)

{
  "mcpServers": {
    "agnes-2-5-flash": {
      "command": "agnes-2.5-flash-mcp",
      "args": [],
      "env": { "AGNES_API_KEY": "YOUR_KEY" }
    }
  }
}

Without install: command: python, args: ["-m", "agnes_2_5_flash_mcp.server"], cwd: "<repo>/mcps/agnes", env: { "PYTHONPATH": "src" }.

Claude Desktop (claude_desktop_config.json)

Same as above.

Opencode (opencode.json, see opencode.json.example)

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "agnes-2-5-flash": {
      "type": "local",
      "command": ["agnes-2.5-flash-mcp"],
      "enabled": true,
      "environment": {
        "AGNES_API_KEY": "YOUR_API_KEY_HERE",
        "ALL_PROXY": "",
        "all_proxy": ""
      }
    }
  }
}

Without install: command: ["python", "-m", "agnes_2_5_flash_mcp.server"] with cwd pointing at mcps/agnes.

VSCode / Cline / Windsurf / Cherry Studio

Same stdio server: command=agnes-2.5-flash-mcp (or python -m agnes_2_5_flash_mcp.server), workdir mcps/agnes.

Tools / 工具一览

Video default is async: create_videoquery_video. generate_video is compat-only (blocking, may hit client timeouts).

Tool

Use

Returns

generate_image

文生图 / 图生图 / 多图合成,返回 URL (save_path 可选落盘) / text-to-image, image-to-image, compose

{ url, size, ratio, saved_to } or { b64_json, ... }

create_video

(RECOMMENDED) 异步创建视频任务 / async create

{ video_id, task_id, status }

query_video

video_id 轮询进度/结果 / poll by video_id

{ status, progress, video_url?, error? }

generate_video

(compat) 同步阻塞一键生成,仅短视频用 / sync blocking, short clips only

{ video_url, video_id, ... }

Intent routing (no extra layer needed — LLM picks by description):

  • 用户说「agnes生图 / 生成图片 / 做张图 / 文生图 / 图生图」→ generate_image

  • 用户说「生视频 / 生成视频 / 做个视频 / 首尾帧 / 参考图视频」→ create_video (+query_video)

Image spec / 图片规格 (default 2K + 16:9)

  • size: 1K (fast/cheap) / 2K (default, 16:9 ≈ 2624x1472) / 3K / 4K (max)

  • ratio: 16:9 (default) / 1:1 / 9:16 / 3:4 / 4:3 / 2:3 / 3:2 / 21:9

  • Pass images (public URL or Data URI) for image-to-image / compose; omit for pure text-to-image.

Video constraints / 视频约束 (Flash-only, validated locally)

  • size fixed 720P; seconds string "4""12" (default "5"); aspect 16:9 (default) / 21:9 / 4:3 / 1:1 / 3:4 / 9:16

  • text forbids all media; keyframe needs first/last frame ≥1; reference needs images(≤5)/audios(≤3) ≥1 with <Picture N> / <Audio N> in prompt; videos unsupported

  • generate_video default poll_interval=2s, timeout_seconds=600s; on timeout reuse video_id with query_video

Usage examples / 调用示例

  • “用 generate_image 生成一张 2K 16:9 的赛博朋克夜景壁纸”

  • “把这张图(URL)改成雨夜霓虹风格,保持构图,size 用 2K”

  • “用 create_video 生成 5 秒 16:9 的未来城市街道视频,再用 query_video 帮我轮询”

  • "Generate a 5s 16:9 future-city video via create_video, then poll with query_video"

Test / 测试

python -m pytest tests -q

tests/test_validation.py is pure-local (no API cost).


中文说明

本包是 2.5-flash 专版:只支持 agnes-image-2.5-flashagnes-video-2.5-flash,自带 Flash 强校验(size must be 720P / images≤5 / audios≤3 / videos不支持)。视频默认走异步 create_video + query_video,避免 generate_video 阻塞导致 Cursor/Claude 60s 超时。工具描述首行已内置「生图 / 生视频」中文触发词, Agent 会自动选工具,无需额外路由层。

安装 pip install agnes-2.5-flash-mcp,Key 写入 MCP 配置 environment.AGNES_API_KEY(见 opencode.json.example),重启即生效。

最初就是自己用着方便做的,现在分享出来,希望对你也有用。

Available Tools

4 tools
create_videoA

Create an async agnes-video-2.5-flash task (RECOMMENDED). Returns video_id; poll with query_video.

中文触发:当用户说「生视频 / 生成视频 / 做个视频 / 图生视频 / 首尾帧 / 参考图视频」时优先调用此工具(异步默认,避免IDE超时)。 Trigger: agnes generate video (async) / text-to-video / image-to-video / keyframe.

mode text: pure text (no media). keyframe: first_frame and/or last_frame required. reference: images (<=5) and/or audios (<=3) required; use / in prompt. size is fixed 720P. seconds is a string "4".."12" (default "5").

Examples:

  • 纯文本生视频:prompt="未来城市街道", mode="text", seconds="5"

  • 首尾帧:prompt="街道由白天变为夜晚", mode="keyframe", first_frame="https://.../a.png"

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNotext
seedNo
audiosNo
imagesNo
promptYes
api_keyNo
secondsNo5
base_urlNo
last_frameNo
first_frameNo
aspect_ratioNo16:9

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses the async nature, that it returns video_id and must be polled with query_video, fixed 720P size, seconds range, and limits on images/audios. It does not mention rate limits or error behavior, but the critical async/polling behavior is transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with trigger phrases, mode explanations, and examples. It is somewhat long but every section adds value: the Chinese triggers, mode conditions, and examples all serve the agent. Front-loading the async behavior and polling requirement makes key information immediately visible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter tool with no annotations and no output schema, the description covers the core usage well but leaves gaps. It omits aspect_ratio, seed, api_key, and base_url semantics, and does not document error cases or authentication requirements. The return value (video_id) is stated, and polling is explained, so it is adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since schema description coverage is 0%, the description must compensate. It explains mode, prompt usage, seconds, images, audios, first_frame, and last_frame with concrete examples. However, it does not explain seed, api_key, base_url, or aspect_ratio, which are significant parameters. The aspect_ratio enum values are visible in the schema, but their meaning is not described.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Create an async agnes-video-2.5-flash task' and notes it returns video_id for polling. It clearly differentiates from query_video by naming it as the polling counterpart. However, it does not distinguish itself from the sibling generate_video, which is also a video-creation tool, so it lacks full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit trigger phrases (中文触发), recommends async to avoid IDE timeout, and explains when each mode applies: text, keyframe, and reference. It also specifies required inputs per mode (e.g., first_frame/last_frame for keyframe, images/audios for reference). It does not explicitly state when not to use this tool versus generate_video, but the guidance is clear enough for most cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_imageA

Generate or edit an image with agnes-image-2.5-flash. Always returns a URL (or base64).

中文触发:当用户说「agnes生图 / 生成图片 / 做张图 / 文生图 / 图生图 / 改图 / 多图合成」时调用此工具。 Trigger: agnes generate image / text-to-image / image-to-image / edit image.

Presets: size 1K(fast/cheap) / 2K(default, wallpaper 16:9=2624x1472) / 3K / 4K(max quality). ratio 16:9 default (wallpaper), 1:1 social, 9:16 vertical, 21:9 ultrawide. Pass images (public URL or Data URI) for image-to-image / multi-image compose; omit it for pure text-to-image. save_path is optional: when given, the result is also downloaded locally.

Examples:

  • 纯文生图:prompt="赛博朋克夜景壁纸", size="2K", ratio="16:9"

  • 带图改图:prompt="改成雨夜霓虹风格,保持构图", images=["https://.../a.png"]

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNo2K
ratioNo16:9
imagesNo
promptYes
api_keyNo
base_urlNo
save_pathNo
response_formatNourl

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden and covers the return format ('a URL (or base64)'), the local-download side effect when save_path is set, and the different generation modes. It does not discuss latency, cost, or API-key/endpoint configuration, but those omissions are minor for correct invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficient and front-loaded: purpose, model, and return type first, then triggers, presets, parameter conditions, and two concrete examples. The bilingual trigger list and examples are purposeful rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter tool with no output schema, the description covers invocation conditions, parameter behavior, return type, and the optional local side effect with examples. A small gap is the lack of explicit routing to video siblings for video requests, but the tool name and 'image' scope make the boundary clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description compensates by explaining size tiers, ratio use cases, the images parameter's accepted inputs, and save_path's download behavior. It leaves api_key and base_url semantically unexplained, though those are optional infrastructure parameters and all core generation parameters are well covered.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a concrete action, resource, and model: 'Generate or edit an image with agnes-image-2.5-flash.' It also lists the distinct modes (text-to-image, image-to-image, edit, multi-image compose) and states the return type, making the tool clearly distinguishable from the video-generating siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit invocation triggers in both Chinese and English and gives a clear decision rule: pass `images` for image-to-image/compose, omit it for pure text-to-image. It does not explicitly mention the video sibling tools as alternatives or include a when-not-to-use section, so the guidance stops short of a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_videoA

Create a video task and block-poll until completed/failed (compat; may hit client timeouts).

⚠️ 同步阻塞(易超时):开源推荐用 create_video + query_video;此工具仅为短视频兼容保留。 中文触发:仅当用户明确说「一步到位 / 直接等视频结果」时才用,否则用 create_video。 Trigger (compat): agnes generate video sync; prefer async create_video + query_video.

Same params as create_video plus poll_interval (default 2s) and timeout_seconds (default 600s). On timeout, reuse video_id with query_video.

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNotext
seedNo
audiosNo
imagesNo
promptYes
api_keyNo
secondsNo5
base_urlNo
last_frameNo
first_frameNo
aspect_ratioNo16:9
poll_intervalNo
timeout_secondsNo

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It clearly states that the tool blocks until completion, may hit client timeouts, supports configurable poll_interval and timeout_seconds, and that on timeout the agent should reuse video_id with query_video. This is substantial and actionable behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The key information is front-loaded and logically organized, but the same guidance is repeated in Chinese and English multiple times. While the bilingual presentation may help some users, it adds redundancy; not every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter tool with no annotations and no output schema, the description covers the essential operational context: when to use it, how it behaves, what to do on timeout, and which alternative to prefer. It does not detail the return value, but the mention of reusing video_id via query_video gives enough follow-up direction.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description needs to compensate. It does explain the two additional parameters poll_interval and timeout_seconds, and it routes all other parameters to create_video via 'Same params as create_video'. However, it does not describe the individual meanings of mode, seed, images, audios, or other fields, relying on a sibling tool's documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific action: 'Create a video task and block-poll until completed/failed'. It clearly labels itself as a compatibility tool and distinguishes its synchronous behavior from the preferred async sibling create_video. An agent can immediately tell what this tool does and how it differs from the alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use and when-not-to-use guidance: it recommends create_video + query_video for general use and reserves generate_video for users explicitly asking for '一步到位 / 直接等视频结果' or 'agnes generate video sync'. This is strong, unambiguous routing to the correct sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_videoA

Query an agnes-video-2.5-flash task. Returns status/progress and video_url when completed.

中文触发:视频创建后,用此工具按 video_id 轮询进度(配合 create_video 使用)。

ParametersJSON Schema
NameRequiredDescriptionDefault
api_keyNo
base_urlNo
video_idYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must carry behavioral disclosure. It does convey the core behavior: a task query that returns status/progress and video_url only when completed, implying asynchronous polling. It stops short of describing auth requirements, failure/error states, or whether the operation is safe/read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences (English + Chinese) with no filler and the main result statement first. The Chinese sentence earns its place by adding the poll-after-create usage context, though it is slightly redundant with 'Query'.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, but without an output schema or annotations, the description only partially covers what an agent needs: it gives return fields and the create_video pairing, but not the meaning of api_key/base_url or non-success behavior. This is adequate for happy-path polling but incomplete for robust invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has zero description coverage, and the description only mentions video_id ('按 video_id 轮询进度'). It never explains api_key or base_url, which are optional but still part of the invocation surface. Thus the description partially compensates but leaves most parameter semantics to inference.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('Query an agnes-video-2.5-flash task') and describes the observable result ('Returns status/progress and video_url when completed'). This clearly differentiates it from sibling tools like create_video or generate_video, which are creation operations rather than polling operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The Chinese trigger explicitly frames the tool as a poller: '视频创建后,用此工具按 video_id 轮询进度(配合 create_video 使用)', meaning after video creation, poll by video_id in conjunction with create_video. It gives clear when-to-use context but doesn't spell out when not to use it or mention alternative query tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedcreate_video
    • First observedgenerate_image
    • First observedgenerate_video
    • First observedquery_video

TDQS

A3.8/5.0
Disambiguation3/5

query_video and generate_image are clearly distinct, but create_video and generate_video describe the same core operation with different execution modes. The descriptions help differentiate them, but an agent could still easily pick the wrong one.

Naming Consistency3/5

All names follow a snake_case verb_noun pattern, but the verbs are inconsistent: query, generate, create, generate. The create_video vs generate_video pair is especially confusing since they are near-synonyms for the same capability.

Tool Count4/5

Four tools is a reasonable size for an image/video generation server. The only slight issue is that generate_video is a redundant sync variant of create_video, but it serves a compatibility purpose.

Completeness4/5

The core image generation and video creation lifecycles are covered: generate image, create video asynchronously, query status, and sync wait. Minor gaps like cancellation or image task polling are not blocking for the apparent domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JasonOracle/agnes-2.5-flash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server