Connect XinYu AI via MCP
Bring XinYu AI's image, video, audio, and text generation — plus reading and tidying your canvases — into Claude, Cursor, Windsurf, Cline, or any MCP-capable agent. Let your agent generate content directly — on your own account and balance.
Overview
MCP (Model Context Protocol) is the standard for AI agents to call external tools. The XinYu AI MCP server wraps the platform's generation API into a set of typed tools, so your agent can call them with zero custom commands to learn.
Same pricing and ledger as the web app — spends your own Xins.
User-level API key — can be read-only, revocable anytime, never exposes provider keys.
Image, video, audio, text, editing, jobs, and reading and editing your canvas — all included.
Get an API Key
Log in to XinYu AI
Open Settings → Developer API Keys
Create & copy the key
Install
No manual install needed — the client config below runs it via npx, which fetches the latest version automatically. To install it explicitly:
# No install needed — the client config below runs it via npx.
# To install the command explicitly:
npm install -g @xinyuai/mcp-server
# → exposes the "xinyu-mcp" commandJust continue to the next step and paste the JSON below into your client config.
Configure Your Client
Add the config below to your client's MCP settings, replacing the path and API key.
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"xinyu": {
"command": "npx",
"args": ["-y", "@xinyuai/mcp-server"],
"env": {
"XINYU_API_KEY": "xys_live_xxxxxxxxxxxxxxxx",
"XINYU_BASE_URL": "https://xinyuai.app"
}
}
}
}Cursor / Windsurf / Cline
Same shape (e.g. Cursor's .cursor/mcp.json):
{
"mcpServers": {
"xinyu": {
"command": "npx",
"args": ["-y", "@xinyuai/mcp-server"],
"env": { "XINYU_API_KEY": "xys_live_xxxx" }
}
}
}Available Tools
Generate
xinyu_generate_imageText-to-image / image-to-image, with reference images and several images per call (Nano Banana / GPT Image / SeeDream / Grok Imagine / Wan and more)xinyu_generate_videoText-to-video / image-to-video / reference-to-video, with start & end frames and reference images, video and audio (Kling / Seedance / Wan / Grok / MiniMax / HappyHorse and more); Seedance 2.5 can render a draft first with draft: truexinyu_generate_video_finalRender the 1080p final of a Seedance 2.5 draft (pass the draft's jobId; billed as a 1080p render)xinyu_generate_audioText-to-speech (ElevenLabs), or Seed Audio for speech / music / sound effects from a prompt, with up to 3 reference clips to clone a timbrexinyu_generate_textText LLM, optionally with images / video as visual context (Gemini / Claude / DeepSeek / GLM / Qwen); returns synchronously, no pollingEdit & enhance
xinyu_image_editEdit an image with a text instruction (redraw or erase)xinyu_video_editEdit a video with a text instruction (Kling O3 video-to-video; source at least 720px tall)xinyu_video_actionUpscale or extend a Grok video you generated earlier (needs the original task id)xinyu_enhanceUpscale and enhance an image (Topaz), with optional face enhancementxinyu_remove_bgRemove the background, returns a transparent PNGxinyu_outpaintOutpaint: expand the image up / right / down / left by a number of pixelsJobs
xinyu_get_jobGet one job's status and assetsxinyu_wait_for_jobWait in one call until a job finishes and return its assets — the way to recover a job after a wait timeout; never re-generatexinyu_list_jobsList recent jobs, filterable by status and canvas (lost a jobId? use status: RUNNING)Account & models
xinyu_balanceGet your Xins balancexinyu_list_modelsList available models and their capabilities (filter by output type) — the authority for model idsxinyu_estimate_pricePrice an image generation before running it (images only): it uses the very function that bills, so the quote is what you payProjects & files
xinyu_list_projectsList my projects (canvases) to get a project_idxinyu_create_projectCreate a new empty canvas, returns project_idxinyu_uploadUpload a local image / video / audio file to get a URL usable for generation, optionally placing it on the canvas tooxinyu_list_assetsSearch and list the images, videos and audio already on a canvas, with URLs you can reuse directly (check here before uploading)Read the canvas
xinyu_read_canvasCanvas overview: node and edge totals plus counts per type and status — safe on a canvas of any sizexinyu_find_nodesSearch a canvas's nodes by title and full prompt, type, status, group or position; always reports the true totalxinyu_inspect_nodesRead full detail for up to 8 nodes: prompt, parameters, position and edgesxinyu_read_node_promptRead a node's full prompt in windows (for very long prompts)Edit the canvas
xinyu_arrange_canvasTidy the canvas: grid-pack loose content nodes (groups and notes stay put)xinyu_rename_nodeSet a node's title — nothing else changes: prompt, references, params and result stay (personal canvases only)xinyu_update_node_paramsChange a node's generation parameters in place (model, ratio, resolution, duration…) — saves a draft only: no regeneration, no Xins spent (personal canvases only)xinyu_connect_nodesDraw a reference edge between two nodes — the source becomes a reference input of the target (personal canvases only)xinyu_disconnect_nodesRemove a reference edge; the remaining references shift position, and @image N tokens are positional (personal canvases only)xinyu_delete_nodesDelete nodes and their edges — irreversible; nodes with a finished (paid) result or still generating need explicit confirmation (personal canvases only)Generation tools wait for the job to finish and return the asset URL(s) by default (pass wait: false to get the jobId immediately). The default maximum wait is 300s for images, audio and the like and 2400s for video tools; change it with wait_timeout_s, up to 3600s. A timeout is not a failure — the job keeps running server-side; fetch the result with xinyu_wait_for_job (or xinyu_get_job) and never re-generate.
Start Using
Once configured, just talk to your agent in natural language, e.g.:
💬 "Use nano-banana-2 to generate a cyberpunk city, 2K, 16:9."
💬 "Make a 5-second ocean-wave video with Seedance 2.0."
💬 "Check how many Xins I have left."
💬 "Find every image with 'seaside' in my 'Summer Poster' canvas, then tidy the layout."
The agent automatically picks xinyu_generate_image / xinyu_generate_video / xinyu_balance (or xinyu_find_nodes / xinyu_arrange_canvas for finding and tidying canvas content), waits for completion, and returns the result.