@getnote/mcp 1.4.1 → 1.4.3
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/dist/index.js +9 -5
- package/package.json +1 -1
- package/src/index.ts +12 -5
package/dist/index.js
CHANGED
|
@@ -45,6 +45,10 @@ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
|
45
45
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
46
46
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
47
47
|
const client_js_1 = require("./client.js");
|
|
48
|
+
const node_fs_1 = require("node:fs");
|
|
49
|
+
const node_path_1 = require("node:path");
|
|
50
|
+
const pkg = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, "..", "package.json"), "utf-8"));
|
|
51
|
+
const SERVER_VERSION = pkg.version;
|
|
48
52
|
// ─── Config ──────────────────────────────────────────────────────────────────
|
|
49
53
|
function getApiKey() {
|
|
50
54
|
// 1. --api-key flag
|
|
@@ -82,9 +86,9 @@ const TOOLS = [
|
|
|
82
86
|
type: "object",
|
|
83
87
|
properties: {
|
|
84
88
|
since_id: {
|
|
85
|
-
type:
|
|
86
|
-
description: "游标,返回 ID 小于此值的笔记。首次传 0",
|
|
87
|
-
default: 0,
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "游标,返回 ID 小于此值的笔记。首次传 \"0\",后续传上一页最后一条笔记的 note_id(字符串格式,禁止转为 number,笔记 ID 为 19 位整数会超过 JS 精度上限)",
|
|
91
|
+
default: "0",
|
|
88
92
|
},
|
|
89
93
|
},
|
|
90
94
|
required: [],
|
|
@@ -598,7 +602,7 @@ async function handleTool(name, input, client) {
|
|
|
598
602
|
switch (name) {
|
|
599
603
|
// ── Notes ──
|
|
600
604
|
case "list_notes": {
|
|
601
|
-
const since_id = input.since_id ?? 0;
|
|
605
|
+
const since_id = String(input.since_id ?? "0");
|
|
602
606
|
return client.listNotes({ since_id });
|
|
603
607
|
}
|
|
604
608
|
case "get_note": {
|
|
@@ -792,7 +796,7 @@ async function main() {
|
|
|
792
796
|
const client = new client_js_1.GetNoteClient(apiKey, clientId);
|
|
793
797
|
const server = new index_js_1.Server({
|
|
794
798
|
name: "getnote-mcp",
|
|
795
|
-
version:
|
|
799
|
+
version: SERVER_VERSION,
|
|
796
800
|
}, {
|
|
797
801
|
capabilities: {
|
|
798
802
|
tools: {},
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -16,6 +16,13 @@ import {
|
|
|
16
16
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
import { GetNoteClient, GetNoteAPIError, SaveNoteReq, UpdateNoteReq } from "./client.js";
|
|
19
|
+
import { readFileSync } from "node:fs";
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
|
|
22
|
+
const pkg = JSON.parse(
|
|
23
|
+
readFileSync(join(__dirname, "..", "package.json"), "utf-8")
|
|
24
|
+
) as { version: string };
|
|
25
|
+
const SERVER_VERSION: string = pkg.version;
|
|
19
26
|
|
|
20
27
|
// ─── Config ──────────────────────────────────────────────────────────────────
|
|
21
28
|
|
|
@@ -63,9 +70,9 @@ const TOOLS: Tool[] = [
|
|
|
63
70
|
type: "object" as const,
|
|
64
71
|
properties: {
|
|
65
72
|
since_id: {
|
|
66
|
-
type:
|
|
67
|
-
description: "游标,返回 ID 小于此值的笔记。首次传 0",
|
|
68
|
-
default: 0,
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "游标,返回 ID 小于此值的笔记。首次传 \"0\",后续传上一页最后一条笔记的 note_id(字符串格式,禁止转为 number,笔记 ID 为 19 位整数会超过 JS 精度上限)",
|
|
75
|
+
default: "0",
|
|
69
76
|
},
|
|
70
77
|
},
|
|
71
78
|
required: [],
|
|
@@ -615,7 +622,7 @@ async function handleTool(
|
|
|
615
622
|
switch (name) {
|
|
616
623
|
// ── Notes ──
|
|
617
624
|
case "list_notes": {
|
|
618
|
-
const since_id = (input.since_id as number | string | undefined) ?? 0;
|
|
625
|
+
const since_id = String((input.since_id as number | string | undefined) ?? "0");
|
|
619
626
|
return client.listNotes({ since_id });
|
|
620
627
|
}
|
|
621
628
|
case "get_note": {
|
|
@@ -823,7 +830,7 @@ async function main() {
|
|
|
823
830
|
const server = new Server(
|
|
824
831
|
{
|
|
825
832
|
name: "getnote-mcp",
|
|
826
|
-
version:
|
|
833
|
+
version: SERVER_VERSION,
|
|
827
834
|
},
|
|
828
835
|
{
|
|
829
836
|
capabilities: {
|