SeedDream 4.0 Replicate MCP Server

SeedDream 4.0 Replicate MCP Server

Enables high-quality image generation using Bytedance's SeedDream 4.0 model via Replicate, supporting bilingual prompts and high-resolution 2K outputs. It allows users to create photorealistic portraits and images with accurate text layout through simple natural language commands.

Category
访问服务器

README

SeedDream 4.0 Replicate MCP Server

A Model Context Protocol (MCP) server that provides image generation capabilities using Bytedance's SeedDream 4.0 model via the Replicate platform.

Features

SeedDream 4.0 is a bilingual (Chinese and English) text-to-image model that excels at:

  • Native 2K high resolution output with various aspect ratios
  • Exceptional text layout for visually stunning results
  • Accurate small and large text generation
  • Photorealistic portraits with cinematic beauty
  • Fast generation (3 seconds for 1K images)
  • Strong instruction following and enhanced aesthetics

Available Tools

generate_image

Generate a single image from a text prompt using SeedDream 4.0 via Replicate.

Parameters:

  • prompt (required): Text description of the image to generate (supports English and Chinese)
  • aspect_ratio (optional): Image aspect ratio - one of: 1:1, 3:4, 4:3, 16:9, 9:16, 2:3, 3:2, 21:9, custom (default: 16:9)
  • size (optional): Image size - one of: small, regular, big (default: regular)
    • small: Shortest dimension 512px
    • regular: Always 1 megapixel
    • big: Longest dimension 2048px
    • Ignored if aspect ratio is custom
  • width (optional): Image width in pixels (512-2048, only used when aspect_ratio is custom)
  • height (optional): Image height in pixels (512-2048, only used when aspect_ratio is custom)
  • guidance_scale (optional): Prompt adherence, higher = more literal (1.0-10.0, default: 2.5)
  • seed (optional): Random seed for reproducible results (0-2147483647)

Installation

Prerequisites

  1. Replicate API Token: Get your API token from Replicate

    • Sign up for an account at https://replicate.com/
    • Navigate to your account settings and generate an API token
    • Keep this token secure as you'll need it for configuration
  2. Node.js: Ensure you have Node.js installed (version 16 or higher)

Quick Setup (Recommended)

The easiest way to use this server is through npx, which automatically downloads and runs the latest version:

For Claude Desktop App

Add the server to your Claude Desktop configuration file:

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

{
  "mcpServers": {
    "seedream": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/PierrunoYT/seedream-v4-replicate-mcp-server.git"
      ],
      "env": {
        "REPLICATE_API_TOKEN": "r8_your_replicate_token_here"
      }
    }
  }
}

For Kilo Code MCP Settings

Add to your MCP settings file at: C:\Users\[username]\AppData\Roaming\Code\User\globalStorage\kilocode.kilo-code\settings\mcp_settings.json

{
  "mcpServers": {
    "seedream": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/PierrunoYT/seedream-v4-replicate-mcp-server.git"
      ],
      "env": {
        "REPLICATE_API_TOKEN": "r8_your_replicate_token_here"
      },
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

Benefits of npx Configuration

Universal Access: Works on any machine with Node.js ✅ No Local Installation: npx downloads and runs automatically ✅ Always Latest Version: Pulls from GitHub repository ✅ Cross-Platform: Windows, macOS, Linux compatible ✅ Settings Sync: Works everywhere you use your MCP client

Manual Installation (Alternative)

If you prefer to install locally:

  1. Clone the repository

    git clone https://github.com/PierrunoYT/seedream-v4-replicate-mcp-server.git
    cd seedream-v4-replicate-mcp-server
    
  2. Install dependencies

    npm install
    
  3. Build the server

    npm run build
    
  4. Use absolute path in configuration

    {
      "mcpServers": {
        "seedream": {
          "command": "node",
          "args": ["/absolute/path/to/seedream-v4-replicate-mcp-server/build/index.js"],
          "env": {
            "REPLICATE_API_TOKEN": "r8_your_replicate_token_here"
          }
        }
      }
    }
    

Helper script to get the absolute path:

npm run get-path

Usage Examples

Once configured, you can use the server through your MCP client:

Basic Image Generation

Generate an image of a serene mountain landscape at sunset with a lake reflection

Specific Aspect Ratio

Create a portrait-oriented image of a futuristic cityscape (aspect ratio 9:16)

Multiple Images

Generate 3 variations of a cute robot character

Batch Generation

Generate images for these prompts: "a red rose", "a blue ocean", "a green forest"

Chinese Language Support

生成一张中国传统山水画的图片

High Guidance for Precise Results

Generate a photorealistic portrait of a person reading a book in a library (guidance scale: 7.5)

API Response Format

The server returns detailed information about generated images:

Successfully generated 1 image(s) using SeedDream 4.0:

Prompt: "a serene mountain landscape at sunset"
Aspect Ratio: 1:1
Guidance Scale: 2.5
Seed Used: 1234567890

Generated Images:
Image 1 (1024x1024): https://v3.fal.media/files/...

Development

Local Testing

# Test the server directly
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node build/index.js

Watch Mode

npm run watch

Inspector Tool

npm run inspector

Troubleshooting

Common Issues

  1. "REPLICATE_API_TOKEN environment variable is not set"

    • The server will continue running and show this helpful error message
    • Ensure your Replicate API token is properly set in the MCP configuration
    • Verify the token is valid and has sufficient credits
    • Note: The server no longer crashes when the API token is missing
  2. "Server not showing up in Claude"

    • If using npx configuration, ensure you have Node.js installed
    • For manual installation, check that the absolute path is correct
    • Restart Claude Desktop after configuration changes
    • Verify the JSON configuration syntax is valid
  3. "Generation failed"

    • Check your Replicate account has sufficient credits
    • Verify your API token has the necessary permissions
    • Try with a simpler prompt to test connectivity
  4. "npx command not found"

    • Ensure Node.js is properly installed
    • Try running node --version and npm --version to verify installation

Server Stability Improvements

Robust Error Handling: Server continues running even without API token ✅ Graceful Shutdown: Proper handling of SIGINT and SIGTERM signals ✅ User-Friendly Messages: Clear error messages with setup instructions ✅ No More Crashes: Eliminated process.exit() calls that caused connection drops

Debug Logging

The server outputs debug information to stderr, which can help diagnose issues:

  • Generation progress updates
  • Error messages with helpful instructions
  • API call details
  • Graceful shutdown notifications

Pricing

Image generation costs are determined by Replicate's pricing structure. Check Replicate Pricing for current rates.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Support

For issues related to:

  • This MCP server: Open an issue in this repository
  • Replicate API: Contact Replicate support
  • SeedDream 4.0 model: Refer to Replicate documentation

Changelog

v0.1.1 (Latest)

  • 🔧 Fixed connection drops: Removed process.exit() calls that caused server crashes
  • 🛡️ Improved error handling: Server continues running even without API token
  • 🌍 Added portability: npx configuration works on any machine
  • 📦 Enhanced stability: Graceful shutdown handlers and null safety checks
  • 💬 Better user experience: Clear error messages with setup instructions
  • 🔄 Auto-updating: npx pulls latest version from GitHub automatically

v0.1.0

  • Initial release
  • Support for single and batch image generation
  • Bilingual prompt support (English/Chinese)
  • Multiple aspect ratios
  • Configurable generation parameters

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选