
Mediagen
io.github.Cripacx由 GitHub 帳號 Cripacx 發布v0.3.0更新於 Oct 24, 2026
Generate images and video from text prompts across Gemini, OpenAI and Kie AI.
概覽
透過 Gemini、OpenAI 或 Kie AI 依文字提示生成圖片與影片,並可為 AI 生成內容加上標記的本機 stdio 伺服器。
- 可以做什麼
- 依文字提示生成圖片,也可對提供的輸入圖片進行編輯或轉換
- 透過支援影片的服務商生成指定時長的短影片
- 列出可用的服務商與模型,並檢查金鑰是否已設定且仍被接受
- 對已產生的檔案寫入 AI 內容標記:機器可讀中繼資料以及可選的可見標籤
- 以單一 JSON 物件回傳結果,包含儲存路徑、服務商與模型
- 適用情境
- 適合需要助理依需求生成或編輯圖片、影片並存到本機磁碟的情境,尤其是想在對話中指定服務商、長寬比、尺寸與輸出檔名,或需要對生成內容做 AI 揭露標記時。
- 執行需求
- 以 stdio 方式在本機透過 npx 啟動,需要 Node.js 20.11 或更新版本。至少需要一個服務商 API 金鑰,透過 GEMINI_API_KEY、OPENAI_API_KEY 或 KIE_API_KEY 提供,或用其內建的初始化指令設定一次。需要能連線到所選服務商的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mediagen,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mediagen — an image and video generation skill for coding agents
Give your agent image and video generation across Google Gemini, OpenAI and Kie AI — one skill, one install, no API to learn.
Say roughly what you want and let it decide the rest:
It wrote the prompt out in full, knew 21:9 rules OpenAI out, and read the path
back from --json.
Or be exact, and it stops deciding:
It marked in a second pass, after seeing where the subject ended up — and put the label on the flat roofline rather than over the loading bay.
Anything the CLI takes can be asked for in words — provider, model, aspect ratio, size, output name and directory, quality preset, video duration, an input image to edit, and whether to mark the result. Name any of them and the agent uses it as given; leave it out and it chooses, or falls back to what you configured.
Install
That is the whole installation. Nothing else to set up — the skill runs the
CLI through npx, which fetches it on first use and caches it afterwards.
Then give it a key:
An interactive wizard: pick providers, enter each key without it being echoed, verify each against the live API, choose a model per provider, and set a default. One key is enough to start.
Now just ask your agent for an image.
What your agent can do with it
- Generate images and video from a description, or edit media you already have
- Choose the right provider for the task — the skill knows Gemini handles 21:9 and video, that OpenAI cannot do 16:9 at all, and that Kie aggregates around thirty third-party models
- Take your instructions literally when you give them. Name a model, a
ratio, a size or a filename and it is used as stated.
mediagen modelsis there when you want to see what is available before choosing - Write the prompt properly. The skill carries prompt-writing guidance, so "a hero image, moody and industrial" becomes a full description of subject, composition, light, camera and materials before anything is sent
- Mark AI-generated output when it matters — the skill suggests it for anything photorealistic or destined for publication
- Recover from failures on its own, because every error carries a machine-readable code and a next action
And what it will not do: ask you to paste an API key into the chat. On a
configuration error the skill tells you to run mediagen init in your own
terminal.
Prerequisites
- At least one API key:
- Google Gemini (get one here) — images and video, widest range of shapes
- OpenAI (get one here) — images
- Kie AI (get one here) — ~30 third-party models
- Node.js 20.11 or later
Configuration
mediagen init covers first-time setup. To change something later:
A menu of every setting with its current value and where that value came from —
provider, model, key, output directory, quality preset, and what mediagen mark does by default. Each change is written as you make it.
For CI and scripts, where there is no terminal, config set takes the same
settings as arguments:
Which provider gets used
Set the order you prefer, most preferred first:
It is a preference, not a whitelist. A request with no --provider goes to the
first provider in the order that has a key and can do the job — so a
missing OpenAI key never stops something Gemini can do, and asking for video
skips straight past the providers that do not make any. Naming --provider
overrides all of it.
mediagen models shows the resulting order, which providers are usable, and
what a request would get:
With --json it adds wouldUse, usableProviders and providerPriority.
That is what the skill has an agent read before generating, so it never picks
a model from a provider you have no key for.
To check what is configured and whether the keys still work:
doctor reports, per provider, whether a key is configured, which layer it came
from, and whether the provider accepts it — keeping not configured,
rejected, unreachable and no cheap way to check distinct, because they
call for four different fixes.
[!WARNING] There is deliberately no flag that takes an API key as an argument. Arguments land in shell history and in the process list, where they outlive the command that used them.
Settings resolve from the environment first, then .env in the working
directory, then the config file:
[!TIP] A stale environment variable shadowing the key you just configured is the most expensive failure this kind of tool has.
mediagen config listmarks every shadowed value, so you can see it rather than guess.
Providers
[!NOTE] OpenAI takes pixel dimensions rather than aspect ratios and genuinely cannot produce 16:9 — its widest image is 1536×1024, which is 3:2. Asking for 16:9 is refused by name rather than quietly served as something else. The skill knows this and routes wide shapes to Gemini.
A model absent from the listings is still sent to the provider, so a newly released model works before mediagen knows about it. Kie's catalogue is generated from Kie's own documentation rather than maintained by hand.
Content marking
The EU AI Act splits disclosure into two duties, so mediagen mark has two
independent switches:
Generating never marks. Marking is always a second command, run on the file afterwards:
That is not ceremony. A visible label has to go where the subject is not, and only the finished image can say where that is. The machine-readable marker is not free either: adding metadata to a JPEG or WebP means decoding and re-encoding it, so marking costs a second lossy pass — worth paying deliberately, not as a side effect of asking for an image. mediagen re-encodes at high quality to keep that cost small, but it cannot make it zero.
To have mediagen mark draw the visible label without being asked each time:
A configured default is still overridable per run with --no-mark or
--no-visible-label.
The visible label is the European Commission's own icon, published with the
Code of Practice on Transparency of AI-generated Content and free to use
without attribution. Two of its three variants are used: AI GENERATED by
default, AI MODIFIED with --modified, for media a person made and a model
altered. The light or dark version is picked from what is actually under the
corner it lands in, because a label nobody can read is not a disclosure.
It sits bottom-right by default. --label-position moves it to another corner,
or auto puts it wherever the image has the least detail.
[!IMPORTANT] A visible label is never written over its source.
mediagen mark photo.png --visible-labelproducesphoto.labelled.pngand leaves the pixels ofphoto.pngexactly as they were, while writing the machine-readable marker into it — so whichever of the two you publish carries the disclosure. A label placed badly can be redone from an untouched original and from nothing else.--in-placeoverwrites if you really mean to.
Using it without an agent
The skill is a wrapper around a CLI, and the CLI stands on its own.
Install it globally if you use it often enough to want the shorter command:
Options
[!TIP] Without the skill, prompt writing is on you. mediagen sends the prompt exactly as written — it does not expand or rewrite it. Decide subject, composition, light, camera or medium, materials and atmosphere, and say what you want rather than what you do not.
Scripting
With --json, stdout carries exactly one JSON object and nothing else.
Without it the saved path is the last line, and a failure writes nothing to
stdout at all — so reading the last line can never hand you an error message
where you expected a path.
A failure carries an errorCode — one of VALIDATION_ERROR, CONFIG_ERROR,
API_ERROR, NETWORK_ERROR, FILE_ERROR, CONTENT_BLOCKED or TIMEOUT —
and a hint naming a concrete next action.
Using it as an MCP server
For hosts that speak MCP rather than running skills. Same package, started with
mediagen mcp, exposing generate_media, list_models and
check_configuration.
Claude Code
The -- separates Claude's own flags from the command that starts the server.
Add --scope project or --scope user to change where the entry is written.
Claude Desktop
Settings → Developer → Edit Config, or edit directly:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop afterwards.
VS Code
Or create .vscode/mcp.json in your workspace — note that VS Code uses
servers, not mcpServers:
Any other MCP client
Cursor, Windsurf, Zed and most others take the same shape as Claude Desktop, in their own config file:
env can be omitted from any of these once mediagen init has run — the
server reads the same configuration the CLI does.
How it works
One pipeline, three frontends. The skill drives the CLI; the MCP server is a second adapter over the same core. Neither contains behaviour of its own, so a capability cannot exist in one and be missing from the other.
Each provider is one self-contained directory declaring what it supports.
Adding one touches a single line outside its own folder. Provider manifests
carry no vendor SDK imports, so doctor and config never pay to load one.
Contributing
See CONTRIBUTING.md for development setup, how to add a provider, and how releases are cut.
來源:README.md,提交 dbe1808
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
