Agnes Media MCP Server
This server enables AI-powered image and video generation directly from Claude Desktop using natural language, with results automatically saved locally.
Image Generation (
agnes_generate_image): Generate images from text prompts (text-to-image) or transform existing images (image-to-image) using Agnes Image 2.1 Flash. Configurable options include output size (1K–4K), aspect ratios (1:1, 16:9, 9:16, etc.), seed, negative prompt, and optional inline previews.Video Generation (
agnes_generate_video): Create videos using Agnes Video V2.0 via text-to-video, image-to-video (single image URL), or keyframe transition (multiple image URLs). Configurable parameters include resolution, frame count (up to 441, 8n+1), frame rate (1–60 fps), seed, and negative prompt.Async Video Polling (
agnes_get_video_status): Since video generation takes minutes, the server returns avideo_idimmediately. Poll this tool to check task progress and optionally download the final.mp4when complete.Local File Saving: All generated images and videos are automatically saved to configurable local directories (default: system Pictures/Videos folders under
AgnesOutputs/).Network Resilience: API calls include automatic retry logic (up to 4 attempts) to handle transient errors or rate limits.
Cross-Platform: Runs on Node.js, compatible with macOS and Windows, and integrates seamlessly with Claude Desktop.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Agnes Media MCP Servergenerate a 16:9 cyberpunk city wallpaper"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agnes Media MCP Server
一个用于 Claude Desktop 的本地 MCP 服务器,内置:
Agnes Image 2.1 Flash (
agnes-image-2.1-flash) — 文生图 / 图生图Agnes Video V2.0 (
agnes-video-v2.0) — 文生视频 / 图生视频 / 关键帧动画(异步)
接入后,在 Claude Desktop 里用自然语言即可生成图片和视频,结果自动落盘到本地目录。
跨平台:服务器由 Node 运行,macOS 与 Windows 均可使用。
工具
工具 | 说明 |
| 生成图片。默认文生图;传 |
| 创建视频任务并短等待(默认 45s)。若在等待窗口内完成则直接下载 mp4;否则立即返回 |
| 按 |
视频时长:seconds = num_frames / frame_rate。num_frames 必须 ≤ 441 且满足 8n+1(如 81≈3s、121≈5s、241≈10s、441≈18s @ 24fps)。
为什么视频要两步:视频生成通常需要数分钟,超过单次 MCP 请求的超时(约 60s)。因此 agnes_generate_video 只在客户端超时预算内(wait_seconds,默认 45s、上限 50s)内联等待——快的视频一次返回;慢的立即交回 video_id,用 agnes_get_video_status(download:true)每隔约 15s 轮询直到 completed 即可拿到文件。
Related MCP server: Jimeng MCP Server
安装与构建
npm install
npm run build生成 dist/index.js。
配置(环境变量)
变量 | 必填 | 默认 | 说明 |
| 是 | — | Agnes AI API Key |
| 否 | 系统图片/视频文件夹 | 覆盖输出根目录(设置后图片→ |
| 否 |
| API 网关地址 |
默认落盘位置:不设 AGNES_OUTPUT_DIR 时,图片保存到系统"图片"文件夹、视频保存到系统"视频"文件夹,各自放在 AgnesOutputs/ 子目录下。Windows 上会读取真实的已知文件夹路径(支持重定向,如 H:\用户文件\图片);macOS/Linux 回退到 ~/Pictures、~/Videos。
网络重试:所有 API 调用与文件下载都带自动重试(网络失败或 429/5xx 时等 2 秒重试,共 4 次尝试),以应对偶发的网络抖动。
接入 Claude Desktop
编辑 Claude Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json(不同版本的路径可能不一样)
加入(把路径换成本机 dist/index.js 的绝对路径):
{
"mcpServers": {
"agnes-media": {
"command": "node",
"args": ["/绝对路径/图片和视频MCP/dist/index.js"],
"env": {
"AGNES_API_KEY": "你的Key",
"AGNES_OUTPUT_DIR": "可选自定义输出目录"
}
}
}
}Windows 下
args路径示例:"C:\\Users\\you\\projects\\图片和视频MCP\\dist\\index.js"(反斜杠需转义,或用正斜杠)。
保存后完全重启 Claude Desktop。连接成功后即可对 Claude 说:“生成一张 16:9 的霓虹灯城市壁纸”。
本地调试
用官方 MCP Inspector 手动调用工具:
AGNES_API_KEY=你的Key npm run inspect在 Inspector 里:
agnes_generate_image—prompt任意,size: "2K",ratio: "16:9"→ 检查系统「图片」文件夹下AgnesOutputs/出图。agnes_generate_video—num_frames: 121, frame_rate: 24→ 等待轮询完成,检查系统「视频」文件夹下AgnesOutputs/出 mp4。agnes_get_video_status— 传上一步的video_id。
注意事项
日志走 stderr,stdout 专供 MCP 协议,请勿改动。
视频为异步生成,可能需要数分钟;服务器会阻塞轮询(默认间隔 5s、超时 10 分钟)。超时后可用
agnes_get_video_status继续查询。图生图不需要
tags;response_format由服务器自动放进extra_body。定价当前为 $0(图片 / 视频),可放心联调。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for AI-powered image, audio, and video generation, enabling media creation directly from Claude, Cursor, and other MCP clients.Last updated1151MIT
- Flicense-qualityCmaintenanceA Model Context Protocol server for AI image and video generation using Jimeng AI, enabling text-to-image, image composition, text-to-video, and image-to-video through Claude Desktop and other MCP clients.Last updated73
- Flicense-qualityCmaintenanceA local MCP server that gives Claude Desktop full video editing capabilities via FFmpeg, Whisper, and yt-dlp.Last updated
- Alicense-qualityDmaintenanceMCP server that connects Claude Desktop to Google Gemini, enabling multimodal analysis with file attachments (video, image, audio, PDF).Last updated91MIT
Related MCP Connectors
MCP server for Grok Imagine AI video generation
MCP server for Wan AI video generation
MCP server for Hailuo (MiniMax) AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/peypey84/agnes-media-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server