genspark-mcp
Enables image and video generation through Genspark's UI from Claude Code, Codex CLI, or any stdio-compatible MCP client, using your own local browser and Genspark account.
README
genspark-mcp
Use Genspark image and video generation from Claude Code, Codex CLI, or any stdio-compatible MCP client — locally, with your own Genspark account.
genspark-mcp exposes two local MCP servers:
genspark-image-mcp— text-to-image and reference-image generation, withGPT Image 2as the default model.genspark-video-mcp— text-to-video and image-to-video generation through Genspark's video UI.
The browser stays on the user's Mac. There is no hosted API, shared cookie pool, shared account, or server-side credential store.
Unofficial community project. It is not affiliated with or endorsed by Genspark. Genspark's UI, plans, and access policies can change.
The short version
After installing and logging in once, ask a coding agent to call the MCP:
Create a 16:9 product hero image with GPT Image 2.
Save the result and show me the generated path.
The agent calls generate_image; the local browser operates the user's own
Genspark session; the generated file is saved under ~/Genspark-MCP/outputs.
The same pattern works for video with generate_video.
GPT Image 2 and “unlimited” usage
Genspark's current membership guidance lists unlimited AI Image Agent image creation at zero credit cost for Plus and Pro plans. The same guidance says that session-based rate limits and abuse guardrails still apply. This MCP does not bypass those limits.
The accurate promise is therefore:
If the user's Genspark plan and current UI provide access to GPT Image 2, the user can request it repeatedly from Claude Code, Codex CLI, or another local MCP client, subject to Genspark's account, session limits, and policies.
The GPT Image 2 page describes the model's current quality and size options. The MCP passes the requested model, size, and aspect ratio to the UI and refuses to claim success when the UI does not confirm the requested setting.
Supported clients
| Client | Support | Setup |
|---|---|---|
| Claude Code | Yes | install.sh registers both servers and /image//video commands |
| Codex CLI | Yes | Add the two local stdio servers with docs/CLIENTS.md |
| Other MCP clients | Yes, if they support local stdio | Use mcp-config.template.json |
The MCP protocol is client-neutral. The package's installer is intentionally conservative and only edits Claude Code configuration; Codex and other client configurations are shown explicitly so an existing setup is not overwritten.
Features
Image generation
GPT Image 2by default; also supports the models exposed by the current image UI, such as Nano Banana Pro, Nano Banana 2, Flux 2 Pro, Ideogram V3, Recraft V3, Seedream, and Qwen Image 2.- Aspect ratios from
21:9through9:21, including1:1,16:9, and9:16. - Image sizes
0.5K,1K,2K, and4K, plus automatic selection. - Up to 10 local reference images (
png,jpg,jpeg,webp,gif,bmp,heic, oravif). - Reference-image attachment is fail-closed: if one requested image is not attached, generation is stopped instead of silently generating a different image.
- Results are saved locally and can be returned inline to the MCP client.
- A no-browser
list_optionscall exposes the known model, size, and ratio choices.
Video generation
- Text-to-video and image-to-video through the current Genspark video UI.
- Model-specific choices such as Gemini Veo, Kling, Seedance, PixVerse, MiniMax, Vidu, Wan, Runway, and other models visible to the logged-in user.
- Model, aspect ratio, resolution, duration, count, audio, fast mode, tier, and auto-prompt controls.
- Ordered input images for reference, motion-control, and first/last-frame workflows.
list_video_optionsreads the live UI because video controls vary by model.- Fail-closed settings: if an explicitly requested setting cannot be applied and read back, the MCP refuses to submit a generation.
dry_run=trueapplies and verifies the requested settings without clicking submit. Use it before a high-tier or multi-output request.
The complete parameter and return-value reference is in
docs/FEATURES.md.
MCP tools
genspark-image-mcp
| Tool | Generates media? | Purpose |
|---|---|---|
generate_image |
Yes | Generate, save, and optionally return image data |
check_session |
No | Check the local Genspark image session |
list_options |
No | Return known image models, sizes, and ratios |
generate_image arguments:
| Argument | Default | Meaning |
|---|---|---|
prompt |
required | Japanese or English image instruction |
model |
GPT Image 2 |
Model name or partial match |
aspect_ratio |
automatic | For example 16:9, 1:1, or 9:16 |
image_size |
automatic | 0.5K, 1K, 2K, or 4K |
timeout |
240 |
Maximum wait in seconds |
include_images |
true |
Return image data inline as well as saved paths |
reference_images |
empty | One path, a list, or comma/newline-separated local paths; maximum 10 |
genspark-video-mcp
| Tool | Generates media? | Purpose |
|---|---|---|
generate_video |
Yes, unless dry_run=true |
Generate and save MP4 output |
check_video_session |
No | Check the local Genspark video session |
list_video_options |
No, but opens a browser | Read model-specific live options |
generate_video arguments:
| Argument | Default | Meaning |
|---|---|---|
prompt |
required | Japanese or English scene/story instruction |
images |
empty | Ordered local paths for image-to-video; maximum 10 |
model |
page default | Exact or partial model name |
aspect_ratio |
model default | Auto, 9:16, or 16:9 |
resolution |
model default | For example 720p, 1080p, or 4k |
duration |
model default | Model-specific seconds |
count |
model default | Usually 1 or 2 |
audio |
unchanged | Enable or disable audio when supported |
fast_mode |
unchanged | Enable or disable fast mode when supported |
tier |
model default | Lite, スタンダード, or Ultra |
auto_prompt |
unchanged | Whether Genspark rewrites the prompt |
timeout |
1200 |
Maximum wait in seconds |
dry_run |
false |
Apply/read back settings without submitting |
Install
Requirements:
- macOS
- Python 3.10 or newer
- Claude Code, Codex CLI, or another local stdio MCP client
- A Genspark account with access to the requested feature
- Internet access for Python packages and Camoufox binaries
git clone https://github.com/stockvalue/genspark-mcp.git
cd genspark-mcp
bash ./install.sh
The installer:
- Copies the package to
~/Genspark-MCP. - Creates
~/Genspark-MCP/.venv. - Installs pinned Python dependencies.
- Downloads the Camoufox browser binary.
- Registers
genspark-image-mcpandgenspark-video-mcpfor Claude Code. - Registers
/imageand/videoslash commands. - Creates empty
profile_userandoutputsdirectories.
Existing Claude MCP entries or slash commands with different contents are not overwritten automatically. See the installer options with:
bash ./install.sh --help
Login and verify before generating
Login must be performed by the account owner in the visible browser. Do not send a password, MFA code, cookie, or browser profile to an agent or another person.
cd ~/Genspark-MCP
.venv/bin/python login.py
.venv/bin/python verify_setup.py
.venv/bin/python verify_setup.py --check-login
verify_setup.py starts both MCP servers and checks all six expected tools. It
does not generate an image or video. --check-login additionally checks the
current local session; it returns a non-zero status when either session is not
logged in, which is intentional.
Restart Claude Code or Codex after adding the MCP so the client reloads its
configuration. Client-specific commands are in
docs/CLIENTS.md.
Examples
Claude Code
After installation, use the slash command:
/image 16:9の広告用ヒーロー画像。モデルはGPT Image 2、サイズは2K。
Or ask Claude Code directly to call:
Use mcp__genspark-image-mcp__generate_image with model="GPT Image 2",
aspect_ratio="16:9", image_size="2K", and include_images=true.
For video:
Use mcp__genspark-video-mcp__generate_video with model="Gemini Veo 3.1",
duration=8, resolution="1080p", audio=false, and dry_run=true first.
Codex CLI
Register the local servers once, then ask Codex to call them:
codex mcp add genspark-image-mcp \
--env "GENSPARK_PROFILE=$HOME/Genspark-MCP/profile_user" \
--env "GENSPARK_OUTPUT_DIR=$HOME/Genspark-MCP/outputs" -- \
"$HOME/Genspark-MCP/.venv/bin/python" "$HOME/Genspark-MCP/gs_mcp_server.py"
codex mcp add genspark-video-mcp \
--env "GENSPARK_PROFILE=$HOME/Genspark-MCP/profile_user" \
--env "GENSPARK_OUTPUT_DIR=$HOME/Genspark-MCP/outputs" -- \
"$HOME/Genspark-MCP/.venv/bin/python" "$HOME/Genspark-MCP/gs_video_mcp_server.py"
Then start a new Codex session and request GPT Image 2 by name. The MCP
client, not a hosted service, invokes the local browser.
Direct local CLI
The image and video files also expose a JSON-producing CLI for scripts that do not need MCP framing:
cd ~/Genspark-MCP
printf '%s' 'A clean product hero image with Japanese typography' \
| .venv/bin/python gs_mcp_server.py generate --prompt - --model 'GPT Image 2' \
--aspect-ratio 16:9 --image-size 2K
The direct CLI is optional; MCP clients should normally use the tool surface.
Output and local data
- Login data stays under
~/Genspark-MCP/profile_user. - Generated files stay under
~/Genspark-MCP/outputs. - The public repository contains none of those directories or their contents.
genspark_state.json, cookies, MFA data, and generated private media must never be committed or attached to an issue.
Limitations and safety boundary
This package automates a web UI rather than an official Genspark API. A UI change, login challenge, rate limit, plan restriction, or account state can make a tool fail. Generated images and videos are external side effects: check the model, resolution, duration, tier, count, and output path before submitting.
Use only your own account or an account you are explicitly authorized to use. Do not share credentials, reuse another person's browser profile, resell access, bulk-extract service data, or operate a hosted third-party proxy with this package. Read the current Genspark usage guidance and terms before use.
Troubleshooting
Start with docs/TROUBLESHOOTING.md. Common safe
checks are:
cd ~/Genspark-MCP
.venv/bin/python verify_setup.py
.venv/bin/python verify_setup.py --check-login
.venv/bin/python -m pip show mcp camoufox playwright
If the UI changed, report the redacted error kind, macOS version, Python
version, MCP client, requested model/settings, and whether verify_setup.py
passed. Never include credentials, cookies, or a browser profile archive.
Development and verification
python3 -m pip install -r requirements.txt
python3 scripts/check_public_tree.py
python3 -m compileall -q *.py scripts tests
python3 -m unittest discover -s tests -v
CI runs the public-tree check, compilation, and no-generation tests. It does not log in or spend image/video credits. The current local verification status is that all six MCP tools and the isolated installer path have been checked without media generation; live generation still depends on the user's account and the current Genspark UI.
More documentation
docs/CLIENTS.md— Claude Code, Codex CLI, and generic MCP configurationdocs/FEATURES.md— complete tool parameters, behavior, and return datadocs/TROUBLESHOOTING.md— safe diagnosis and issue reportsdocs/LAUNCH_POSTS.md— launch copy, topics, release text, and metricsAI_SETUP_INSTRUCTIONS.md— rules for an agent helping with setupSECURITY.md— security reporting boundary
日本語まとめ
genspark-mcp は、利用者自身のGensparkアカウントをローカルブラウザで使い、Claude Code・Codex CLIなどのコーディングエージェントから画像・動画生成を呼び出す非公式MCPです。画像サーバーの既定モデルは GPT Image 2 で、モデル・比率・サイズ・参照画像を指定できます。動画サーバーはモデルごとの設定を実UIから読み、指定と異なる条件で送信しないfail-closed設計です。
GensparkのPlus/Pro側に画像Agentの無制限枠が表示される場合でも、セッション単位のレート制限と利用規約上のガードレールがあります。「無限に使える」と断定するのではなく、「自分の契約・アカウント・現在のUIの範囲で、CLIから繰り返し呼べる」と理解してください。
License
MIT. See LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。