Skip to main content
Glama
lioensky

SiliconFlow Flux MCP Server

by lioensky

SiliconFlow Flux MCP 服务器

这是一个基于Model Context Protocol (MCP)的服务器,允许AI通过MCP协议使用SiliconFlow的Flux模型进行图像生成。

功能特点

  • 允许AI助手通过MCP协议调用SiliconFlow的Flux模型生成高质量图像

  • 支持多种图像分辨率:1024x1024, 960x1280, 768x1024, 720x1440, 720x1280

  • 可自定义生成参数,如随机种子等

  • 缓存最近的图像生成结果

Related MCP server: Image Generation MCP Server

系统要求

  • Node.js v18.0.0 或更高版本

您可以通过以下命令验证Node.js安装:

node --version  # 应显示v18.0.0或更高版本

安装步骤

  1. 克隆仓库:

git clone https://github.com/lioensky/siliconflow-flux-mcp-server.git
  1. 安装依赖:

npm install
  1. 构建项目:

npm run build

配置说明

API密钥配置

在使用前,您需要:

  1. 在项目根目录创建或编辑.env文件

  2. 通过https://cloud.siliconflow.cn/i/HxM1olJu 来获取14元额度密钥

  3. 添加您的SiliconFlow API密钥:

SILICONFLOW_API_KEY=您的API密钥

注意:您需要自备SiliconFlow的API密钥才能使用此服务。

MCP服务器配置

在您的MCP配置文件中添加以下内容:

{
  "mcpServers": {
    "siliconflow-flux-mcp": {
      "command": "node",
      "args": ["路径/到/siliconflow-flux-mcp-server/build/index.js"],
      "env": {
        "SILICONFLOW_API_KEY": "您的API密钥"
      }
    }
  }
}

使用方法

配置完成后,AI助手可以通过MCP协议调用此服务生成图像。服务提供了generate_image工具,接受以下参数:

  • prompt:图像生成提示词(建议使用英文以获得最佳效果)

  • resolution:图像分辨率,支持多种标准尺寸

  • seed(可选):随机种子,用于生成可重复的结果

开发者工具

您可以使用MCP Inspector工具来测试服务器:

npm run inspector

许可证

请参阅项目仓库中的许可证文件。

Available Tools

1 tool
generate_imageA

Generates an image using the SiliconFlow API with the Flux Schnell model (black-forest-labs/FLUX.1-schnell). Provide a detailed English prompt and select a resolution. Nya~ <3 重要提示:

  1. 此工具返回一个基础的 HTML <img> 标签(包含 src 和 alt)。

  2. 请在收到此标签后,为其添加一个 width 属性,值应在 200 到 500 像素之间(例如 width="300")。

  3. 在最终回复用户时,请直接发送这个完整的、已添加 width 属性的 HTML <img> 标签,以便用户可以直接看到图片。

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesRequired. The detailed text prompt for image generation. Please use English for best results, nya~!
resolutionYesRequired. The desired image resolution.
seedNoOptional. A specific seed for reproducibility. If omitted, a random seed is used.

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description fully carries the burden. It discloses that the tool returns an HTML img tag, specifies the model and API used, and instructs the agent to add a width attribute. No contradictions or hidden behaviors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately concise, with clear structure in English followed by a Chinese note. The inclusion of 'Nya~ <3' is extraneous but does not hinder clarity. Could be slightly trimmed but remains effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description fully explains the return format (HTML img tag) and provides necessary post-processing instructions. It covers all essential aspects for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds value by recommending detailed English prompts and noting that seed is optional for reproducibility. This extra guidance enhances parameter understanding beyond the basic schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates an image using the SiliconFlow API with the Flux Schnell model. It specifies the need for a detailed English prompt and resolution selection. The purpose is specific and well-defined.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no siblings exist, the description provides clear usage context: use English prompts, select resolution, and instructions for handling the returned HTML img tag (adding a width attribute). It implicitly guides when to use this tool for image generation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.1.0
    • First observedgenerate_image

TDQS

A4.5/5.0

Scored across 1 tool

Disambiguation5/5

Only one tool exists, so there is no ambiguity between tools. The purpose is clearly to generate an image.

Naming Consistency5/5

With a single tool, naming is trivially consistent. The name 'generate_image' follows a clear verb_noun pattern.

Tool Count4/5

For a dedicated image generation server using a specific model, one tool is appropriate. It covers the core functionality without being too thin for its narrow scope.

Completeness3/5

The tool covers basic image generation but lacks advanced options like style or seed parameters. It is complete for a minimal server but has room for expansion.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers