@mcp-ts/sdk 1.0.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 +297 -0
- package/dist/adapters/agui-adapter.d.mts +119 -0
- package/dist/adapters/agui-adapter.d.ts +119 -0
- package/dist/adapters/agui-adapter.js +109 -0
- package/dist/adapters/agui-adapter.js.map +1 -0
- package/dist/adapters/agui-adapter.mjs +107 -0
- package/dist/adapters/agui-adapter.mjs.map +1 -0
- package/dist/adapters/agui-middleware.d.mts +171 -0
- package/dist/adapters/agui-middleware.d.ts +171 -0
- package/dist/adapters/agui-middleware.js +429 -0
- package/dist/adapters/agui-middleware.js.map +1 -0
- package/dist/adapters/agui-middleware.mjs +417 -0
- package/dist/adapters/agui-middleware.mjs.map +1 -0
- package/dist/adapters/ai-adapter.d.mts +38 -0
- package/dist/adapters/ai-adapter.d.ts +38 -0
- package/dist/adapters/ai-adapter.js +82 -0
- package/dist/adapters/ai-adapter.js.map +1 -0
- package/dist/adapters/ai-adapter.mjs +80 -0
- package/dist/adapters/ai-adapter.mjs.map +1 -0
- package/dist/adapters/langchain-adapter.d.mts +46 -0
- package/dist/adapters/langchain-adapter.d.ts +46 -0
- package/dist/adapters/langchain-adapter.js +102 -0
- package/dist/adapters/langchain-adapter.js.map +1 -0
- package/dist/adapters/langchain-adapter.mjs +100 -0
- package/dist/adapters/langchain-adapter.mjs.map +1 -0
- package/dist/adapters/mastra-adapter.d.mts +49 -0
- package/dist/adapters/mastra-adapter.d.ts +49 -0
- package/dist/adapters/mastra-adapter.js +95 -0
- package/dist/adapters/mastra-adapter.js.map +1 -0
- package/dist/adapters/mastra-adapter.mjs +93 -0
- package/dist/adapters/mastra-adapter.mjs.map +1 -0
- package/dist/client/index.d.mts +119 -0
- package/dist/client/index.d.ts +119 -0
- package/dist/client/index.js +225 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/index.mjs +223 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/client/react.d.mts +151 -0
- package/dist/client/react.d.ts +151 -0
- package/dist/client/react.js +492 -0
- package/dist/client/react.js.map +1 -0
- package/dist/client/react.mjs +489 -0
- package/dist/client/react.mjs.map +1 -0
- package/dist/client/vue.d.mts +157 -0
- package/dist/client/vue.d.ts +157 -0
- package/dist/client/vue.js +474 -0
- package/dist/client/vue.js.map +1 -0
- package/dist/client/vue.mjs +471 -0
- package/dist/client/vue.mjs.map +1 -0
- package/dist/events-BP6WyRNh.d.mts +110 -0
- package/dist/events-BP6WyRNh.d.ts +110 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2784 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2723 -0
- package/dist/index.mjs.map +1 -0
- package/dist/multi-session-client-BOFgPypS.d.ts +389 -0
- package/dist/multi-session-client-DMF3ED2O.d.mts +389 -0
- package/dist/server/index.d.mts +269 -0
- package/dist/server/index.d.ts +269 -0
- package/dist/server/index.js +2444 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +2414 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/shared/index.d.mts +24 -0
- package/dist/shared/index.d.ts +24 -0
- package/dist/shared/index.js +223 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/index.mjs +190 -0
- package/dist/shared/index.mjs.map +1 -0
- package/dist/types-SbDlA2VX.d.mts +153 -0
- package/dist/types-SbDlA2VX.d.ts +153 -0
- package/dist/utils-0qmYrqoa.d.mts +92 -0
- package/dist/utils-0qmYrqoa.d.ts +92 -0
- package/package.json +165 -0
- package/src/adapters/agui-adapter.ts +210 -0
- package/src/adapters/agui-middleware.ts +512 -0
- package/src/adapters/ai-adapter.ts +115 -0
- package/src/adapters/langchain-adapter.ts +127 -0
- package/src/adapters/mastra-adapter.ts +126 -0
- package/src/client/core/sse-client.ts +340 -0
- package/src/client/index.ts +26 -0
- package/src/client/react/index.ts +10 -0
- package/src/client/react/useMcp.ts +558 -0
- package/src/client/vue/index.ts +10 -0
- package/src/client/vue/useMcp.ts +542 -0
- package/src/index.ts +11 -0
- package/src/server/handlers/nextjs-handler.ts +216 -0
- package/src/server/handlers/sse-handler.ts +699 -0
- package/src/server/index.ts +57 -0
- package/src/server/mcp/multi-session-client.ts +132 -0
- package/src/server/mcp/oauth-client.ts +1168 -0
- package/src/server/mcp/storage-oauth-provider.ts +239 -0
- package/src/server/storage/file-backend.ts +169 -0
- package/src/server/storage/index.ts +115 -0
- package/src/server/storage/memory-backend.ts +132 -0
- package/src/server/storage/redis-backend.ts +210 -0
- package/src/server/storage/redis.ts +160 -0
- package/src/server/storage/types.ts +109 -0
- package/src/shared/constants.ts +29 -0
- package/src/shared/errors.ts +133 -0
- package/src/shared/events.ts +166 -0
- package/src/shared/index.ts +70 -0
- package/src/shared/types.ts +274 -0
- package/src/shared/utils.ts +16 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type definitions for MCP operations
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface ConnectRequest {
|
|
8
|
+
serverUrl: string;
|
|
9
|
+
callbackUrl: string;
|
|
10
|
+
}
|
|
11
|
+
interface ConnectSuccessResponse {
|
|
12
|
+
success: true;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
}
|
|
15
|
+
interface ConnectAuthRequiredResponse {
|
|
16
|
+
requiresAuth: true;
|
|
17
|
+
authUrl: string;
|
|
18
|
+
sessionId: string;
|
|
19
|
+
}
|
|
20
|
+
interface ConnectErrorResponse {
|
|
21
|
+
error: string;
|
|
22
|
+
}
|
|
23
|
+
type ConnectResponse = ConnectSuccessResponse | ConnectAuthRequiredResponse | ConnectErrorResponse;
|
|
24
|
+
interface ListToolsSuccessResponse {
|
|
25
|
+
tools: Tool[];
|
|
26
|
+
}
|
|
27
|
+
interface ListToolsErrorResponse {
|
|
28
|
+
error: string;
|
|
29
|
+
}
|
|
30
|
+
type ListToolsResponse = ListToolsSuccessResponse | ListToolsErrorResponse;
|
|
31
|
+
interface CallToolRequest {
|
|
32
|
+
sessionId: string;
|
|
33
|
+
toolName: string;
|
|
34
|
+
toolArgs: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
interface CallToolSuccessResponse {
|
|
37
|
+
content: Array<{
|
|
38
|
+
type: string;
|
|
39
|
+
text?: string;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}>;
|
|
42
|
+
isError: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface CallToolErrorResponse {
|
|
45
|
+
error: string;
|
|
46
|
+
}
|
|
47
|
+
type CallToolResponse = CallToolSuccessResponse | CallToolErrorResponse;
|
|
48
|
+
declare function isConnectSuccess(response: ConnectResponse): response is ConnectSuccessResponse;
|
|
49
|
+
declare function isConnectAuthRequired(response: ConnectResponse): response is ConnectAuthRequiredResponse;
|
|
50
|
+
declare function isConnectError(response: ConnectResponse): response is ConnectErrorResponse;
|
|
51
|
+
declare function isListToolsSuccess(response: ListToolsResponse): response is ListToolsSuccessResponse;
|
|
52
|
+
declare function isCallToolSuccess(response: CallToolResponse): response is CallToolSuccessResponse;
|
|
53
|
+
type ToolInfo = {
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
inputSchema?: unknown;
|
|
57
|
+
};
|
|
58
|
+
type TransportType = 'sse' | 'streamable_http';
|
|
59
|
+
type McpRpcMethod = 'connect' | 'disconnect' | 'listTools' | 'callTool' | 'getSessions' | 'restoreSession' | 'finishAuth' | 'listPrompts' | 'getPrompt' | 'listResources' | 'readResource';
|
|
60
|
+
interface McpRpcRequest {
|
|
61
|
+
id: string;
|
|
62
|
+
method: McpRpcMethod;
|
|
63
|
+
params?: McpRpcParams;
|
|
64
|
+
}
|
|
65
|
+
interface McpRpcResponse<T = unknown> {
|
|
66
|
+
id: string;
|
|
67
|
+
result?: T;
|
|
68
|
+
error?: {
|
|
69
|
+
code: string;
|
|
70
|
+
message: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
interface ConnectParams {
|
|
74
|
+
serverId: string;
|
|
75
|
+
serverName: string;
|
|
76
|
+
serverUrl: string;
|
|
77
|
+
callbackUrl: string;
|
|
78
|
+
transportType?: TransportType;
|
|
79
|
+
}
|
|
80
|
+
interface DisconnectParams {
|
|
81
|
+
sessionId: string;
|
|
82
|
+
}
|
|
83
|
+
interface SessionParams {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
}
|
|
86
|
+
interface CallToolParams {
|
|
87
|
+
sessionId: string;
|
|
88
|
+
toolName: string;
|
|
89
|
+
toolArgs: Record<string, unknown>;
|
|
90
|
+
}
|
|
91
|
+
interface GetPromptParams {
|
|
92
|
+
sessionId: string;
|
|
93
|
+
name: string;
|
|
94
|
+
args?: Record<string, string>;
|
|
95
|
+
}
|
|
96
|
+
interface ReadResourceParams {
|
|
97
|
+
sessionId: string;
|
|
98
|
+
uri: string;
|
|
99
|
+
}
|
|
100
|
+
interface FinishAuthParams {
|
|
101
|
+
sessionId: string;
|
|
102
|
+
code: string;
|
|
103
|
+
}
|
|
104
|
+
type McpRpcParams = ConnectParams | DisconnectParams | SessionParams | CallToolParams | GetPromptParams | ReadResourceParams | FinishAuthParams | undefined;
|
|
105
|
+
interface SessionInfo {
|
|
106
|
+
sessionId: string;
|
|
107
|
+
serverId?: string;
|
|
108
|
+
serverName?: string;
|
|
109
|
+
serverUrl: string;
|
|
110
|
+
transport: TransportType;
|
|
111
|
+
}
|
|
112
|
+
interface SessionListResult {
|
|
113
|
+
sessions: SessionInfo[];
|
|
114
|
+
}
|
|
115
|
+
interface ConnectResult {
|
|
116
|
+
sessionId: string;
|
|
117
|
+
success: boolean;
|
|
118
|
+
}
|
|
119
|
+
interface DisconnectResult {
|
|
120
|
+
success: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface RestoreSessionResult {
|
|
123
|
+
success: boolean;
|
|
124
|
+
toolCount: number;
|
|
125
|
+
}
|
|
126
|
+
interface FinishAuthResult {
|
|
127
|
+
success: boolean;
|
|
128
|
+
toolCount: number;
|
|
129
|
+
}
|
|
130
|
+
interface ListToolsRpcResult {
|
|
131
|
+
tools: Tool[];
|
|
132
|
+
}
|
|
133
|
+
interface ListPromptsResult {
|
|
134
|
+
prompts: Array<{
|
|
135
|
+
name: string;
|
|
136
|
+
description?: string;
|
|
137
|
+
arguments?: Array<{
|
|
138
|
+
name: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
required?: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
}>;
|
|
143
|
+
}
|
|
144
|
+
interface ListResourcesResult {
|
|
145
|
+
resources: Array<{
|
|
146
|
+
uri: string;
|
|
147
|
+
name: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
mimeType?: string;
|
|
150
|
+
}>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export { type CallToolParams as C, type DisconnectParams as D, type FinishAuthParams as F, type GetPromptParams as G, type ListPromptsResult as L, type McpRpcMethod as M, type ReadResourceParams as R, type SessionInfo as S, type ToolInfo as T, type CallToolRequest as a, type CallToolResponse as b, type ConnectAuthRequiredResponse as c, type ConnectErrorResponse as d, type ConnectParams as e, type ConnectRequest as f, type ConnectResponse as g, type ConnectResult as h, type ConnectSuccessResponse as i, type DisconnectResult as j, type FinishAuthResult as k, type ListResourcesResult as l, type ListToolsResponse as m, type ListToolsRpcResult as n, type McpRpcParams as o, type McpRpcRequest as p, type McpRpcResponse as q, type RestoreSessionResult as r, type SessionListResult as s, type SessionParams as t, type TransportType as u, isCallToolSuccess as v, isConnectAuthRequired as w, isConnectError as x, isConnectSuccess as y, isListToolsSuccess as z };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standardized error classes for MCP Redis library
|
|
3
|
+
* Provides consistent error handling across the codebase
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base error class for all MCP-related errors
|
|
7
|
+
*/
|
|
8
|
+
declare class McpError extends Error {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly cause?: Error | undefined;
|
|
11
|
+
constructor(code: string, message: string, cause?: Error | undefined);
|
|
12
|
+
toJSON(): {
|
|
13
|
+
cause?: string | undefined;
|
|
14
|
+
name: string;
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when OAuth authorization is required
|
|
21
|
+
*/
|
|
22
|
+
declare class UnauthorizedError extends McpError {
|
|
23
|
+
constructor(message?: string, cause?: Error);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown when connection to MCP server fails
|
|
27
|
+
*/
|
|
28
|
+
declare class ConnectionError extends McpError {
|
|
29
|
+
constructor(message: string, cause?: Error);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Thrown when session is not found or expired
|
|
33
|
+
*/
|
|
34
|
+
declare class SessionNotFoundError extends McpError {
|
|
35
|
+
constructor(sessionId: string, cause?: Error);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Thrown when session validation fails
|
|
39
|
+
*/
|
|
40
|
+
declare class SessionValidationError extends McpError {
|
|
41
|
+
constructor(message: string, cause?: Error);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Thrown when authentication fails
|
|
45
|
+
*/
|
|
46
|
+
declare class AuthenticationError extends McpError {
|
|
47
|
+
constructor(message: string, cause?: Error);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Thrown when OAuth state validation fails
|
|
51
|
+
*/
|
|
52
|
+
declare class InvalidStateError extends McpError {
|
|
53
|
+
constructor(message?: string, cause?: Error);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Thrown when client is not connected
|
|
57
|
+
*/
|
|
58
|
+
declare class NotConnectedError extends McpError {
|
|
59
|
+
constructor(message?: string, cause?: Error);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Thrown when required configuration is missing
|
|
63
|
+
*/
|
|
64
|
+
declare class ConfigurationError extends McpError {
|
|
65
|
+
constructor(message: string, cause?: Error);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Thrown when tool execution fails
|
|
69
|
+
*/
|
|
70
|
+
declare class ToolExecutionError extends McpError {
|
|
71
|
+
constructor(toolName: string, message: string, cause?: Error);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* RPC error codes for SSE communication
|
|
75
|
+
*/
|
|
76
|
+
declare const RpcErrorCodes: {
|
|
77
|
+
readonly EXECUTION_ERROR: "EXECUTION_ERROR";
|
|
78
|
+
readonly MISSING_IDENTITY: "MISSING_IDENTITY";
|
|
79
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
80
|
+
readonly NO_CONNECTION: "NO_CONNECTION";
|
|
81
|
+
readonly UNKNOWN_METHOD: "UNKNOWN_METHOD";
|
|
82
|
+
readonly INVALID_PARAMS: "INVALID_PARAMS";
|
|
83
|
+
};
|
|
84
|
+
type RpcErrorCode = typeof RpcErrorCodes[keyof typeof RpcErrorCodes];
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Sanitize server name to create a valid server label
|
|
88
|
+
* Must start with a letter and contain only letters, digits, '-' and '_'
|
|
89
|
+
*/
|
|
90
|
+
declare function sanitizeServerLabel(name: string): string;
|
|
91
|
+
|
|
92
|
+
export { AuthenticationError as A, ConfigurationError as C, InvalidStateError as I, McpError as M, NotConnectedError as N, type RpcErrorCode as R, SessionNotFoundError as S, ToolExecutionError as T, UnauthorizedError as U, ConnectionError as a, RpcErrorCodes as b, SessionValidationError as c, sanitizeServerLabel as s };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standardized error classes for MCP Redis library
|
|
3
|
+
* Provides consistent error handling across the codebase
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base error class for all MCP-related errors
|
|
7
|
+
*/
|
|
8
|
+
declare class McpError extends Error {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly cause?: Error | undefined;
|
|
11
|
+
constructor(code: string, message: string, cause?: Error | undefined);
|
|
12
|
+
toJSON(): {
|
|
13
|
+
cause?: string | undefined;
|
|
14
|
+
name: string;
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when OAuth authorization is required
|
|
21
|
+
*/
|
|
22
|
+
declare class UnauthorizedError extends McpError {
|
|
23
|
+
constructor(message?: string, cause?: Error);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown when connection to MCP server fails
|
|
27
|
+
*/
|
|
28
|
+
declare class ConnectionError extends McpError {
|
|
29
|
+
constructor(message: string, cause?: Error);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Thrown when session is not found or expired
|
|
33
|
+
*/
|
|
34
|
+
declare class SessionNotFoundError extends McpError {
|
|
35
|
+
constructor(sessionId: string, cause?: Error);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Thrown when session validation fails
|
|
39
|
+
*/
|
|
40
|
+
declare class SessionValidationError extends McpError {
|
|
41
|
+
constructor(message: string, cause?: Error);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Thrown when authentication fails
|
|
45
|
+
*/
|
|
46
|
+
declare class AuthenticationError extends McpError {
|
|
47
|
+
constructor(message: string, cause?: Error);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Thrown when OAuth state validation fails
|
|
51
|
+
*/
|
|
52
|
+
declare class InvalidStateError extends McpError {
|
|
53
|
+
constructor(message?: string, cause?: Error);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Thrown when client is not connected
|
|
57
|
+
*/
|
|
58
|
+
declare class NotConnectedError extends McpError {
|
|
59
|
+
constructor(message?: string, cause?: Error);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Thrown when required configuration is missing
|
|
63
|
+
*/
|
|
64
|
+
declare class ConfigurationError extends McpError {
|
|
65
|
+
constructor(message: string, cause?: Error);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Thrown when tool execution fails
|
|
69
|
+
*/
|
|
70
|
+
declare class ToolExecutionError extends McpError {
|
|
71
|
+
constructor(toolName: string, message: string, cause?: Error);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* RPC error codes for SSE communication
|
|
75
|
+
*/
|
|
76
|
+
declare const RpcErrorCodes: {
|
|
77
|
+
readonly EXECUTION_ERROR: "EXECUTION_ERROR";
|
|
78
|
+
readonly MISSING_IDENTITY: "MISSING_IDENTITY";
|
|
79
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
80
|
+
readonly NO_CONNECTION: "NO_CONNECTION";
|
|
81
|
+
readonly UNKNOWN_METHOD: "UNKNOWN_METHOD";
|
|
82
|
+
readonly INVALID_PARAMS: "INVALID_PARAMS";
|
|
83
|
+
};
|
|
84
|
+
type RpcErrorCode = typeof RpcErrorCodes[keyof typeof RpcErrorCodes];
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Sanitize server name to create a valid server label
|
|
88
|
+
* Must start with a letter and contain only letters, digits, '-' and '_'
|
|
89
|
+
*/
|
|
90
|
+
declare function sanitizeServerLabel(name: string): string;
|
|
91
|
+
|
|
92
|
+
export { AuthenticationError as A, ConfigurationError as C, InvalidStateError as I, McpError as M, NotConnectedError as N, type RpcErrorCode as R, SessionNotFoundError as S, ToolExecutionError as T, UnauthorizedError as U, ConnectionError as a, RpcErrorCodes as b, SessionValidationError as c, sanitizeServerLabel as s };
|
package/package.json
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcp-ts/sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "A Lightweight MCP (Model Context Protocol) client library for JavaScript applications, supporting multiple storage backends (Memory, File, Redis) and real-time SSE support.",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./server": {
|
|
18
|
+
"types": "./dist/server/index.d.ts",
|
|
19
|
+
"import": "./dist/server/index.mjs",
|
|
20
|
+
"require": "./dist/server/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"types": "./dist/client/index.d.ts",
|
|
24
|
+
"import": "./dist/client/index.mjs",
|
|
25
|
+
"require": "./dist/client/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./client/react": {
|
|
28
|
+
"types": "./dist/client/react.d.ts",
|
|
29
|
+
"import": "./dist/client/react.mjs",
|
|
30
|
+
"require": "./dist/client/react.js"
|
|
31
|
+
},
|
|
32
|
+
"./client/vue": {
|
|
33
|
+
"types": "./dist/client/vue.d.ts",
|
|
34
|
+
"import": "./dist/client/vue.mjs",
|
|
35
|
+
"require": "./dist/client/vue.js"
|
|
36
|
+
},
|
|
37
|
+
"./shared": {
|
|
38
|
+
"types": "./dist/shared/index.d.ts",
|
|
39
|
+
"import": "./dist/shared/index.mjs",
|
|
40
|
+
"require": "./dist/shared/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./adapters/ai": {
|
|
43
|
+
"types": "./dist/adapters/ai-adapter.d.ts",
|
|
44
|
+
"import": "./dist/adapters/ai-adapter.mjs",
|
|
45
|
+
"require": "./dist/adapters/ai-adapter.js"
|
|
46
|
+
},
|
|
47
|
+
"./adapters/langchain": {
|
|
48
|
+
"types": "./dist/adapters/langchain-adapter.d.ts",
|
|
49
|
+
"import": "./dist/adapters/langchain-adapter.mjs",
|
|
50
|
+
"require": "./dist/adapters/langchain-adapter.js"
|
|
51
|
+
},
|
|
52
|
+
"./adapters/mastra": {
|
|
53
|
+
"types": "./dist/adapters/mastra-adapter.d.ts",
|
|
54
|
+
"import": "./dist/adapters/mastra-adapter.mjs",
|
|
55
|
+
"require": "./dist/adapters/mastra-adapter.js"
|
|
56
|
+
},
|
|
57
|
+
"./adapters/agui-adapter": {
|
|
58
|
+
"types": "./dist/adapters/agui-adapter.d.ts",
|
|
59
|
+
"import": "./dist/adapters/agui-adapter.mjs",
|
|
60
|
+
"require": "./dist/adapters/agui-adapter.js"
|
|
61
|
+
},
|
|
62
|
+
"./adapters/agui-middleware": {
|
|
63
|
+
"types": "./dist/adapters/agui-middleware.d.ts",
|
|
64
|
+
"import": "./dist/adapters/agui-middleware.mjs",
|
|
65
|
+
"require": "./dist/adapters/agui-middleware.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"files": [
|
|
69
|
+
"dist",
|
|
70
|
+
"src",
|
|
71
|
+
"README.md"
|
|
72
|
+
],
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsup",
|
|
75
|
+
"dev": "tsup --watch",
|
|
76
|
+
"type-check": "tsc --noEmit",
|
|
77
|
+
"clean": "rimraf dist",
|
|
78
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
79
|
+
"test": "npx playwright test",
|
|
80
|
+
"test:ui": "npx playwright test --ui",
|
|
81
|
+
"test:debug": "npx playwright test --debug"
|
|
82
|
+
},
|
|
83
|
+
"keywords": [
|
|
84
|
+
"mcp",
|
|
85
|
+
"model-context-protocol",
|
|
86
|
+
"oauth",
|
|
87
|
+
"redis",
|
|
88
|
+
"sse",
|
|
89
|
+
"server-sent-events",
|
|
90
|
+
"serverless",
|
|
91
|
+
"react",
|
|
92
|
+
"hook",
|
|
93
|
+
"anthropic",
|
|
94
|
+
"claude"
|
|
95
|
+
],
|
|
96
|
+
"author": "MCP Assistant Contributors",
|
|
97
|
+
"license": "MIT",
|
|
98
|
+
"repository": {
|
|
99
|
+
"type": "git",
|
|
100
|
+
"url": "git+https://github.com/zonlabs/mcp-ts.git"
|
|
101
|
+
},
|
|
102
|
+
"bugs": {
|
|
103
|
+
"url": "https://github.com/zonlabs/mcp-ts/issues"
|
|
104
|
+
},
|
|
105
|
+
"homepage": "https://github.com/zonlabs/mcp-ts#readme",
|
|
106
|
+
"peerDependencies": {
|
|
107
|
+
"@ag-ui/client": ">=0.0.40",
|
|
108
|
+
"@langchain/core": "^0.3.0",
|
|
109
|
+
"ai": "^6.0.0",
|
|
110
|
+
"ioredis": "^5.0.0",
|
|
111
|
+
"react": ">=18.0.0",
|
|
112
|
+
"rxjs": ">=7.0.0",
|
|
113
|
+
"zod": "^3.23.0"
|
|
114
|
+
},
|
|
115
|
+
"peerDependenciesMeta": {
|
|
116
|
+
"react": {
|
|
117
|
+
"optional": true
|
|
118
|
+
},
|
|
119
|
+
"ioredis": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"@langchain/core": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"zod": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
128
|
+
"ai": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"@ag-ui/client": {
|
|
132
|
+
"optional": true
|
|
133
|
+
},
|
|
134
|
+
"rxjs": {
|
|
135
|
+
"optional": true
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"dependencies": {
|
|
139
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
140
|
+
"json-schema": "^0.4.0",
|
|
141
|
+
"json-schema-to-zod": "^2.7.0",
|
|
142
|
+
"nanoid": "^5.1.6"
|
|
143
|
+
},
|
|
144
|
+
"devDependencies": {
|
|
145
|
+
"@ag-ui/client": "^0.0.42",
|
|
146
|
+
"@langchain/core": "^0.3.33",
|
|
147
|
+
"@playwright/test": "^1.58.0",
|
|
148
|
+
"@types/json-schema": "^7.0.15",
|
|
149
|
+
"@types/node": "^25.0.10",
|
|
150
|
+
"@types/react": "^18.3.18",
|
|
151
|
+
"ai": "^6.0.49",
|
|
152
|
+
"ioredis": "^5.9.2",
|
|
153
|
+
"ioredis-mock": "^8.13.1",
|
|
154
|
+
"playwright": "^1.58.0",
|
|
155
|
+
"react": "^18.3.1",
|
|
156
|
+
"rimraf": "^6.1.2",
|
|
157
|
+
"tsup": "^8.5.1",
|
|
158
|
+
"typescript": "^5.9.3",
|
|
159
|
+
"vue": "^3.5.27",
|
|
160
|
+
"zod": "^3.24.1"
|
|
161
|
+
},
|
|
162
|
+
"engines": {
|
|
163
|
+
"node": ">=18.0.0"
|
|
164
|
+
}
|
|
165
|
+
}
|