Get the FREE Ultimate OpenClaw Setup Guide →

siliconflow-flux

基于硅基流动端口的AI生图MCP

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lioensky-siliconflow-flux-mcp-server node path/to/siliconflow-flux-mcp-server/build/index.js \
  --env SILICONFLOW_API_KEY="your-api-key"

How to use

This MCP server exposes the SiliconFlow Flux image generation through the MCP protocol. It allows AI assistants to request image synthesis using SiliconFlow's Flux model with configurable resolutions and parameters. The server supports multiple standard image sizes such as 1024x1024, 960x1280, 768x1024, 720x1440, and 720x1280, and it can cache recent results to speed up repeat requests. To use it, configure an MCP client to call the generate_image tool exposed by the server, providing at minimum a prompt and a resolution, and optionally a seed for reproducibility. The agent must supply the SiliconFlow API key via the environment variable SILICONFLOW_API_KEY when launching the MCP server, so the server can authenticate with SiliconFlow’s API. Once configured, the agent can request image generation by passing a prompt, a chosen resolution, and an optional seed. The server will return the generated image data or a reference to the generated image, depending on the MCP tooling and response format used by your integration.

How to install

Prerequisites:

  • Node.js v18.0.0 or higher
  • npm (comes with Node.js)
  • Access to SiliconFlow API key

Installation steps:

  1. Clone the repository
git clone https://github.com/lioensky/siliconflow-flux-mcp-server.git
  1. Install dependencies
cd siliconflow-flux-mcp-server
npm install
  1. Build the project (if applicable)
npm run build
  1. Prepare configuration
  • Create a .env file at the project root (or ensure your environment provides SILICONFLOW_API_KEY).
  • Obtain your API key from SiliconFlow and store it as SILICONFLOW_API_KEY.

Example .env:

SILICONFLOW_API_KEY=your-api-key
  1. Run the MCP server
# Example (adjust paths as needed)
npm start
  1. Verify the server is running
node -v
npm -v
# Check logs for server startup confirmation

Additional notes

Environment variables:

  • SILICONFLOW_API_KEY: Your SiliconFlow API key. Required for image generation.
  • Consider adding additional environment controls (e.g., rate limits or per-user quotas) at the MCP level if your deployment requires it.

Common issues:

  • Missing or invalid API key: Ensure SILICONFLOW_API_KEY is set and valid.
  • Node version incompatibility: Use Node.js v18.x or newer as stated.
  • Build step missing: If npm run build is not applicable, ensure index.js exists at the specified path in the MCP config.

Configuration tips:

  • Keep the API key outside of your codebase when possible; use environment management for security.
  • If you need to switch resolutions, ensure the client passes a supported resolution list and that the server handles it gracefully.

Related MCP Servers

Sponsor this space

Reach thousands of developers