@alfe.ai/notion-mcp 0.3.16 → 0.3.18

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.
@@ -0,0 +1,95 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
+
4
+ //#region src/boundary.d.ts
5
+
6
+ interface ChildToolDescriptor {
7
+ name: string;
8
+ title?: string;
9
+ description?: string;
10
+ inputSchema: unknown;
11
+ outputSchema?: unknown;
12
+ annotations?: {
13
+ title?: string;
14
+ readOnlyHint?: boolean;
15
+ destructiveHint?: boolean;
16
+ idempotentHint?: boolean;
17
+ openWorldHint?: boolean;
18
+ };
19
+ execution?: {
20
+ taskSupport?: "optional" | "required" | "forbidden";
21
+ };
22
+ }
23
+ interface ProxiedTool {
24
+ name: string;
25
+ title?: string;
26
+ description?: string;
27
+ inputSchema: Record<string, JsonValue>;
28
+ outputSchema?: Record<string, JsonValue>;
29
+ annotations?: ChildToolDescriptor["annotations"];
30
+ execution?: ChildToolDescriptor["execution"];
31
+ }
32
+ type JsonPrimitive = null | boolean | number | string;
33
+ type JsonValue = JsonPrimitive | JsonValue[] | {
34
+ [key: string]: JsonValue;
35
+ };
36
+ //#endregion
37
+ //#region src/server.d.ts
38
+ declare const SERVER_VERSION: string;
39
+ declare const CHILD_VERSION: string;
40
+ declare const CHILD_BIN_PATH: string;
41
+ interface NotionApiClient {
42
+ getNotionAccounts(): Promise<unknown>;
43
+ }
44
+ interface NotionChildClient {
45
+ listTools(): Promise<{
46
+ tools: ChildToolDescriptor[];
47
+ }>;
48
+ callTool(request: {
49
+ name: string;
50
+ arguments?: Record<string, unknown>;
51
+ }): Promise<unknown>;
52
+ close(): Promise<void>;
53
+ }
54
+ interface NotionProxyOptions {
55
+ spawnChild?: (accessToken: string, signal: AbortSignal) => Promise<NotionChildClient>;
56
+ fetchImpl?: typeof fetch;
57
+ }
58
+ interface ToolCallRequest {
59
+ params: {
60
+ name: string;
61
+ arguments?: Record<string, unknown>;
62
+ };
63
+ }
64
+ declare class NotionRuntime {
65
+ private readonly apiClient;
66
+ private readonly workspaces;
67
+ private readonly claimedWorkspaceIds;
68
+ private readonly allAccountsSnapshot;
69
+ private readonly catalogToolNames;
70
+ private cachedTools;
71
+ private closePromise;
72
+ private readonly spawnChild;
73
+ private readonly fetchImpl;
74
+ constructor(apiClient: NotionApiClient, options?: NotionProxyOptions);
75
+ initialize(): Promise<void>;
76
+ listTools(): ProxiedTool[];
77
+ handleToolCall(request: ToolCallRequest): Promise<CallToolResult>;
78
+ close(): Promise<void>;
79
+ private loadAccounts;
80
+ private discoverChildCatalog;
81
+ private resolveWorkspace;
82
+ }
83
+ declare function createProxyServer(apiClient: NotionApiClient, options?: NotionProxyOptions): Promise<{
84
+ server: Server;
85
+ runtime: NotionRuntime;
86
+ }>;
87
+ interface RunningNotionProxy {
88
+ server: Server;
89
+ runtime: NotionRuntime;
90
+ close(): Promise<void>;
91
+ }
92
+ declare function startServer(apiClient?: NotionApiClient, options?: NotionProxyOptions): Promise<RunningNotionProxy>;
93
+ declare function isProcessEntrypoint(argvPath: string | undefined, metaUrl: string): boolean;
94
+ //#endregion
95
+ export { CHILD_BIN_PATH, CHILD_VERSION, NotionApiClient, NotionChildClient, NotionProxyOptions, NotionRuntime, RunningNotionProxy, SERVER_VERSION, createProxyServer, isProcessEntrypoint, startServer };
package/dist/server.d.ts CHANGED
@@ -1 +1,95 @@
1
- export {};
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
+
4
+ //#region src/boundary.d.ts
5
+
6
+ interface ChildToolDescriptor {
7
+ name: string;
8
+ title?: string;
9
+ description?: string;
10
+ inputSchema: unknown;
11
+ outputSchema?: unknown;
12
+ annotations?: {
13
+ title?: string;
14
+ readOnlyHint?: boolean;
15
+ destructiveHint?: boolean;
16
+ idempotentHint?: boolean;
17
+ openWorldHint?: boolean;
18
+ };
19
+ execution?: {
20
+ taskSupport?: "optional" | "required" | "forbidden";
21
+ };
22
+ }
23
+ interface ProxiedTool {
24
+ name: string;
25
+ title?: string;
26
+ description?: string;
27
+ inputSchema: Record<string, JsonValue>;
28
+ outputSchema?: Record<string, JsonValue>;
29
+ annotations?: ChildToolDescriptor["annotations"];
30
+ execution?: ChildToolDescriptor["execution"];
31
+ }
32
+ type JsonPrimitive = null | boolean | number | string;
33
+ type JsonValue = JsonPrimitive | JsonValue[] | {
34
+ [key: string]: JsonValue;
35
+ };
36
+ //#endregion
37
+ //#region src/server.d.ts
38
+ declare const SERVER_VERSION: string;
39
+ declare const CHILD_VERSION: string;
40
+ declare const CHILD_BIN_PATH: string;
41
+ interface NotionApiClient {
42
+ getNotionAccounts(): Promise<unknown>;
43
+ }
44
+ interface NotionChildClient {
45
+ listTools(): Promise<{
46
+ tools: ChildToolDescriptor[];
47
+ }>;
48
+ callTool(request: {
49
+ name: string;
50
+ arguments?: Record<string, unknown>;
51
+ }): Promise<unknown>;
52
+ close(): Promise<void>;
53
+ }
54
+ interface NotionProxyOptions {
55
+ spawnChild?: (accessToken: string, signal: AbortSignal) => Promise<NotionChildClient>;
56
+ fetchImpl?: typeof fetch;
57
+ }
58
+ interface ToolCallRequest {
59
+ params: {
60
+ name: string;
61
+ arguments?: Record<string, unknown>;
62
+ };
63
+ }
64
+ declare class NotionRuntime {
65
+ private readonly apiClient;
66
+ private readonly workspaces;
67
+ private readonly claimedWorkspaceIds;
68
+ private readonly allAccountsSnapshot;
69
+ private readonly catalogToolNames;
70
+ private cachedTools;
71
+ private closePromise;
72
+ private readonly spawnChild;
73
+ private readonly fetchImpl;
74
+ constructor(apiClient: NotionApiClient, options?: NotionProxyOptions);
75
+ initialize(): Promise<void>;
76
+ listTools(): ProxiedTool[];
77
+ handleToolCall(request: ToolCallRequest): Promise<CallToolResult>;
78
+ close(): Promise<void>;
79
+ private loadAccounts;
80
+ private discoverChildCatalog;
81
+ private resolveWorkspace;
82
+ }
83
+ declare function createProxyServer(apiClient: NotionApiClient, options?: NotionProxyOptions): Promise<{
84
+ server: Server;
85
+ runtime: NotionRuntime;
86
+ }>;
87
+ interface RunningNotionProxy {
88
+ server: Server;
89
+ runtime: NotionRuntime;
90
+ close(): Promise<void>;
91
+ }
92
+ declare function startServer(apiClient?: NotionApiClient, options?: NotionProxyOptions): Promise<RunningNotionProxy>;
93
+ declare function isProcessEntrypoint(argvPath: string | undefined, metaUrl: string): boolean;
94
+ //#endregion
95
+ export { CHILD_BIN_PATH, CHILD_VERSION, NotionApiClient, NotionChildClient, NotionProxyOptions, NotionRuntime, RunningNotionProxy, SERVER_VERSION, createProxyServer, isProcessEntrypoint, startServer };