MCP

Connect XinYu AI via MCP

Bring XinYu AI's image, video, audio, and text generation 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.

Your balance

Same pricing and ledger as the web app — spends your own Xins.

Secure auth

User-level API key, revocable anytime, never exposes provider keys.

14 tools

Image, video, audio, text, editing, and job queries — all included.

Prerequisites: Node.js 18+ and a XinYu AI account.

Get an API Key

1

Log in to XinYu AI

Visit xinyuai.app and sign in to your account.
2

Open Settings → API Keys

Click your avatar at the bottom-left to open Settings, then find the "API Keys" panel.
3

Create & copy the key

Click "Create", name the key. The plaintext key (xys_live_...) is shown only once — copy it immediately.
An API key carries your account permissions and can spend your Xins. Keep it secret — never commit it to a repo or share publicly. If leaked, revoke it immediately in Settings.

Install

No manual install needed — the client config below runs it via npx, which fetches the latest version automatically. To install it explicitly:

bash
# 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" command

Just 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

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):

json
{
  "mcpServers": {
    "xinyu": {
      "command": "npx",
      "args": ["-y", "@xinyuai/mcp-server"],
      "env": { "XINYU_API_KEY": "xys_live_xxxx" }
    }
  }
}
XINYU_BASE_URL defaults to https://xinyuai.app; for local dev set it to http://localhost:3001. Restart your client after configuring — the xinyu_* tools will appear.

Available Tools

xinyu_generate_imageText-to-image / image-to-image
xinyu_generate_videoText-to-video (Kling / Seedance / WAN / Grok / LTX)
xinyu_generate_audioText-to-speech (ElevenLabs)
xinyu_generate_textText LLM (Gemini / ChatGPT / DeepSeek)
xinyu_enhanceImage upscale (Topaz)
xinyu_remove_bgRemove background
xinyu_outpaintOutpaint / expand image
xinyu_image_editPrompt-based image edit
xinyu_video_editVideo-to-video edit (Kling O3)
xinyu_video_actionVideo upscale / extend
xinyu_get_jobGet one job's status
xinyu_list_jobsList recent jobs
xinyu_balanceGet Xins balance
xinyu_list_modelsList available models
xinyu_list_projectsList my projects (canvases) to get a project_id
xinyu_create_projectCreate a new empty canvas, returns project_id

Generation tools poll until the job finishes and return the asset URL(s) by default (pass wait: false to get the jobId immediately, then poll with xinyu_get_job). Video is slow — raise wait_timeout_s.

Every generation must belong to a canvas: project_id is required on all generation tools. Use xinyu_list_projects to find an existing project or xinyu_create_project to make one, then pass its project_id. Image / video land on that canvas as a node by default (place_on_canvas defaults to true; optional canvas_x / canvas_y for position), visible next time the canvas is opened/refreshed. If the user hasn't chosen a canvas yet, ask whether to create a new one or use an existing canvas first.

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."

The agent automatically picks xinyu_generate_image / xinyu_generate_video / xinyu_balance, waits for completion, and returns the result URL.

FAQ