Baidu iRAG MCP Server

by kuai0901

Not rated
GitHub

About

Generate images using Baidu's iRAG API through a standardized MCP interface.

Details

Author
kuai0901
Categories
Developer Tools

Setup

Install Baidu iRAG MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/kuai0901/irag-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

Generate images using Baidu's iRAG API through a standardized MCP interface.

一个基于百度iRAG图片生成API的MCP(Model Context Protocol)服务器,允许MCP客户端(如Claude Desktop)通过标准化接口调用百度的图片生成服务。
- 获取真实的百度API Key
- 运行npm run test:api进行真实API测试
- 验证图片生成和Base64转换功能

- 🎨 支持百度iRAG图片生成API
- 🔧 完整的MCP协议实现
- 📝 支持多种模型(irag-1.0, flux.1-schnell)
- 🖼️ 灵活的图片尺寸配置
- 🔄 自动重试机制
- 📊 完善的日志记录
- ✅ 全面的参数验证
- 🧪 完整的测试覆盖

- irag-1.0: 百度自研的图片生成模型
- flux.1-schnell: 支持更多高级参数的快速生成模型

git clone <repository-url> cd irag-mcp-server

- 访问百度智能云控制台
- 创建API Key并选择千帆ModelBuilder
- 配置对应的应用资源
- 复制API Key(格式:bce-v3/ALTAK-*/

# 必需配置 BAIDU_API_KEY=bce-v3/ALTAK-your-access-key/your-secret-key # 图片资源配置 RESOURCE_MODE=local # local: 保存到本地文件 | url: 仅返回URL和base64 BASE_PATH= # 自定义保存路径(可选,默认为桌面/irag-images) MODEL=irag-1.0 # 默认模型: irag-1.0 | flux.1-schnell # 可选配置 SERVER_NAME=irag-mcp-server SERVER_VERSION=1.0.0 LOG_LEVEL=info LOG_FILE=logs/server.log API_TIMEOUT=30000 MAX_RETRIES=3

- RESOURCE_MODE=local: 图片将保存到本地文件系统,同时返回base64数据和文件路径
-
RESOURCE_MODE=url: 仅返回图片URL和base64数据,不保存本地文件
-
BASE_PATH: 自定义图片保存路径,留空则使用默认路径(用户桌面/irag-images文件夹)
-
MODEL: 设置默认使用的图片生成模型

- irag-1.0: 百度自研模型,通用性好,速度快
- flux.1-schnell: 支持更多高级参数,质量更高

Windows:%APPDATA%\Claude\claude_desktop_config.jsonmacOS:~/Library/Application Support/Claude/claude_desktop_config.json

{ "mcpServers": { "irag-image-generator": { "command": "node", "args": ["/path/to/irag-mcp-server/dist/index.js"], "env": { "BAIDU_API_KEY": "bce-v3/ALTAK-your-access-key/your-secret-key" } } } }

- 512x512,768x768,1024x768,1024x1024

{ "name": "generate_image", "arguments": { "prompt": "一只可爱的橘猫坐在窗台上,阳光透过窗户洒在它身上", "size": "1024x1024", "n": 2 } }
src/ ├── client/ # API客户端 ├── config/ # 配置管理 ├── server/ # MCP服务器 ├── types/ # 类型定义 ├── utils/ # 工具函数 ├── __tests__/ # 测试文件 └── index.ts # 主入口
# 开发模式运行 npm run dev # 构建项目 npm run build # 运行测试 npm test # 监听测试 npm run test:watch # 代码检查 npm run lint # 修复代码风格 npm run lint:fix # 清理构建文件 npm run clean

- 确保API Key格式正确:bce-v3/ALTAK-/*
- 检查API Key是否已配置千帆ModelBuilder资源

- 服务器会自动下载图片并转换为base64格式
- 如果下载失败,会返回错误信息和原始URL
- 检查网络连接和图片URL的可访问性

- 确保Claude Desktop配置文件路径正确
- 检查Node.js版本(需要>=18.0.0)
- 验证项目已正确构建(运行npm run build

- 初始版本发布
- 支持百度iRAG图片生成API
- 完整的MCP协议实现
- 支持多种模型和参数配置

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.