note-mcp-server 2.2.5 → 2.2.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 +13 -0
- package/index.js +26 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,19 @@ socialite_id=eyJpdiI6I…
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
+
## Agent 安全流程(重要)
|
|
127
|
+
|
|
128
|
+
- 只要使用者貼出或提到敏感設定(例如 `key`、`token`、`NOTES_API_BASE`、`socialite_id`),完成設定或操作後,代理必須主動執行:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
echo -n "" | pbcopy
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- 回覆中必須明確告知「剪貼簿已清空」。
|
|
135
|
+
- 此流程屬於預設安全規範,不需等待使用者額外提醒。
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
126
139
|
## 常見問題
|
|
127
140
|
|
|
128
141
|
### 啟動失敗、訊息請建立 `.env`
|
package/index.js
CHANGED
|
@@ -120,6 +120,13 @@ function resolveNotesSiteBase() {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
const NOTES_SITE_BASE = resolveNotesSiteBase();
|
|
123
|
+
const SECURITY_NOTICE =
|
|
124
|
+
"安全規範:若使用者訊息或設定包含 key、token、NOTES_API_BASE、socialite_id 等敏感資訊,完成操作後必須主動清空 macOS 剪貼簿(echo -n \"\" | pbcopy),並在回覆中明確告知已清空。";
|
|
125
|
+
const NOTE_URL_NOTICE = `前台連結格式:${NOTES_SITE_BASE}/app/notes/content/{c_id}。`;
|
|
126
|
+
|
|
127
|
+
function withSecurityNotice(description) {
|
|
128
|
+
return `${description}\n${NOTE_URL_NOTICE}\n${SECURITY_NOTICE}`;
|
|
129
|
+
}
|
|
123
130
|
|
|
124
131
|
function buildNoteUrl(cId) {
|
|
125
132
|
if (cId === undefined || cId === null || String(cId).trim() === "") {
|
|
@@ -133,7 +140,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
133
140
|
tools: [
|
|
134
141
|
{
|
|
135
142
|
name: "list_notes",
|
|
136
|
-
description:
|
|
143
|
+
description: withSecurityNotice(
|
|
144
|
+
`列出或搜尋 ${APP_NAME} 中的筆記。支援關鍵字、標籤搜尋及分頁(預設每頁 10 筆)。回傳資料會附上 note_url。`
|
|
145
|
+
),
|
|
137
146
|
inputSchema: {
|
|
138
147
|
type: "object",
|
|
139
148
|
properties: {
|
|
@@ -146,7 +155,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
146
155
|
},
|
|
147
156
|
{
|
|
148
157
|
name: "read_note",
|
|
149
|
-
description:
|
|
158
|
+
description: withSecurityNotice(
|
|
159
|
+
`從 ${APP_NAME} 讀取單筆筆記(GET ?c_id=)。亦可傳 c_id=last 讀取最新一筆。回傳資料會附上 note_url。`
|
|
160
|
+
),
|
|
150
161
|
inputSchema: {
|
|
151
162
|
type: "object",
|
|
152
163
|
properties: {
|
|
@@ -160,9 +171,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
160
171
|
},
|
|
161
172
|
{
|
|
162
173
|
name: "create_note",
|
|
163
|
-
description:
|
|
164
|
-
`在 ${APP_NAME} 中新增筆記。內容請優先使用簡潔的 AdminLTE 4 card
|
|
165
|
-
|
|
174
|
+
description: withSecurityNotice(
|
|
175
|
+
`在 ${APP_NAME} 中新增筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構。`
|
|
176
|
+
),
|
|
166
177
|
inputSchema: {
|
|
167
178
|
type: "object",
|
|
168
179
|
properties: {
|
|
@@ -174,7 +185,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
174
185
|
},
|
|
175
186
|
{
|
|
176
187
|
name: "update_note",
|
|
177
|
-
description:
|
|
188
|
+
description: withSecurityNotice(
|
|
189
|
+
`在 ${APP_NAME} 中修改筆記。內容請優先使用簡潔的 AdminLTE 4 card 結構,避免嵌套破版,支援以 append/prepend 追加內容。`
|
|
190
|
+
),
|
|
178
191
|
inputSchema: {
|
|
179
192
|
type: "object",
|
|
180
193
|
properties: {
|
|
@@ -189,7 +202,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
189
202
|
},
|
|
190
203
|
{
|
|
191
204
|
name: "delete_note",
|
|
192
|
-
description: "刪除筆記(POST:c_id + action=delete)。",
|
|
205
|
+
description: withSecurityNotice("刪除筆記(POST:c_id + action=delete)。"),
|
|
193
206
|
inputSchema: {
|
|
194
207
|
type: "object",
|
|
195
208
|
properties: {
|
|
@@ -200,8 +213,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
200
213
|
},
|
|
201
214
|
{
|
|
202
215
|
name: "upload_image",
|
|
203
|
-
description:
|
|
204
|
-
`將圖片上傳至 ${APP_NAME}。此工具會回傳圖片的永久網址(URL)。若用戶要求生成圖片及內容,請務必分兩步執行:1. 先呼叫此工具傳圖獲取網址;2. 將獲取的網址以 <img> 標籤補進筆記內容(create_note 或 update_note
|
|
216
|
+
description: withSecurityNotice(
|
|
217
|
+
`將圖片上傳至 ${APP_NAME}。此工具會回傳圖片的永久網址(URL)。若用戶要求生成圖片及內容,請務必分兩步執行:1. 先呼叫此工具傳圖獲取網址;2. 將獲取的網址以 <img> 標籤補進筆記內容(create_note 或 update_note)中。`
|
|
218
|
+
),
|
|
205
219
|
inputSchema: {
|
|
206
220
|
type: "object",
|
|
207
221
|
properties: {
|
|
@@ -219,7 +233,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
219
233
|
},
|
|
220
234
|
{
|
|
221
235
|
name: "send_push",
|
|
222
|
-
description:
|
|
236
|
+
description: withSecurityNotice(
|
|
237
|
+
"發送 Web Push(POST:action=push、message;可選 title、url)。"
|
|
238
|
+
),
|
|
223
239
|
inputSchema: {
|
|
224
240
|
type: "object",
|
|
225
241
|
properties: {
|
package/package.json
CHANGED