imagegen-go MCP Server logo

imagegen-go MCP Server

by shawnzxx

This is an image generation server based on the MCP (Model Control Protocol) protocol, using OpenAI's DALL-E API to generate images. It provides tools to generate images based on text prompts.

View on GitHub

Last updated: N/A

What is imagegen-go MCP Server?

The imagegen-go MCP Server is a Go-based server that utilizes the Model Control Protocol (MCP) to communicate and generate images using the OpenAI DALL-E API. It allows users to generate images from text prompts via a defined protocol.

How to use imagegen-go MCP Server?

  1. Set the OpenAI API key as an environment variable. 2. Compile the project using go build -o bin/imagegen-go main/*.go. 3. Use the provided test scripts (test_mcp.sh, debug_mcp.sh, interactive_test.sh, test_single_request.sh) to interact with the server. The test_single_request.sh script allows for individual requests such as initialization, listing tools, and generating images with specified prompts, width, and height.

Key features of imagegen-go MCP Server

  • MCP Protocol Support

  • OpenAI DALL-E Integration

  • Image Generation from Text Prompts

  • Configurable Image Dimensions

  • Logging

Use cases of imagegen-go MCP Server

  • Generating images for applications

  • Creating visual content from text descriptions

  • Integrating image generation into automated workflows

  • Prototyping image-based designs

  • Testing and debugging image generation models

FAQ from imagegen-go MCP Server

What is MCP?

MCP (Model Control Protocol) is a JSON-RPC 2.0 based protocol for communication between models and tools.

What is the generate-image tool?

The generate-image tool is used to generate images. It requires a prompt and optionally accepts width, height, and destination parameters.

Where are the generated images saved?

By default, generated images are saved in the user's Downloads directory. You can specify a different destination using the destination parameter.

How do I set the OpenAI API key?

Set the OPENAI_API_KEY environment variable before running the server or test scripts: export OPENAI_API_KEY="your_api_key".

Is this a traditional HTTP server?

No, the server communicates with clients through standard input/output (stdin/stdout).