Skip to main content

LiblibAI AI图片生成MCP工具

一个基于LiblibAI API的AI图片生成工具,支持各种风格的图片创作,通过MCP协议与Claude Desktop等AI客户端集成。

🎨 主要功能

  • create_image: 根据提示词生成AI图片
  • check_image_status: 查询图片生成状态
  • generate_and_wait: 一站式生成并等待完成
  • health_check: 系统健康检查

📦 安装

pip install liblib-ai-mcp

🚀 快速开始

1. 获取API密钥

首先需要在LiblibAI官网获取您的AccessKey和SecretKey。

2. 设置环境变量

# Windows
set LIBLIB_ACCESS_KEY=your-access-key
set LIBLIB_SECRET_KEY=your-secret-key

# Linux/Mac
export LIBLIB_ACCESS_KEY=your-access-key
export LIBLIB_SECRET_KEY=your-secret-key

3. 启动MCP服务器

liblib-ai-mcp

4. 配置Claude Desktop

在Claude Desktop配置文件中添加:

{
  "mcpServers": {
    "liblib-ai-picture": {
      "command": "liblib-ai-mcp",
      "env": {
        "LIBLIB_ACCESS_KEY": "your-access-key",
        "LIBLIB_SECRET_KEY": "your-secret-key"
      }
    }
  }
}

🎯 使用方法

在Claude中直接使用

请生成一张美丽的风景画

指定参数

使用 create_image("一只可爱的小猫", 1024, 1024) 生成图片

查询生成状态

使用 check_image_status("任务ID") 查询生成进度

一站式生成

使用 generate_and_wait("夕阳下的城市天际线") 生成并等待完成

🛠️ API接口说明

create_image(prompt, width=768, height=768)

生成AI图片

  • prompt: 图片描述(必须)
  • width: 图片宽度,256-2048像素
  • height: 图片高度,256-2048像素

check_image_status(task_id)

查询图片生成状态

  • task_id: 生成任务的ID

generate_and_wait(prompt, width=768, height=768, max_wait=120)

一站式生成并等待完成

  • prompt: 图片描述(必须)
  • width: 图片宽度
  • height: 图片高度
  • max_wait: 最大等待时间(秒)

health_check()

系统健康检查

📝 生成示例

风景类

  • "山水风景画,中国水墨画风格"
  • "sunset over ocean waves, dramatic lighting"
  • "春天的花海,蓝天白云"

人物类

  • "可爱的小女孩,动漫风格"
  • "portrait of an elderly man, realistic style"
  • "古代武士,中国风格"

动物类

  • "一只橙色的小猫在花园里"
  • "majestic lion in savanna, wildlife photography"
  • "中国龙,传统艺术风格"

⚙️ 技术特性

  • 🎨 支持各种风格的AI图片生成
  • 🚀 快速响应的MCP集成
  • 📊 实时生成进度查询
  • 💰 账户积分余额显示
  • 🔄 一站式生成等待服务
  • 🛡️ 完善的错误处理机制
  • 🔐 HMAC-SHA1签名验证

💡 使用提示

  1. 首次使用建议先运行 health_check() 确认服务正常
  2. 生成图片通常需要10-60秒时间
  3. 可以使用 generate_and_wait() 获得一站式体验
  4. 每次生成会消耗一定积分,请注意账户余额
  5. 支持中英文混合描述,英文提示词通常效果更好

📄 许可证

MIT License

🤝 贡献

欢迎提交Issue和Pull Request!

📞 支持

如有问题,请访问:

Metadata

Release files for liblib-ai-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liblib-ai-mcp 1.0.0
File Size Uploaded Provenance
liblib_ai_mcp-1.0.0.tar.gz 8.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for liblib-ai-mcp 1.0.0
File Interpreter ABI Platform
liblib_ai_mcp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / liblib_ai_mcp-1.0.0.tar.gz

Download URL liblib_ai_mcp-1.0.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cb9875cece13274057e6695f8c73b5f9de4f8900bc0191c2517ddbd430930614
BLAKE2b-256 checksum
How to use checksums
530459395a3ef43864db148645c68365f865dac511d78bde8f9e8f3711fe9f72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / liblib_ai_mcp-1.0.0-py3-none-any.whl

Download URL liblib_ai_mcp-1.0.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f8a1d2d2df164a67a0b6dc5702565d73421e245cfc86566991d15024c38cf41
BLAKE2b-256 checksum
How to use checksums
0dc9216020921492448b059d19028307c5f03b3eeef066b3e4531c310d4d53a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for liblib-ai-mcp 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page