Skip to main content
Glama

sensenova-u1-mcp

npm version npm downloads License GitHub stars

SenseNova U1 Fast MCP Server -- 基于 Model Context Protocol (MCP) 的图像生成服务,接入商汤科技 SenseNova U1 Fast 文生图 API。


目录


Related MCP server: Jimeng AI Image Generator

功能特点

  • AI 图像生成 -- 通过 MCP 协议调用 SenseNova U1 Fast 文生图 API

  • 中文支持 -- 完全支持中文提示词,描述越详细效果越好

  • 11 种分辨率 -- 支持 16:9 / 9:16 / 1:1 / 3:4 / 4:3 / 21:9 等多种比例

  • 批量生成 -- 单次最多生成 4 张图像

  • 轻量无依赖 -- 纯原生 Fetch API,仅依赖 MCP SDK


快速开始

前置条件

  1. 注册 SenseNova 平台 并获取 API Key

  2. 设置环境变量:

# macOS / Linux
export SENSENOVA_API_KEY=sk-xxx

# Windows (CMD)
set SENSENOVA_API_KEY=sk-xxx

# Windows (PowerShell)
$env:SENSENOVA_API_KEY="sk-xxx"

安装

# 全局安装
npm install -g sensenova-u1-mcp

# 或直接运行(无需安装)
npx -y sensenova-u1-mcp

MCP 配置

Claude Desktop / Cursor / VS Code / Cherry Studio

在 MCP 客户端配置文件中添加:

{
  "mcpServers": {
    "sensenova-u1-fast": {
      "command": "npx",
      "args": ["-y", "sensenova-u1-mcp"],
      "env": {
        "SENSENOVA_API_KEY": "sk-xxx"
      }
    }
  }
}

注意:command 必须为 npxargs 中不含任何本地绝对路径,确保配置可移植。


工具说明

generate_image

使用 SenseNova U1 Fast 模型生成图像。

参数

类型

必填

默认值

说明

prompt

string

--

图像描述文本,支持中文,最大约 4096 token。描述越详细效果越好

size

string

2752x1536

分辨率,支持 11 种尺寸(见下方表格)

n

integer

1

生成数量,范围 1~4

支持的分辨率

尺寸

比例

适用场景

1344x3136

9:21

超长竖屏

1536x2752

9:16

手机壁纸/海报

1664x2496

2:3

竖屏信息图

1760x2368

3:4

竖版卡片

1824x2272

4:5

社交媒体图文

2048x2048

1:1

正方形封面图

2272x1824

5:4

横版卡片

2368x1760

4:3

平板/展示

2496x1664

3:2

横版海报

2752x1536

16:9

默认,宽屏/信息图

3072x1376

21:9

超宽屏

Prompt 示例

详细的 prompt 能生成更精准的图像。以下是一个完整的示例结构:

主题:[简要描述图像主题]
风格:[卡通/写实/扁平/3D 等]
色调:[主色调描述]
布局:[排版说明]
元素:[关键元素列表]
文本:[需要包含的文字内容]

API 参考

本服务基于官方 SenseNova U1 Fast API:

POST https://token.sensenova.cn/v1/images/generations

参数

类型

必填

默认值

model

string

sensenova-u1-fast

prompt

string

--

size

string

2752x1536

n

integer

1

响应结构

{
  "created": 1713167890,
  "data": [
    { "url": "https://cdn.sensenova.dev/gen/..." }
  ]
}

错误码

HTTP

含义

处理建议

400

参数不合法

检查请求参数

403

权限不足

检查 API Key

429

额度超限

每 5 小时 1500 次限制,稍后重试

500

服务端错误

稍后重试


开发指南

本地开发

# 克隆仓库
git clone https://github.com/Microbiosis/sensenova-u1-mcp.git
cd sensenova-u1-mcp

# 安装依赖
npm install

# 设置环境变量
export SENSENOVA_API_KEY=sk-xxx

# 运行
node index.js

项目结构

sensenova-u1-mcp/
├── index.js          # MCP 服务器主入口
├── server.json       # MCP Registry 注册配置
├── package.json
├── README.md
├── LICENSE           # MIT 许可证
├── .editorconfig     # 编辑器代码风格配置
├── .gitignore
└── .npmignore

发布到 npm

# 更新版本号
npm version patch   # 1.0.0 -> 1.0.1
npm version minor   # 1.0.0 -> 1.1.0
npm version major   # 1.0.0 -> 2.0.0

# 发布
npm publish

# 验证
npx -y sensenova-u1-mcp

许可证

MIT (c) 2025 redmingwei

Available Tools

1 tool
generate_imageA

使用 SenseNova U1 Fast 模型,根据文本描述生成图像。支持中文 prompt,返回临时 URL 请及时下载。

ParametersJSON Schema
NameRequiredDescriptionDefault
nNo生成数量,1~4 张。
sizeNo图像分辨率,支持 11 种尺寸。默认 2752x1536(16:9)。2752x1536
promptYes图像描述文本,支持中文。描述越详细(构图、色彩、风格、元素)效果越好。最大约 4096 token。

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It usefully notes that the returned URL is temporary and should be downloaded promptly, and that Chinese prompts are supported. However, it does not mention potential costs, latency, or error behavior, which would be valuable for full transparency.

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

Conciseness5/5

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

The description is two concise sentences, front-loaded with the core function and followed by important caveat. Every word earns its place; no wasted text.

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

Completeness4/5

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

For a simple three-parameter tool with a rich schema and no output schema, the description effectively covers the critical behavioral aspect (temporary URL) and language support. It is sufficiently complete for an agent to invoke the tool, though it could mention the range of 'n' or available sizes, but the schema already handles that.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds minor reinforcement (e.g., supports Chinese prompts) but does not explain parameters beyond what the schema already provides. This is acceptable given the schema's completeness.

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 it generates images from text descriptions using a specific model (SenseNova U1 Fast). The verb+resource (generate image) is specific and unambiguous, even though no siblings are present to differentiate.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives, nor any exclusions or prerequisites. It simply states what the tool does, leaving the agent to infer usage from the tool's existence.

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. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.4
    • First observedgenerate_image

TDQS

A3.9/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap. The tool's purpose is clearly described, making selection unambiguous.

Naming Consistency5/5

The single tool uses a clear verb_noun pattern (generate_image), which is a standard MCP naming convention. There are no naming inconsistencies to evaluate.

Tool Count3/5

The server has only one tool, which feels thin even for a narrowly scoped server. This falls into the borderline range for tool count appropriateness.

Completeness5/5

For the domain of text-to-image generation, the tool covers the essential operation. No additional operations are implied by the server's stated purpose, so the surface is complete.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Microbiosis/sensenova-u1-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server