Image-Gen-Server logo

Image-Gen-Server

by fengin

Image-Gen-Server is an image generation service based on JiMeng AI, specifically designed for integration with Cursor IDE. It receives text descriptions from Cursor, generates corresponding images, and provides image download and save functionalities.

View on GitHub

Last updated: N/A

What is Image-Gen-Server?

Image-Gen-Server is a service that integrates with Cursor IDE to generate images from text prompts using the JiMeng AI platform. It allows users to create images directly within the Cursor IDE by providing textual descriptions, and it supports saving generated images to a specified location.

How to use Image-Gen-Server?

  1. Install the server using Smithery or manually by cloning the repository and installing dependencies. 2. Configure the JiMeng API token and image save folder in server.py. 3. Integrate the server with Cursor IDE by adding a new MCP server with the appropriate command, pointing to the server.py file. 4. In Cursor, use the agent mode and prompt it to use the image tool with the desired image requirements and save location.

Key features of Image-Gen-Server

  • Seamless integration with Cursor IDE

  • Text-to-image generation

  • Automatic image saving

  • Customizable save path

  • Generates four images at a time for more options

Use cases of Image-Gen-Server

  • Generating product logos based on project requirements

  • Creating website banners and images for homepages

  • Quickly prototyping visual elements within the Cursor IDE

  • Generating images for documentation or presentations

  • Creating visual content based on textual descriptions during coding

FAQ from Image-Gen-Server

How do I get the JiMeng API token?

Log in to JiMeng, open developer tools (F12), find the sessionid in Application > Cookies, and set it in server.py.

The black window disappears quickly, and the tool status becomes 'No tools found'.

This usually means the server didn't start correctly. Check the command for server.py path, ensure no Chinese characters in the path, and verify that the required environment and dependencies are installed.

How can I view the logs or debug the server?

Change the command to uv run --with fastmcp fastmcp dev D:/code/image-gen-service/server.py or run fastmcp dev D:/code/image-gen-service/server.py in a terminal to enter debug mode. Then, open the provided debug address in your browser.

What Python version is required?

Python 3.10 or higher is required.

What Node.js version is recommended?

Node.js v20 is verified to work, other versions may not be compatible.