note-mcp-server 2.2.9 → 2.3.2
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/index.js +27 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -76,7 +76,7 @@ const APP_NAME = firstEnv("app_name", "APP_NAME", "notes_app_name", "NOTES_APP_N
|
|
|
76
76
|
const server = new Server(
|
|
77
77
|
{
|
|
78
78
|
name: `note-mcp-server (${APP_NAME})`,
|
|
79
|
-
version: "2.
|
|
79
|
+
version: "2.3.0",
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
capabilities: {
|
|
@@ -172,14 +172,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
172
172
|
{
|
|
173
173
|
name: "create_note",
|
|
174
174
|
description: withSecurityNotice(
|
|
175
|
-
`在 ${APP_NAME} 中新增筆記。內容請優先使用簡潔的 AdminLTE 4 card
|
|
175
|
+
`在 ${APP_NAME} 中新增筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構。\nAI 行為:除非用戶明確要求,否則不要傳 tags(勿自行推測、分類或補加標籤)。`
|
|
176
176
|
),
|
|
177
177
|
inputSchema: {
|
|
178
178
|
type: "object",
|
|
179
179
|
properties: {
|
|
180
180
|
content: { type: "string", description: "HTML 或純文字內容" },
|
|
181
181
|
title: { type: "string", description: "標題(可選)" },
|
|
182
|
-
tags: {
|
|
182
|
+
tags: {
|
|
183
|
+
type: "string",
|
|
184
|
+
description:
|
|
185
|
+
"標籤,多個以逗號分隔(可選;僅當用戶明確要求設定標籤時才傳,勿主動填寫)",
|
|
186
|
+
},
|
|
183
187
|
},
|
|
184
188
|
required: ["content"],
|
|
185
189
|
},
|
|
@@ -187,15 +191,28 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
187
191
|
{
|
|
188
192
|
name: "update_note",
|
|
189
193
|
description: withSecurityNotice(
|
|
190
|
-
`在 ${APP_NAME} 中修改筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構,避免嵌套破版,支援以 append/prepend
|
|
194
|
+
`在 ${APP_NAME} 中修改筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構,避免嵌套破版,支援以 append/prepend 追加內容。\nAI 行為:除非用戶明確要求,否則不要傳 tags、add_tags(勿自行推測或補加標籤);亦不要傳 title,除非用戶明確要求變更標題。\n標籤語意:tags=整包覆寫既有標籤;add_tags=在既有標籤上追加(逗號分隔),勿刪除未提及的標籤。用戶只要「多加幾個標籤」時請用 add_tags,勿用 tags。`
|
|
191
195
|
),
|
|
192
196
|
inputSchema: {
|
|
193
197
|
type: "object",
|
|
194
198
|
properties: {
|
|
195
199
|
c_id: { type: "number", description: "筆記 ID" },
|
|
196
200
|
content: { type: "string", description: "新內容(可選,若未傳則使用現有內容作為基底)" },
|
|
197
|
-
title: {
|
|
198
|
-
|
|
201
|
+
title: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description:
|
|
204
|
+
"新標題(可選;僅當用戶明確要求變更標題時才傳,勿為「優化」或推測而擅自改標題)",
|
|
205
|
+
},
|
|
206
|
+
tags: {
|
|
207
|
+
type: "string",
|
|
208
|
+
description:
|
|
209
|
+
"新標籤,多個以逗號分隔(可選;僅當用戶明確要求「整包重設」標籤時才傳,會覆寫既有全部標籤;勿主動填寫)",
|
|
210
|
+
},
|
|
211
|
+
add_tags: {
|
|
212
|
+
type: "string",
|
|
213
|
+
description:
|
|
214
|
+
"僅追加標籤,多個以逗號分隔(可選;與既有標籤合併、不覆寫未列出的標籤。僅當用戶明確要求「在現有標籤上多加」時才傳;勿主動填寫)",
|
|
215
|
+
},
|
|
199
216
|
append: { type: "string", description: "追加在結尾的內容(可選)" },
|
|
200
217
|
prepend: { type: "string", description: "追加在開頭的內容(可選)" },
|
|
201
218
|
},
|
|
@@ -229,7 +246,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
229
246
|
{
|
|
230
247
|
name: "upload_image",
|
|
231
248
|
description: withSecurityNotice(
|
|
232
|
-
`將圖片上傳至 ${APP_NAME}。此工具會回傳圖片的永久網址(URL)。若用戶要求生成圖片及內容,請務必分兩步執行:1. 先呼叫此工具傳圖獲取網址;2. 將獲取的網址以 <img> 標籤補進筆記內容(create_note 或 update_note
|
|
249
|
+
`將圖片上傳至 ${APP_NAME}。此工具會回傳圖片的永久網址(URL)。若用戶要求生成圖片及內容,請務必分兩步執行:1. 先呼叫此工具傳圖獲取網址;2. 將獲取的網址以 <img> 標籤補進筆記內容(create_note 或 update_note)中。\n⚠️ 極度重要:如果圖檔為本機實體檔案且體積較大,直接透過本工具傳遞 Base64 極易因終端機輸出字數限制而被截斷,導致上傳損壞的圖片(破圖)且 API 不會報錯。\n✅ AI 最佳實踐:若遇到大圖或本地實體圖,請優先去讀取本 MCP 伺服器目錄下的 .env 以取得 \`notes_url\`, \`socialite\`, \`key\`,然後「直接使用原生的 curl -X POST」發送 multipart/form-data (image=@路徑) 到 API,完全繞過 MCP 工具的限制!`
|
|
233
250
|
),
|
|
234
251
|
inputSchema: {
|
|
235
252
|
type: "object",
|
|
@@ -350,6 +367,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
350
367
|
if (args.tags !== undefined) {
|
|
351
368
|
payload.tags = args.tags;
|
|
352
369
|
}
|
|
370
|
+
if (args.add_tags !== undefined && args.add_tags !== "") {
|
|
371
|
+
payload.add_tags = args.add_tags;
|
|
372
|
+
}
|
|
353
373
|
if (args.append !== undefined) {
|
|
354
374
|
payload.append = args.append;
|
|
355
375
|
}
|
package/package.json
CHANGED