@hskksk/mem-ai-mcp-server 0.1.0
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/LICENSE +21 -0
- package/README.md +215 -0
- package/dist/client/mem-api-client.d.ts +63 -0
- package/dist/client/mem-api-client.d.ts.map +1 -0
- package/dist/client/mem-api-client.js +169 -0
- package/dist/client/mem-api-client.js.map +1 -0
- package/dist/config/env.d.ts +24 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/env.js +16 -0
- package/dist/config/env.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +43 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +91 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/base-tool.d.ts +26 -0
- package/dist/tools/base-tool.d.ts.map +1 -0
- package/dist/tools/base-tool.js +64 -0
- package/dist/tools/base-tool.js.map +1 -0
- package/dist/tools/collections/create-collection.d.ts +10 -0
- package/dist/tools/collections/create-collection.d.ts.map +1 -0
- package/dist/tools/collections/create-collection.js +19 -0
- package/dist/tools/collections/create-collection.js.map +1 -0
- package/dist/tools/collections/delete-collection.d.ts +10 -0
- package/dist/tools/collections/delete-collection.d.ts.map +1 -0
- package/dist/tools/collections/delete-collection.js +18 -0
- package/dist/tools/collections/delete-collection.js.map +1 -0
- package/dist/tools/collections/get-collection.d.ts +10 -0
- package/dist/tools/collections/get-collection.d.ts.map +1 -0
- package/dist/tools/collections/get-collection.js +18 -0
- package/dist/tools/collections/get-collection.js.map +1 -0
- package/dist/tools/collections/list-collections.d.ts +10 -0
- package/dist/tools/collections/list-collections.d.ts.map +1 -0
- package/dist/tools/collections/list-collections.js +15 -0
- package/dist/tools/collections/list-collections.js.map +1 -0
- package/dist/tools/collections/search-collections.d.ts +10 -0
- package/dist/tools/collections/search-collections.d.ts.map +1 -0
- package/dist/tools/collections/search-collections.js +20 -0
- package/dist/tools/collections/search-collections.js.map +1 -0
- package/dist/tools/mem-it.d.ts +10 -0
- package/dist/tools/mem-it.d.ts.map +1 -0
- package/dist/tools/mem-it.js +21 -0
- package/dist/tools/mem-it.js.map +1 -0
- package/dist/tools/notes/create-note.d.ts +10 -0
- package/dist/tools/notes/create-note.d.ts.map +1 -0
- package/dist/tools/notes/create-note.js +23 -0
- package/dist/tools/notes/create-note.js.map +1 -0
- package/dist/tools/notes/delete-note.d.ts +10 -0
- package/dist/tools/notes/delete-note.d.ts.map +1 -0
- package/dist/tools/notes/delete-note.js +18 -0
- package/dist/tools/notes/delete-note.js.map +1 -0
- package/dist/tools/notes/get-note.d.ts +10 -0
- package/dist/tools/notes/get-note.d.ts.map +1 -0
- package/dist/tools/notes/get-note.js +18 -0
- package/dist/tools/notes/get-note.js.map +1 -0
- package/dist/tools/notes/list-notes.d.ts +10 -0
- package/dist/tools/notes/list-notes.d.ts.map +1 -0
- package/dist/tools/notes/list-notes.js +15 -0
- package/dist/tools/notes/list-notes.js.map +1 -0
- package/dist/tools/notes/search-notes.d.ts +10 -0
- package/dist/tools/notes/search-notes.d.ts.map +1 -0
- package/dist/tools/notes/search-notes.js +20 -0
- package/dist/tools/notes/search-notes.js.map +1 -0
- package/dist/types/api.d.ts +81 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +5 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/tools.d.ts +41 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +2 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/utils/error-handler.d.ts +41 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +65 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool } from '../base-tool.js';
|
|
3
|
+
const searchNotesSchema = z.object({
|
|
4
|
+
query: z.string().describe('Search query'),
|
|
5
|
+
limit: z.number().int().positive().max(100).optional().describe('Maximum number of results (max 100)'),
|
|
6
|
+
offset: z.number().int().nonnegative().optional().describe('Number of results to skip'),
|
|
7
|
+
});
|
|
8
|
+
/**
|
|
9
|
+
* Tool for searching notes
|
|
10
|
+
*/
|
|
11
|
+
export class SearchNotesTool extends BaseTool {
|
|
12
|
+
constructor(client) {
|
|
13
|
+
super('search_notes', 'Search across all notes in mem.ai.', searchNotesSchema, client);
|
|
14
|
+
}
|
|
15
|
+
async execute(params) {
|
|
16
|
+
const validated = params;
|
|
17
|
+
return this.client.searchNotes(validated);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=search-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-notes.js","sourceRoot":"","sources":["../../../src/tools/notes/search-notes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACtG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACxF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAC3C,YAAY,MAAoB;QAC9B,KAAK,CACH,cAAc,EACd,oCAAoC,EACpC,iBAAiB,EACjB,MAAM,CACP,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,MAAe;QACrC,MAAM,SAAS,GAAG,MAA2C,CAAC;QAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for mem.ai API requests and responses
|
|
3
|
+
*/
|
|
4
|
+
export interface MemItRequest {
|
|
5
|
+
input: string;
|
|
6
|
+
instructions?: string;
|
|
7
|
+
context?: string;
|
|
8
|
+
timestamp?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MemItResponse {
|
|
11
|
+
request_id: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Note {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
content: string;
|
|
17
|
+
collection_ids: string[];
|
|
18
|
+
created_at: string;
|
|
19
|
+
updated_at: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateNoteRequest {
|
|
22
|
+
content: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
collection_ids?: string[];
|
|
25
|
+
collection_titles?: string[];
|
|
26
|
+
created_at?: string;
|
|
27
|
+
updated_at?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CreateNoteResponse extends Note {
|
|
30
|
+
request_id: string;
|
|
31
|
+
}
|
|
32
|
+
export interface GetNoteResponse extends Note {
|
|
33
|
+
}
|
|
34
|
+
export interface DeleteNoteResponse {
|
|
35
|
+
success: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ListNotesResponse {
|
|
38
|
+
notes: Note[];
|
|
39
|
+
}
|
|
40
|
+
export interface SearchNotesRequest {
|
|
41
|
+
query: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
offset?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface SearchNotesResponse {
|
|
46
|
+
notes: Note[];
|
|
47
|
+
total: number;
|
|
48
|
+
}
|
|
49
|
+
export interface Collection {
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
note_count: number;
|
|
54
|
+
created_at: string;
|
|
55
|
+
updated_at: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CreateCollectionRequest {
|
|
58
|
+
title: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface CreateCollectionResponse extends Collection {
|
|
62
|
+
request_id: string;
|
|
63
|
+
}
|
|
64
|
+
export interface GetCollectionResponse extends Collection {
|
|
65
|
+
}
|
|
66
|
+
export interface DeleteCollectionResponse {
|
|
67
|
+
success: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface ListCollectionsResponse {
|
|
70
|
+
collections: Collection[];
|
|
71
|
+
}
|
|
72
|
+
export interface SearchCollectionsRequest {
|
|
73
|
+
query: string;
|
|
74
|
+
limit?: number;
|
|
75
|
+
offset?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface SearchCollectionsResponse {
|
|
78
|
+
collections: Collection[];
|
|
79
|
+
total: number;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI;CAAG;AAEhD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;CAAG;AAE5D,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Type definitions for MCP tools
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base tool response content
|
|
7
|
+
*/
|
|
8
|
+
export interface ToolResponseContent {
|
|
9
|
+
type: 'text';
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Base tool response
|
|
14
|
+
*/
|
|
15
|
+
export interface ToolResponse {
|
|
16
|
+
content: ToolResponseContent[];
|
|
17
|
+
isError?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Tool definition for MCP server
|
|
21
|
+
*/
|
|
22
|
+
export interface ToolDefinition {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object';
|
|
27
|
+
properties: Record<string, unknown>;
|
|
28
|
+
required?: string[];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Base tool interface
|
|
33
|
+
*/
|
|
34
|
+
export interface BaseTool {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
schema: z.ZodType<unknown>;
|
|
38
|
+
handle(params: unknown): Promise<ToolResponse>;
|
|
39
|
+
toDefinition(): ToolDefinition;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/C,YAAY,IAAI,cAAc,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error class for mem.ai API errors
|
|
3
|
+
*/
|
|
4
|
+
export declare class MemAPIError extends Error {
|
|
5
|
+
statusCode: number;
|
|
6
|
+
details?: unknown | undefined;
|
|
7
|
+
constructor(statusCode: number, message: string, details?: unknown | undefined);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Error for parameter validation failures
|
|
11
|
+
*/
|
|
12
|
+
export declare class ValidationError extends Error {
|
|
13
|
+
issues?: unknown | undefined;
|
|
14
|
+
constructor(message: string, issues?: unknown | undefined);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Error for authentication failures (401)
|
|
18
|
+
*/
|
|
19
|
+
export declare class AuthenticationError extends MemAPIError {
|
|
20
|
+
constructor(message?: string);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Error for resource not found (404)
|
|
24
|
+
*/
|
|
25
|
+
export declare class NotFoundError extends MemAPIError {
|
|
26
|
+
constructor(message?: string);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Error for rate limiting (429)
|
|
30
|
+
*/
|
|
31
|
+
export declare class RateLimitError extends MemAPIError {
|
|
32
|
+
retryAfter?: number | undefined;
|
|
33
|
+
constructor(message?: string, retryAfter?: number | undefined);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Error for server errors (500+)
|
|
37
|
+
*/
|
|
38
|
+
export declare class ServerError extends MemAPIError {
|
|
39
|
+
constructor(message?: string);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAE3B,UAAU,EAAE,MAAM;IAElB,OAAO,CAAC,EAAE,OAAO;gBAFjB,UAAU,EAAE,MAAM,EACzB,OAAO,EAAE,MAAM,EACR,OAAO,CAAC,EAAE,OAAO,YAAA;CAM3B;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACJ,MAAM,CAAC,EAAE,OAAO;gBAAxC,OAAO,EAAE,MAAM,EAAS,MAAM,CAAC,EAAE,OAAO,YAAA;CAKrD;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,OAAO,GAAE,MAA0B;CAIhD;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAChC,OAAO,GAAE,MAA6B;CAInD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAGpC,UAAU,CAAC,EAAE,MAAM;gBAD1B,OAAO,GAAE,MAA8B,EAChC,UAAU,CAAC,EAAE,MAAM,YAAA;CAK7B;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,OAAO,GAAE,MAAgC;CAItD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error class for mem.ai API errors
|
|
3
|
+
*/
|
|
4
|
+
export class MemAPIError extends Error {
|
|
5
|
+
statusCode;
|
|
6
|
+
details;
|
|
7
|
+
constructor(statusCode, message, details) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.statusCode = statusCode;
|
|
10
|
+
this.details = details;
|
|
11
|
+
this.name = 'MemAPIError';
|
|
12
|
+
Error.captureStackTrace(this, this.constructor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Error for parameter validation failures
|
|
17
|
+
*/
|
|
18
|
+
export class ValidationError extends Error {
|
|
19
|
+
issues;
|
|
20
|
+
constructor(message, issues) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.issues = issues;
|
|
23
|
+
this.name = 'ValidationError';
|
|
24
|
+
Error.captureStackTrace(this, this.constructor);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Error for authentication failures (401)
|
|
29
|
+
*/
|
|
30
|
+
export class AuthenticationError extends MemAPIError {
|
|
31
|
+
constructor(message = 'Invalid API key') {
|
|
32
|
+
super(401, message);
|
|
33
|
+
this.name = 'AuthenticationError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Error for resource not found (404)
|
|
38
|
+
*/
|
|
39
|
+
export class NotFoundError extends MemAPIError {
|
|
40
|
+
constructor(message = 'Resource not found') {
|
|
41
|
+
super(404, message);
|
|
42
|
+
this.name = 'NotFoundError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Error for rate limiting (429)
|
|
47
|
+
*/
|
|
48
|
+
export class RateLimitError extends MemAPIError {
|
|
49
|
+
retryAfter;
|
|
50
|
+
constructor(message = 'Rate limit exceeded', retryAfter) {
|
|
51
|
+
super(429, message);
|
|
52
|
+
this.retryAfter = retryAfter;
|
|
53
|
+
this.name = 'RateLimitError';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Error for server errors (500+)
|
|
58
|
+
*/
|
|
59
|
+
export class ServerError extends MemAPIError {
|
|
60
|
+
constructor(message = 'Internal server error') {
|
|
61
|
+
super(500, message);
|
|
62
|
+
this.name = 'ServerError';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAE3B;IAEA;IAHT,YACS,UAAkB,EACzB,OAAe,EACR,OAAiB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,eAAU,GAAV,UAAU,CAAQ;QAElB,YAAO,GAAP,OAAO,CAAU;QAGxB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACJ;IAApC,YAAY,OAAe,EAAS,MAAgB;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;QADmB,WAAM,GAAN,MAAM,CAAU;QAElD,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD,YAAY,UAAkB,iBAAiB;QAC7C,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C,YAAY,UAAkB,oBAAoB;QAChD,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAGpC;IAFT,YACE,UAAkB,qBAAqB,EAChC,UAAmB;QAE1B,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAFb,eAAU,GAAV,UAAU,CAAS;QAG1B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,YAAY,UAAkB,uBAAuB;QACnD,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hskksk/mem-ai-mcp-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for mem.ai API integration",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mem-ai-mcp-server": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"dev": "tsx watch src/index.ts",
|
|
19
|
+
"test": "node --test --import tsx tests/**/*.test.ts",
|
|
20
|
+
"lint": "eslint src --ext .ts",
|
|
21
|
+
"type-check": "tsc --noEmit",
|
|
22
|
+
"prepublishOnly": "pnpm run build && pnpm test",
|
|
23
|
+
"publish:npm": "npm publish --access public"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20.0.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
30
|
+
"dotenv": "^16.4.7",
|
|
31
|
+
"zod": "^3.25.1",
|
|
32
|
+
"zod-to-json-schema": "^3.25.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^22.10.5",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
37
|
+
"@typescript-eslint/parser": "^8.20.0",
|
|
38
|
+
"eslint": "^9.18.0",
|
|
39
|
+
"tsx": "^4.19.2",
|
|
40
|
+
"typescript": "^5.7.3"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/hskksk/mem-ai-mcp-server.git"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"mcp",
|
|
48
|
+
"model-context-protocol",
|
|
49
|
+
"mem-ai",
|
|
50
|
+
"ai",
|
|
51
|
+
"memory"
|
|
52
|
+
],
|
|
53
|
+
"author": "hskksk",
|
|
54
|
+
"license": "MIT"
|
|
55
|
+
}
|