primitive-go
A Go implementation of an MCP (Model Context Protocol) server tools
claude mcp add --transport stdio prasanthmj-primitive-go-mcp-server /path/to/imagegen-go/bin/imagegen-go \ --env OPENAI_API_KEY="your-api-key" \ --env DEFAULT_DOWNLOAD_PATH="/path/to/downloads"
How to use
This MCP server is a Go implementation that exposes a single MCP tool called generate-image. It uses OpenAI's DALL-E API to produce images from text prompts and can automatically manage where those images are saved. You can connect Claude Desktop or other MCP clients and issue the generate-image tool with descriptive prompts to generate visuals. The server handles the interaction with the API and returns image outputs via the MCP protocol, making it easy to integrate image generation into larger workflows or conversational agents.
How to install
Prerequisites:
- Go 1.19 or higher
- OpenAI API key
- Claude Desktop (for testing)
Install and build steps:
- Install Go if you haven't already. Verify with:
go version
-
Obtain the source code for the image generator (clone the repository).
-
Build the server:
# From the project root
go build -o ./bin/imagegen-go ./main
- Prepare environment variables. Create or update your Claude Desktop configuration to include the required API key and a default download path for generated images. Example environment variables:
OPENAI_API_KEY=your-api-key
DEFAULT_DOWNLOAD_PATH=/path/to/downloads
- Add the server to Claude Desktop configuration (as shown in the README):
{
"mcpServers": {
"imagegen-go": {
"command": "/path/to/imagegen-go/bin/imagegen-go",
"env": {
"OPENAI_API_KEY": "your-api-key",
"DEFAULT_DOWNLOAD_PATH": "/path/to/downloads"
}
}
}
}
- Run the server (example, after building):
./bin/imagegen-go
- In Claude Desktop, point the MCP configuration to the running binary and restart Claude to load the new server.
Additional notes
Notes and tips:
- Ensure OPENAI_API_KEY has the necessary permissions to access the DALL-E service.
- Set DEFAULT_DOWNLOAD_PATH to a writable directory where generated images will be saved.
- If the server cannot reach OpenAI, check your network and API key settings.
- The MCP tool exposed is named generate-image and expects a prompt string to generate an image. You may want to test with a simple prompt first (e.g., "a futuristic city skyline at dusk").
- In Claude Desktop, verify the server path matches the build output location and that the environment variables are properly passed.
- Review logs for helpful error messages if image generation fails (e.g., API quota, invalid API key, or misconfigured paths).
Related MCP Servers
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
go-utcp
Official Go implementation of the UTCP
github-brain
An experimental GitHub MCP server with local database.
tasker
An MCP server for Android's Tasker automation app.
workflowy
Powerful CLI and MCP server for WorkFlowy: reports, search/replace, backup support, and AI integration (Claude, LLMs)
rod
Model Context Protocol Server of Rod