@takeshijuan/ideogram-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +278 -0
- package/dist/index.js +3607 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 takeshijuan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Ideogram MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://modelcontextprotocol.io)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](https://www.typescriptlang.org)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://coderabbit.ai)
|
|
8
|
+
|
|
9
|
+
> **⚠️ Disclaimer**: This is an **unofficial**, community-driven project and is **not affiliated with, endorsed by, or sponsored by Ideogram AI**. For official Ideogram resources, please visit [ideogram.ai](https://ideogram.ai).
|
|
10
|
+
|
|
11
|
+
> **🤖 AI-Generated Project**: This project was **entirely implemented by an AI agent** (Claude) using the auto-claude autonomous development system. The codebase, tests, and documentation were all generated through AI-assisted development. Human oversight was provided for requirements and review.
|
|
12
|
+
|
|
13
|
+
A production-grade **Model Context Protocol (MCP) server** that provides seamless integration between LLM applications (Claude Desktop, Cursor, VS Code) and the [Ideogram AI](https://ideogram.ai) image generation API.
|
|
14
|
+
|
|
15
|
+
## ✨ Features
|
|
16
|
+
|
|
17
|
+
- **🎨 Image Generation** - Generate high-quality AI images from text prompts using Ideogram V3
|
|
18
|
+
- **✏️ Image Inpainting** - Edit specific parts of images using mask-based inpainting
|
|
19
|
+
- **⚡ Async Support** - Queue generation requests for background processing
|
|
20
|
+
- **💰 Cost Tracking** - Estimated credit and USD costs included in all responses
|
|
21
|
+
- **📁 Local Storage** - Automatically save generated images locally (URLs expire)
|
|
22
|
+
- **🔄 Enterprise Error Handling** - User-friendly messages with retry guidance
|
|
23
|
+
- **🛡️ Type Safety** - Full TypeScript strict mode with Zod validation
|
|
24
|
+
|
|
25
|
+
## 🚀 Quick Start
|
|
26
|
+
|
|
27
|
+
### Prerequisites
|
|
28
|
+
|
|
29
|
+
- Node.js 18+
|
|
30
|
+
- An [Ideogram API key](https://ideogram.ai/manage-api)
|
|
31
|
+
|
|
32
|
+
### Installation
|
|
33
|
+
|
|
34
|
+
[](https://cursor.com/en/install-mcp?name=ideogram&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0YWtlc2hpanVhbi9pZGVvZ3JhbS1tY3Atc2VydmVyIl0sImVudiI6eyJJREVPR1JBTV9BUElfS0VZIjoiIn19)
|
|
35
|
+
[](https://vscode.dev/redirect/mcp/install?name=ideogram&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40takeshijuan/ideogram-mcp-server%22%5D%2C%22env%22%3A%7B%22IDEOGRAM_API_KEY%22%3A%22%22%7D%7D)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Clone the repository
|
|
39
|
+
git clone https://github.com/takeshijuan/ideogram-mcp-server.git
|
|
40
|
+
cd ideogram-mcp-server
|
|
41
|
+
|
|
42
|
+
# Install dependencies
|
|
43
|
+
npm install
|
|
44
|
+
|
|
45
|
+
# Build
|
|
46
|
+
npm run build
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Configuration
|
|
50
|
+
|
|
51
|
+
Create a `.env` file (or set environment variables):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Required
|
|
55
|
+
IDEOGRAM_API_KEY=your_ideogram_api_key_here
|
|
56
|
+
|
|
57
|
+
# Optional
|
|
58
|
+
LOG_LEVEL=info # debug, info, warn, error
|
|
59
|
+
LOCAL_SAVE_DIR=./ideogram_images # Where to save images
|
|
60
|
+
ENABLE_LOCAL_SAVE=true # Auto-download generated images
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Claude Desktop Setup
|
|
64
|
+
|
|
65
|
+
Add to your Claude Desktop configuration file:
|
|
66
|
+
|
|
67
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
68
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"ideogram": {
|
|
74
|
+
"command": "node",
|
|
75
|
+
"args": ["/path/to/ideogram-mcp-server/dist/index.js"],
|
|
76
|
+
"env": {
|
|
77
|
+
"IDEOGRAM_API_KEY": "your_api_key_here"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Restart Claude Desktop to load the server.
|
|
85
|
+
|
|
86
|
+
## 🛠️ Available Tools
|
|
87
|
+
|
|
88
|
+
### `ideogram_generate`
|
|
89
|
+
|
|
90
|
+
Generate images from text prompts.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
// Basic usage
|
|
94
|
+
{
|
|
95
|
+
prompt: "A beautiful sunset over mountains"
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// With all options
|
|
99
|
+
{
|
|
100
|
+
prompt: "A cute cat wearing a wizard hat",
|
|
101
|
+
aspect_ratio: "16x9", // 15 ratios: 1x1, 16x9, 9x16, 4x3, 3x4, etc.
|
|
102
|
+
num_images: 4, // 1-8 images
|
|
103
|
+
rendering_speed: "QUALITY", // FLASH, TURBO, DEFAULT, QUALITY
|
|
104
|
+
magic_prompt: "ON", // AUTO, ON, OFF - enhance prompts
|
|
105
|
+
style_type: "REALISTIC", // AUTO, GENERAL, REALISTIC, DESIGN, FICTION
|
|
106
|
+
save_locally: true // Save to local disk
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Response includes:**
|
|
111
|
+
- Image URLs and local paths (if saved)
|
|
112
|
+
- Seeds for reproducibility
|
|
113
|
+
- Cost estimates (credits and USD)
|
|
114
|
+
|
|
115
|
+
### `ideogram_inpaint`
|
|
116
|
+
|
|
117
|
+
Edit specific parts of existing images using inpainting with masks.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
// Edit parts of an image using a mask
|
|
121
|
+
{
|
|
122
|
+
prompt: "Add a red balloon in the sky",
|
|
123
|
+
image: "https://example.com/photo.jpg", // URL, file path, or base64 data URL
|
|
124
|
+
mask: maskImageData, // Black pixels=edit, White pixels=preserve
|
|
125
|
+
model: "V_2", // or "V_2_TURBO" for faster processing
|
|
126
|
+
num_images: 1, // Generate 1-8 variations
|
|
127
|
+
magic_prompt: "AUTO", // AUTO, ON, or OFF
|
|
128
|
+
style_type: "AUTO" // AUTO, GENERAL, REALISTIC, DESIGN, FICTION, RENDER_3D, ANIME
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Mask Requirements:**
|
|
133
|
+
- Same dimensions as source image
|
|
134
|
+
- Black and white pixels only (black=areas to edit, white=areas to preserve)
|
|
135
|
+
- Black area must be at least 10% of total image
|
|
136
|
+
- Supported formats: PNG, JPEG, WebP
|
|
137
|
+
|
|
138
|
+
### `ideogram_generate_async`
|
|
139
|
+
|
|
140
|
+
Queue generation requests for background processing.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
{
|
|
144
|
+
prompt: "A complex scene with many details",
|
|
145
|
+
num_images: 8
|
|
146
|
+
}
|
|
147
|
+
// Returns immediately with prediction_id
|
|
148
|
+
// Poll with ideogram_get_prediction
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### `ideogram_get_prediction`
|
|
152
|
+
|
|
153
|
+
Check status and retrieve results of async requests.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
{
|
|
157
|
+
prediction_id: "pred_abc123..."
|
|
158
|
+
}
|
|
159
|
+
// Returns: status (queued/processing/completed/failed)
|
|
160
|
+
// When completed: includes images and cost
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### `ideogram_cancel_prediction`
|
|
164
|
+
|
|
165
|
+
Cancel queued async requests (before processing starts).
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
{
|
|
169
|
+
prediction_id: "pred_abc123..."
|
|
170
|
+
}
|
|
171
|
+
// Only works for predictions in 'queued' status
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 📊 Cost Tracking
|
|
175
|
+
|
|
176
|
+
All generation responses include estimated cost information:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"total_cost": {
|
|
181
|
+
"credits_used": 8,
|
|
182
|
+
"estimated_usd": 0.08,
|
|
183
|
+
"note": "Cost estimate based on known Ideogram pricing"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
> **Note:** Costs are **estimated locally** based on known pricing. The Ideogram API does not return actual cost information.
|
|
189
|
+
|
|
190
|
+
## 🔧 Development
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Development with hot reload
|
|
194
|
+
npm run dev
|
|
195
|
+
|
|
196
|
+
# Run tests
|
|
197
|
+
npm test
|
|
198
|
+
|
|
199
|
+
# Run tests with coverage
|
|
200
|
+
npm run test:coverage
|
|
201
|
+
|
|
202
|
+
# Type checking
|
|
203
|
+
npm run typecheck
|
|
204
|
+
|
|
205
|
+
# Lint
|
|
206
|
+
npm run lint
|
|
207
|
+
|
|
208
|
+
# Format code
|
|
209
|
+
npm run format
|
|
210
|
+
|
|
211
|
+
# Test with MCP Inspector
|
|
212
|
+
npm run inspect
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## 📁 Project Structure
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
ideogram-mcp-server/
|
|
219
|
+
├── src/
|
|
220
|
+
│ ├── index.ts # Entry point
|
|
221
|
+
│ ├── server.ts # MCP server setup
|
|
222
|
+
│ ├── config/ # Configuration
|
|
223
|
+
│ ├── services/ # Core services
|
|
224
|
+
│ │ ├── ideogram.client.ts # API client
|
|
225
|
+
│ │ ├── cost.calculator.ts # Cost estimation
|
|
226
|
+
│ │ ├── prediction.store.ts # Async job queue
|
|
227
|
+
│ │ └── storage.service.ts # Local file storage
|
|
228
|
+
│ ├── tools/ # MCP tools
|
|
229
|
+
│ │ ├── generate.ts
|
|
230
|
+
│ │ ├── generate-async.ts
|
|
231
|
+
│ │ ├── edit.ts
|
|
232
|
+
│ │ ├── get-prediction.ts
|
|
233
|
+
│ │ └── cancel-prediction.ts
|
|
234
|
+
│ ├── types/ # TypeScript types
|
|
235
|
+
│ └── utils/ # Utilities
|
|
236
|
+
├── docs/ # Additional documentation
|
|
237
|
+
├── dist/ # Built output
|
|
238
|
+
└── package.json
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 🔐 Security
|
|
242
|
+
|
|
243
|
+
- API keys are passed via environment variables, never stored in code
|
|
244
|
+
- All inputs validated with Zod schemas
|
|
245
|
+
- File operations restricted to configured directories
|
|
246
|
+
- No sensitive data logged
|
|
247
|
+
|
|
248
|
+
## 🤝 Contributing
|
|
249
|
+
|
|
250
|
+
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on:
|
|
251
|
+
|
|
252
|
+
- Development setup
|
|
253
|
+
- Coding standards
|
|
254
|
+
- Testing requirements
|
|
255
|
+
- Pull request process
|
|
256
|
+
|
|
257
|
+
**Quick start:**
|
|
258
|
+
|
|
259
|
+
1. Fork the repository
|
|
260
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
261
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
262
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
263
|
+
5. Open a Pull Request
|
|
264
|
+
|
|
265
|
+
## 📄 License
|
|
266
|
+
|
|
267
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
268
|
+
|
|
269
|
+
## 📚 Resources
|
|
270
|
+
|
|
271
|
+
- [Ideogram API Documentation](https://developer.ideogram.ai/api)
|
|
272
|
+
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
273
|
+
- [MCP SDK Documentation](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
274
|
+
- [Claude Desktop MCP Guide](https://docs.anthropic.com/en/docs/build-with-claude/mcp)
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
Built with ❤️ for the AI developer community
|