Zhipu AI Image

Provides CogView4 image generation via MCP from text prompts, supporting multiple sizes and automatic local save.
  • python

0

GitHub Stars

python

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "lisy09-zhipu_image_mcp": {
      "command": "python",
      "args": [
        "cogview_server.py"
      ],
      "env": {
        "ZHIPU_API_KEY": "your_api_key_here"
      }
    }
  }
}

You run a dedicated MCP server that uses the CogView4 model to generate images from text prompts. It supports multiple image sizes, automatically saves outputs locally, and exposes a simple MCP endpoint you can call from compatible clients to generate images on demand.

How to use

Start by launching the local MCP server, which runs a Python script named cogview_server.py. Once running, you can request image generation by calling the server’s available tool from your MCP client. The server accepts a text prompt in Chinese to guide image creation and selects from preset output sizes. Generated images are saved in the generated_images directory with a timestamped filename.

How to install

Prerequisites you need before installation are Python (3.8 or newer) and a working internet connection to install dependencies.

# 1) Clone the project
git clone https://github.com/lisy09/zhipu_image_mcp.git
cd zhipu_image_mcp

# 2) Install MCP dependencies via the MCP tooling (uv) if you have it installed, otherwise use pip as a fallback
uv sync

# If uv is not available, install dependencies with pip as a fallback
pip install -r requirements.txt

Additional configuration and usage notes

Before starting, set your API key for the image generation service. The server reads this key from the environment variable ZHIPU_API_KEY.

To run the server locally, use the following command. It starts the CogView4 MCP endpoint and enables image generation via the MCP client.

python cogview_server.py

Available tools

generate_cogview4_image

Generates an image from a text prompt. Accepts a mandatory prompt and an optional size (1024x1024, 768x768, 576x1024). The resulting image is saved to generated_images with a timestamped filename.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational