CM

chenyeju295/mcp_generate_images

API development

This page was translated automatically. Technical details may differ from the original. View the original

20 stars 5 forks Quality 57 Trend 0

Can be used for Cursor integration with MCP Server

Overview

Image generation service based on Volcano Engine (Douyin Doubao), specifically designed to integrate with Cursor MCP service. Supports custom image aspect ratio, save paths, and other features, providing high-quality image generation capabilities. - Supports high-quality image generation - supports various common aspect ratios (1:1, 4:3, 16:9, 3:4, 9:16) - Volcano Engine Doubao Model (doubao-seedream-3-0-t2i-250415) - automatic retry and detailed error handling - full path and permission validation - detailed error messages and logs - asynchronous handling support - Python 3.10+ - Download link: https://www.python.org/downloads/ 1. Access Volcano Engine Ark Large Model Service 2. Register/Log in to Account 3. Create a new API key 4. Copy and save the key in a format such as: YOUR_API_KEY - Download and install the Cursor IDE - Make sure Cursor has correctly configured the Python environment 1. : Use the Volcano Engine Doubao model (doubao-seedream-3-0-t2i-250415), supporting a maximum size of 1024x1024. 2. : It is recommended to use a 1:1 aspect ratio (square images), such as 512x512 or 1024x1024, for the best results and generation speed. 3. : Concise and clear prompts usually yield better results, preferably keeping them under 500 characters. Supports Chinese prompts. 4. : For complex prompts or non-square images, generation may take longer and may cause timeout errors. 5. : The Volcano Engine API only generates one image at a time, which is different from previous batch generation. 1. Is the service running normally? 2. Is the save path correct (must be an absolute path)? 3. Is directory permissions correct? 4. Is network connection normal? 5. Is the API key valid? 6. Is the Python environment properly configured? 7. Is the uv installed correctly? 8. Is the dependency package fully installed?

Overview (machine translated)

Image generation service based on Volcano Engine (Douyin Doubao), specifically designed to integrate with Cursor MCP service. Supports custom image aspect ratio, save paths, and other features, providing high-quality image generation capabilities.

Functional Features

  • Supports high-quality image generation
  • Supports various common aspect ratios (1:1, 4:3, 16:9, 3:4, 9:16)
  • Volcano Engine Tofu Bag Model (doubao-seedream-3-0-t2i-250415)
  • Automatic retries and detailed error handling
  • Complete path and permission verification
  • Detailed error messages and logs
  • Asynchronous processing support

Environmental Preparation

1. Python environment

  • Python 3.10+

  • Download Link:

  • Recommended use of pyenv to manage Python versions:

2. Nodejs environment

  • Download Link:

3. UV package management tool

uv is a fast Python package manager, but you need to install it first:

4. Volcano Engine API key

  1. Access the Volcano Engine Ark large model service
  2. Register/log in to the account
  3. Create a new API key
  4. Copy the key and save it in a format such as: YOUR_API_KEY

5. Cursor

  • Download and install Cursor IDE
  • Make sure Cursor has correctly configured the Python environment

Installation and Configuration

1. Cloning project

2. Installation Dependencies (CD to mcp_generate_images Installation)

Or use requirements.txt file:

If there are issues with the certificate, you can use:

Tips: Make sure the installation is successful; otherwise, configuring the MCP service will cause a red flag.

3. Configure the API key

Set environment variables (recommended method):

Or add to ~/.bashrc or ~/.zshrc:

Verify that environment variables have been set:

4. Configuration services

In mcp_server.py, you can modify the following configuration:

Running Services

Development mode operation (with debug interface):

Used in Cursor

1. Introducing MCP services in Cursor

Add in Cursor’s MCP configuration:

3. Successful service operation examples

4. Used in agent mode of Cursor Composer

Parameter description

The image generation tool supports the following parameters:

Parameter Name Type Required Description
prompt String Yes Image generation prompt, recommended no more than 500 characters
file_name String Yes Saved filename (excluding path; if no extension is used, .png is used by default)
save_folder String Yes The absolute path to save the directory

This page was translated automatically. Technical details may differ from the original.

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "generate_images": { "command": "uv", "args": [ "run", "--with", "fastmcp", "fastmcp", "run", "/Users/chenyeju/Documents/github/mcp_generate_images/mcp_server.py" ] } } }