DALL-E MCP Server running on port

by oybekdevuz

251 downloads Not rated yet

About

Image generator MCP using OpenAI DALL-E models

Explore

- Generate images using DALL-E 2 or DALL-E 3
- Edit existing images (DALL-E 2 only)
- Create variations of existing images (DALL-E 2 only)
- Validate OpenAI API key


DALL-E MCP Logo

An MCP (Model Context Protocol) server for generating images using OpenAI's DALL-E API.

npm install

bash

``import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
import { McpName } from "src/enum/McpName";

async function setupClient() {
let client: any = undefined;
const baseUrl: any = "http://127.0.0.1:3002/mcp";

try {
client = new Client({
name: 'streamable-http-client',
version: '1.0.0'
});
const transport = new StreamableHTTPClientTransport(new URL(baseUrl) as any);
await client.connect(transport);
console.log("Connected using Streamable HTTP transport");
} catch (error) {
console.log("Streamable HTTP connection failed, falling back to SSE transport");
client = new Client({
name: 'dalle-image-generator',
version: '1.0.0'
});
const sseTransport = new SSEClientTransport(baseUrl);
await client.connect(sseTransport);
console.log("Connected using SSE transport");
}
}

setupClient()


Make sure to:
1. Replace
your-api-key-here with your OpenAI API key

Note: The following .env configuration is ONLY needed for running tests, not for normal operation.

If you're developing or running tests for this project, create a .env` file in the root directory with your OpenAI API key:

DALL-E MCP Logo

An MCP (Model Context Protocol) server for generating images using OpenAI's DALL-E API.

Features

- Generate images using DALL-E 2 or DALL-E 3
- Edit existing images (DALL-E 2 only)
- Create variations of existing images (DALL-E 2 only)
- Validate OpenAI API key

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.