
spartanz51/imagegen-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
spartanz51/imagegen-mcp는 MCP 서버 후보가 https://github.com/spartanz51/imagegen-mcp.에서 수입되었습니다
개요
spartanz51/imagegen-mcp는 MCP 서버 후보가 https://github.com/spartanz51/imagegen-mcp.에서 수입되었습니다
개요(AI 번역)
이 프로젝트는 OpenAI의 Image Generation 및 Editing APIs (OpenAI 문서를 참조) 주변의 래퍼 역할을하는 Model Context Protocol (MCP)을 기반으로 서버 구현을 제공합니다.
특징
- MCP 도구를 통해 OpenAI 이미지 생성 기능 노출.
- DALL-E 2, DALL-E 3 및 gpt-image-1 (사용 가능한 경우)와 같은 모델을 사용하여
text-to-image생성을 지원합니다. - DALL-E 2 및 gpt-image-1을 사용하여
image-to-image편집을 지원합니다. - 환경변수 및 명령줄 인수를 통해 구성 가능.
- 손잡이 크기, 질, 작풍, 체재, 등 같이 각종 모수.
- 생성 / 편집 된 이미지를 임시 파일로 저장하고 base64 데이터와 함께 경로를 반환합니다.
여기에 이미지를 직접 생성하는 예입니다. Cursor에서 text-to-image] MCP를 통해 통합 된 도구 :
빠른 실행 npx
npm에서 서버를 직접 실행할 수 있습니다 npx] ( Node.js 및 npm 필요):
옵션에 대한 자세한 내용은 Server 섹션을 실행하고 로컬로 실행하십시오.
필수품
- Node.js (v18 이상 권장)
- npm 또는 털실
- OpenAI API 키
Cursor와 통합
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
MCP OpenAI Image Generation Server
This project provides a server implementation based on the Model Context Protocol (MCP) that acts as a wrapper around OpenAI’s Image Generation and Editing APIs (see OpenAI documentation).
Features
- Exposes OpenAI image generation capabilities through MCP tools.
- Supports
text-to-imagegeneration using models like DALL-E 2, DALL-E 3, and gpt-image-1 (if available/enabled). - Supports
image-to-imageediting using DALL-E 2 and gpt-image-1 (if available/enabled). - Configurable via environment variables and command-line arguments.
- Handles various parameters like size, quality, style, format, etc.
- Saves generated/edited images to temporary files and returns the path along with the base64 data.
Here’s an example of generating an image directly in Cursor using the text-to-image tool integrated via MCP:
Quick Run with npx
You can run the server directly from npm using npx (requires Node.js and npm):
npx imagegen-mcp [options]
See the Running the Server section for more details on options and running locally.
Prerequisites
- Node.js (v18 or later recommended)
- npm or yarn
- An OpenAI API key
Integration with Cursor
You can easily integrate this server with Cursor to use its image generation capabilities directly within the editor:
-
Open Cursor Settings:
- Go to
File > Preferences > Cursor Settings(or use the shortcutCtrl+,/Cmd+,).
- Go to
-
Navigate to MCP Settings:
- Search for “MCP” in the settings search bar.
- Find the “Model Context Protocol: Custom Servers” setting.
-
Add Custom Server:
- Click on “Edit in settings.json”.
- Add a new entry to the
mcpServersarray. It should look something like this:
"mcpServers": [ "image-generator-gpt-image": { "command": "npx imagegen-mcp --models gpt-image-1", "env": { "OPENAI_API_KEY": "xxx" } } // ... any other custom servers ... ]- Customize the command:
- You can change the
--modelsargument in thecommandfield to specify which models you want Cursor to have access to (e.g.,--models dall-e-3or--models gpt-image-1). Make sure your OpenAI API key has access to the selected models.
- You can change the
-
Save Settings:
- Save the
settings.jsonfile.
- Save the
설치
npx imagegen-mcp [options]설정
"mcpServers": [
"image-generator-gpt-image": {
"command": "npx imagegen-mcp --models gpt-image-1",
"env": {
"OPENAI_API_KEY": "xxx"
}
}
// ... any other custom servers ...
]