@bashcat/ai-image-chat-mcp 1.0.5 → 1.0.6
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/README.md +69 -2
- package/dist/index.js +62 -67
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
- 🖼️ **圖片生成**: 使用 AI 模型生成圖片
|
|
8
8
|
- 💬 **對話完成**: 使用 AI 模型進行智能對話
|
|
9
|
-
-
|
|
9
|
+
- � **自動保存**: 生成的圖片會自動下載並保存到指定目錄
|
|
10
|
+
- 📝 **智能命名**: 檔名根據用戶的 prompt 自動生成
|
|
11
|
+
- �🔐 **安全配置**: API 密鑰安全保存在 `.env` 文件中
|
|
10
12
|
- 🎛️ **自定義提示**: 支持自定義系統提示詞,如未提供則使用預設值
|
|
11
13
|
|
|
12
14
|
## 安裝與設置
|
|
@@ -24,8 +26,15 @@ npm install
|
|
|
24
26
|
```env
|
|
25
27
|
AI_API_KEY=your_api_key_here
|
|
26
28
|
AI_API_BASE_URL=https://api.laozhang.ai/v1
|
|
29
|
+
AI_IMAGE_SAVE_PATH=/path/to/your/images/directory
|
|
27
30
|
```
|
|
28
31
|
|
|
32
|
+
**環境變數說明:**
|
|
33
|
+
|
|
34
|
+
- `AI_API_KEY`: 您的 AI API 密鑰(必須)
|
|
35
|
+
- `AI_API_BASE_URL`: API 基礎 URL(可選,預設為 `https://api.laozhang.ai/v1`)
|
|
36
|
+
- `AI_IMAGE_SAVE_PATH`: 圖片保存路徑(可選,預設為 `~/generated_images`)
|
|
37
|
+
|
|
29
38
|
**支持的 API 服務商:**
|
|
30
39
|
|
|
31
40
|
- 老張 AI: `https://api.laozhang.ai/v1`
|
|
@@ -44,6 +53,64 @@ npm run build
|
|
|
44
53
|
npm start
|
|
45
54
|
```
|
|
46
55
|
|
|
56
|
+
## MCP (Model Context Protocol) 設置
|
|
57
|
+
|
|
58
|
+
### 在 Claude Desktop 中使用
|
|
59
|
+
|
|
60
|
+
編輯您的 Claude Desktop 配置文件 (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"ai-image-chat-mcp": {
|
|
66
|
+
"command": "npx",
|
|
67
|
+
"args": ["-y", "@bashcat/ai-image-chat-mcp"],
|
|
68
|
+
"env": {
|
|
69
|
+
"AI_API_KEY": "your_api_key_here",
|
|
70
|
+
"AI_API_BASE_URL": "https://api.laozhang.ai/v1",
|
|
71
|
+
"AI_IMAGE_SAVE_PATH": "/path/to/your/images/directory"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 在 VS Code 中使用
|
|
79
|
+
|
|
80
|
+
編輯您的 VS Code 設置 (`settings.json`):
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcp": {
|
|
85
|
+
"servers": {
|
|
86
|
+
"ai-image-chat-mcp": {
|
|
87
|
+
"command": "npx",
|
|
88
|
+
"args": ["-y", "@bashcat/ai-image-chat-mcp"],
|
|
89
|
+
"env": {
|
|
90
|
+
"AI_API_KEY": "your_api_key_here",
|
|
91
|
+
"AI_API_BASE_URL": "https://api.laozhang.ai/v1",
|
|
92
|
+
"AI_IMAGE_SAVE_PATH": "/path/to/your/images/directory"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 環境變數配置
|
|
101
|
+
|
|
102
|
+
| 環境變數 | 必需 | 預設值 | 說明 |
|
|
103
|
+
|---------|------|--------|------|
|
|
104
|
+
| `AI_API_KEY` | ✅ | - | 您的 AI API 密鑰 |
|
|
105
|
+
| `AI_API_BASE_URL` | ❌ | `https://api.laozhang.ai/v1` | API 基礎 URL |
|
|
106
|
+
| `AI_IMAGE_SAVE_PATH` | ❌ | `~/generated_images` | 圖片保存路徑 |
|
|
107
|
+
|
|
108
|
+
### 圖片保存功能
|
|
109
|
+
|
|
110
|
+
- 🖼️ **自動下載**: 生成的圖片會自動下載到指定目錄
|
|
111
|
+
- 📝 **智能命名**: 檔名根據 prompt 自動生成,例如:`台灣男性工程師-2025-06-29T04-40-40-978Z.jpg`
|
|
112
|
+
- 📁 **目錄創建**: 如果指定目錄不存在,會自動創建
|
|
113
|
+
|
|
47
114
|
## 可用工具
|
|
48
115
|
|
|
49
116
|
### 1. generate_image
|
|
@@ -118,7 +185,7 @@ npm run dev
|
|
|
118
185
|
|
|
119
186
|
### 項目結構
|
|
120
187
|
|
|
121
|
-
```
|
|
188
|
+
```text
|
|
122
189
|
laozhang_mcp/
|
|
123
190
|
├── src/
|
|
124
191
|
│ └── index.ts # 主要服務器代碼
|
package/dist/index.js
CHANGED
|
@@ -4,15 +4,16 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import dotenv from "dotenv";
|
|
6
6
|
import axios from "axios";
|
|
7
|
-
import fs from "fs";
|
|
8
|
-
import path from "path";
|
|
7
|
+
import * as fs from "fs";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
import * as os from "os";
|
|
9
10
|
// 載入環境變數
|
|
10
11
|
dotenv.config();
|
|
11
12
|
class AIImageChatMCPServer {
|
|
12
13
|
server;
|
|
13
14
|
apiKey;
|
|
14
15
|
baseUrl;
|
|
15
|
-
|
|
16
|
+
saveDirectory;
|
|
16
17
|
constructor() {
|
|
17
18
|
this.server = new Server({
|
|
18
19
|
name: "ai-image-chat-mcp-server",
|
|
@@ -25,26 +26,58 @@ class AIImageChatMCPServer {
|
|
|
25
26
|
// 從環境變數獲取 API 配置
|
|
26
27
|
this.apiKey = process.env.AI_API_KEY || "";
|
|
27
28
|
this.baseUrl = process.env.AI_API_BASE_URL || "https://api.laozhang.ai/v1";
|
|
28
|
-
|
|
29
|
-
this.outputDir = process.env.IMAGE_OUTPUT_DIR || path.join(process.cwd(), "generated_images");
|
|
29
|
+
this.saveDirectory = process.env.AI_IMAGE_SAVE_PATH || path.join(os.homedir(), "generated_images");
|
|
30
30
|
if (!this.apiKey) {
|
|
31
31
|
throw new Error("AI_API_KEY 環境變數未設定");
|
|
32
32
|
}
|
|
33
|
-
//
|
|
34
|
-
this.
|
|
33
|
+
// 確保保存目錄存在
|
|
34
|
+
if (!fs.existsSync(this.saveDirectory)) {
|
|
35
|
+
fs.mkdirSync(this.saveDirectory, { recursive: true });
|
|
36
|
+
}
|
|
35
37
|
this.setupToolHandlers();
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
generateFilename(prompt) {
|
|
40
|
+
// 清理 prompt 作為檔名,移除特殊字符並限制長度
|
|
41
|
+
const cleanPrompt = prompt
|
|
42
|
+
.replace(/[^\w\s\u4e00-\u9fff]/g, '') // 保留字母、數字、空格和中文字符
|
|
43
|
+
.replace(/\s+/g, '-') // 將空格替換為連字符
|
|
44
|
+
.substring(0, 50); // 限制長度為50字符
|
|
45
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
46
|
+
return `${cleanPrompt}-${timestamp}.jpg`;
|
|
47
|
+
}
|
|
48
|
+
async downloadAndSaveImage(imageUrl, filename) {
|
|
38
49
|
try {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
const response = await axios.get(imageUrl, { responseType: 'stream' });
|
|
51
|
+
const filePath = path.join(this.saveDirectory, filename);
|
|
52
|
+
const writer = fs.createWriteStream(filePath);
|
|
53
|
+
response.data.pipe(writer);
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
writer.on('finish', () => resolve(filePath));
|
|
56
|
+
writer.on('error', reject);
|
|
57
|
+
});
|
|
43
58
|
}
|
|
44
59
|
catch (error) {
|
|
45
|
-
|
|
60
|
+
throw new Error(`圖片下載失敗: ${error instanceof Error ? error.message : String(error)}`);
|
|
46
61
|
}
|
|
47
62
|
}
|
|
63
|
+
extractImageUrlFromContent(content) {
|
|
64
|
+
// 嘗試從回應中提取圖片 URL
|
|
65
|
+
const urlPatterns = [
|
|
66
|
+
/https?:\/\/[^\s\)]+\.(?:jpg|jpeg|png|gif|webp)/gi,
|
|
67
|
+
/!\[.*?\]\((https?:\/\/[^\)]+)\)/gi,
|
|
68
|
+
/https?:\/\/[^\s\)]+/gi
|
|
69
|
+
];
|
|
70
|
+
for (const pattern of urlPatterns) {
|
|
71
|
+
const matches = content.match(pattern);
|
|
72
|
+
if (matches && matches.length > 0) {
|
|
73
|
+
const url = matches[0].replace(/^\!\[.*?\]\(/, '').replace(/\)$/, '');
|
|
74
|
+
if (url.match(/\.(jpg|jpeg|png|gif|webp)(\?.*)?$/i)) {
|
|
75
|
+
return url;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
48
81
|
setupToolHandlers() {
|
|
49
82
|
// 列出可用工具
|
|
50
83
|
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
@@ -70,11 +103,6 @@ class AIImageChatMCPServer {
|
|
|
70
103
|
enum: ["gpt-image-1", "gpt-4o-image"],
|
|
71
104
|
default: "gpt-4o-image",
|
|
72
105
|
},
|
|
73
|
-
save_image: {
|
|
74
|
-
type: "boolean",
|
|
75
|
-
description: "是否自動保存圖片到本地(預設為 true)",
|
|
76
|
-
default: true,
|
|
77
|
-
},
|
|
78
106
|
},
|
|
79
107
|
required: ["prompt"],
|
|
80
108
|
},
|
|
@@ -126,40 +154,8 @@ class AIImageChatMCPServer {
|
|
|
126
154
|
}
|
|
127
155
|
});
|
|
128
156
|
}
|
|
129
|
-
async downloadAndSaveImage(imageUrl, filename) {
|
|
130
|
-
try {
|
|
131
|
-
const response = await axios.get(imageUrl, {
|
|
132
|
-
responseType: 'stream',
|
|
133
|
-
timeout: 30000,
|
|
134
|
-
});
|
|
135
|
-
// 生成檔案名稱
|
|
136
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
137
|
-
const finalFilename = filename || `ai-generated-${timestamp}.jpg`;
|
|
138
|
-
const filepath = path.join(this.outputDir, finalFilename);
|
|
139
|
-
// 建立寫入串流
|
|
140
|
-
const writer = fs.createWriteStream(filepath);
|
|
141
|
-
response.data.pipe(writer);
|
|
142
|
-
return new Promise((resolve, reject) => {
|
|
143
|
-
writer.on('finish', () => {
|
|
144
|
-
console.error(`圖片已保存至: ${filepath}`);
|
|
145
|
-
resolve(filepath);
|
|
146
|
-
});
|
|
147
|
-
writer.on('error', reject);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
console.error(`下載圖片失敗: ${error}`);
|
|
152
|
-
throw error;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
extractImageUrl(content) {
|
|
156
|
-
// 嘗試從回應中提取圖片 URL
|
|
157
|
-
const urlRegex = /https?:\/\/[^\s\)]+\.(jpg|jpeg|png|gif|webp)/gi;
|
|
158
|
-
const match = content.match(urlRegex);
|
|
159
|
-
return match ? match[0] : null;
|
|
160
|
-
}
|
|
161
157
|
async handleImageGeneration(args) {
|
|
162
|
-
const { prompt, system_prompt = "You are a helpful assistant that generates images.
|
|
158
|
+
const { prompt, system_prompt = "You are a helpful assistant that generates images.", model = "gpt-4o-image" } = args;
|
|
163
159
|
if (!prompt) {
|
|
164
160
|
throw new McpError(ErrorCode.InvalidParams, "需要提供 prompt 參數");
|
|
165
161
|
}
|
|
@@ -180,29 +176,28 @@ class AIImageChatMCPServer {
|
|
|
180
176
|
});
|
|
181
177
|
const result = response.data;
|
|
182
178
|
const generatedContent = result.choices[0]?.message?.content || "未生成內容";
|
|
183
|
-
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
savedImagePath = await this.downloadAndSaveImage(imageUrl);
|
|
191
|
-
resultText += `\n\n✅ 圖片已自動保存至: ${savedImagePath}`;
|
|
192
|
-
}
|
|
193
|
-
catch (error) {
|
|
194
|
-
resultText += `\n\n⚠️ 圖片下載失敗: ${error instanceof Error ? error.message : String(error)}`;
|
|
195
|
-
}
|
|
179
|
+
// 嘗試從回應中提取圖片 URL 並保存
|
|
180
|
+
let savedImagePath = "";
|
|
181
|
+
const imageUrl = this.extractImageUrlFromContent(generatedContent);
|
|
182
|
+
if (imageUrl) {
|
|
183
|
+
try {
|
|
184
|
+
const filename = this.generateFilename(prompt);
|
|
185
|
+
savedImagePath = await this.downloadAndSaveImage(imageUrl, filename);
|
|
196
186
|
}
|
|
197
|
-
|
|
198
|
-
|
|
187
|
+
catch (saveError) {
|
|
188
|
+
console.error("圖片保存失敗:", saveError);
|
|
189
|
+
// 繼續執行,不因保存失敗而中斷
|
|
199
190
|
}
|
|
200
191
|
}
|
|
192
|
+
let responseText = `圖片生成結果:\n\n${generatedContent}`;
|
|
193
|
+
if (savedImagePath) {
|
|
194
|
+
responseText += `\n\n✅ 圖片已自動保存至: ${savedImagePath}`;
|
|
195
|
+
}
|
|
201
196
|
return {
|
|
202
197
|
content: [
|
|
203
198
|
{
|
|
204
199
|
type: "text",
|
|
205
|
-
text:
|
|
200
|
+
text: responseText,
|
|
206
201
|
},
|
|
207
202
|
],
|
|
208
203
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GAET,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,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,UAAU,GAAG,KAAwB,CAAC;gBAC5C,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC;gBACrF,MAAM,IAAI,QAAQ,CAChB,SAAS,CAAC,aAAa,EACvB,aAAa,YAAY,EAAE,CAC5B,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,QAAQ,CAChB,SAAS,CAAC,aAAa,EACvB,SAAS,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAClE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC5C,CAAC;CACF;AAED,QAAQ;AACR,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC1C,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;IAClC,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bashcat/ai-image-chat-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "MCP server for AI image generation and chat completion with support for multiple AI providers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"url": "https://github.com/bashcat/ai-image-chat-mcp.git"
|
|
41
41
|
},
|
|
42
42
|
"bugs": {
|
|
43
|
-
"url": "https://github.com/
|
|
43
|
+
"url": "https://github.com/oliver0804/"
|
|
44
44
|
},
|
|
45
|
-
"homepage": "https://
|
|
45
|
+
"homepage": "https://bashcat.net/",
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|
|
48
48
|
"README.md",
|