@mcp-use/client 2.0.0-beta.8 → 2.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/README.md +18 -19
- package/dist/.tsbuildinfo +1 -1
- package/dist/auth/browser.d.ts +62 -6
- package/dist/auth/browser.d.ts.map +1 -1
- package/dist/auth/callback.d.ts.map +1 -1
- package/dist/auth/flow.d.ts.map +1 -1
- package/dist/auth/node.d.ts +115 -5
- package/dist/auth/node.d.ts.map +1 -1
- package/dist/auth/session-store.d.ts +7 -1
- package/dist/auth/session-store.d.ts.map +1 -1
- package/dist/auth/storage.d.ts +12 -3
- package/dist/auth/storage.d.ts.map +1 -1
- package/dist/code-mode/executor-e2b.d.ts.map +1 -1
- package/dist/core/base.d.ts +4 -8
- package/dist/core/base.d.ts.map +1 -1
- package/dist/core/browser.d.ts +14 -2
- package/dist/core/browser.d.ts.map +1 -1
- package/dist/core/config.d.ts +82 -20
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/node.d.ts +7 -10
- package/dist/core/node.d.ts.map +1 -1
- package/dist/core/session.d.ts +102 -25
- package/dist/core/session.d.ts.map +1 -1
- package/dist/index-browser.d.ts +1 -0
- package/dist/index-browser.d.ts.map +1 -1
- package/dist/index-browser.js +568 -163
- package/dist/index-browser.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +407 -92
- package/dist/index.js.map +1 -1
- package/dist/react/McpClientProvider.d.ts +22 -10
- package/dist/react/McpClientProvider.d.ts.map +1 -1
- package/dist/react/index.d.ts +5 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1104 -368
- package/dist/react/index.js.map +1 -1
- package/dist/react/rpc-logger.d.ts +5 -0
- package/dist/react/rpc-logger.d.ts.map +1 -1
- package/dist/react/storage.d.ts +57 -10
- package/dist/react/storage.d.ts.map +1 -1
- package/dist/react/token-expiry.d.ts +9 -0
- package/dist/react/token-expiry.d.ts.map +1 -0
- package/dist/react/types.d.ts +134 -22
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/useMcp-helpers.d.ts.map +1 -1
- package/dist/react/useMcp-operations.d.ts +24 -6
- package/dist/react/useMcp-operations.d.ts.map +1 -1
- package/dist/react/useMcp.d.ts.map +1 -1
- package/dist/react/useMcpServerQueues.d.ts +36 -9
- package/dist/react/useMcpServerQueues.d.ts.map +1 -1
- package/dist/react/view/ViewRenderer.d.ts +12 -4
- package/dist/react/view/ViewRenderer.d.ts.map +1 -1
- package/dist/react/view/ext-apps-bridge.d.ts +1 -1
- package/dist/react/view/ext-apps-bridge.d.ts.map +1 -1
- package/dist/react/view/inject-openai-file-apis.d.ts.map +1 -1
- package/dist/react/view/parse-custom-props.d.ts +8 -0
- package/dist/react/view/parse-custom-props.d.ts.map +1 -1
- package/dist/react/view/resolve-view-resource.d.ts +10 -0
- package/dist/react/view/resolve-view-resource.d.ts.map +1 -1
- package/dist/react/view/sandbox-blob-url.d.ts +2 -0
- package/dist/react/view/sandbox-blob-url.d.ts.map +1 -1
- package/dist/react/view/types.d.ts +111 -4
- package/dist/react/view/types.d.ts.map +1 -1
- package/dist/react/view/view-detection.d.ts +18 -0
- package/dist/react/view/view-detection.d.ts.map +1 -1
- package/dist/react/view/view-host-policy.d.ts +61 -0
- package/dist/react/view/view-host-policy.d.ts.map +1 -0
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +283 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/telemetry/events.d.ts.map +1 -1
- package/dist/telemetry/tel-fetch.d.ts.map +1 -1
- package/dist/telemetry/telemetry.d.ts +5 -1
- package/dist/telemetry/telemetry.d.ts.map +1 -1
- package/dist/transport/base.d.ts +169 -34
- package/dist/transport/base.d.ts.map +1 -1
- package/dist/transport/connection-manager.d.ts +5 -1
- package/dist/transport/connection-manager.d.ts.map +1 -1
- package/dist/transport/http.d.ts +51 -2
- package/dist/transport/http.d.ts.map +1 -1
- package/dist/transport/stdio.d.ts +29 -1
- package/dist/transport/stdio.d.ts.map +1 -1
- package/dist/utils/elicitation.d.ts +4 -2
- package/dist/utils/elicitation.d.ts.map +1 -1
- package/dist/utils/logging.d.ts +1 -0
- package/dist/utils/logging.d.ts.map +1 -1
- package/dist/utils/version.d.ts +6 -0
- package/dist/utils/version.d.ts.map +1 -1
- package/package.json +9 -3
package/dist/core/config.d.ts
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import type { ElicitRequestFormParams, ElicitRequestURLParams, ElicitResult, Notification, AuthProvider, OAuthClientInformation, OAuthClientProvider, Root, RequestTypeMap, RequestOptions, ResultTypeMap, ClientOptions, VersionNegotiationMode } from "@modelcontextprotocol/client";
|
|
2
2
|
import type { BaseConnector, ConnectorInitOptions } from "../transport/base.js";
|
|
3
3
|
import type { ClientInfo } from "../transport/http.js";
|
|
4
|
-
/**
|
|
4
|
+
/** Parameters accepted by the MCP `sampling/createMessage` request. */
|
|
5
5
|
export type SamplingCreateMessageParams = RequestTypeMap["sampling/createMessage"]["params"];
|
|
6
|
-
/** Result for `sampling/createMessage`
|
|
6
|
+
/** Result returned for the MCP `sampling/createMessage` request. */
|
|
7
7
|
export type SamplingCreateMessageResult = ResultTypeMap["sampling/createMessage"];
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Handles a sampling request initiated by an MCP server.
|
|
10
|
+
*
|
|
11
|
+
* @param params - Sampling request parameters supplied by the server.
|
|
12
|
+
* @returns The model-generated sampling result.
|
|
13
|
+
*/
|
|
9
14
|
export type OnSamplingCallback = (params: SamplingCreateMessageParams) => Promise<SamplingCreateMessageResult>;
|
|
10
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Handles a form or URL elicitation request initiated by an MCP server.
|
|
17
|
+
*
|
|
18
|
+
* @param params - Elicitation request parameters supplied by the server.
|
|
19
|
+
* @returns The user's elicitation decision and optional content.
|
|
20
|
+
*/
|
|
11
21
|
export type OnElicitationCallback = (params: ElicitRequestFormParams | ElicitRequestURLParams) => Promise<ElicitResult>;
|
|
12
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Handles a notification sent by an MCP server.
|
|
24
|
+
*
|
|
25
|
+
* @param notification - The notification envelope supplied by the server.
|
|
26
|
+
*/
|
|
13
27
|
export type OnNotificationCallback = (notification: Notification) => void | Promise<void>;
|
|
14
28
|
/**
|
|
15
29
|
* Callback options shared by per-server config and global defaults.
|
|
@@ -28,17 +42,26 @@ export interface CallbackConfig {
|
|
|
28
42
|
onNotification?: OnNotificationCallback;
|
|
29
43
|
}
|
|
30
44
|
/**
|
|
31
|
-
* Resolves
|
|
45
|
+
* Resolves callback handlers, preferring per-server values over global values.
|
|
46
|
+
*
|
|
47
|
+
* @param perServer - Callback overrides for one server.
|
|
48
|
+
* @param globalDefaults - Fallback callbacks shared by all servers.
|
|
49
|
+
* @returns The effective callbacks for the server.
|
|
32
50
|
*/
|
|
33
51
|
export declare function resolveCallbacks(perServer: CallbackConfig | undefined, globalDefaults: CallbackConfig | undefined): {
|
|
52
|
+
/** Effective sampling callback. */
|
|
34
53
|
onSampling?: OnSamplingCallback;
|
|
54
|
+
/** Effective elicitation callback. */
|
|
35
55
|
onElicitation?: OnElicitationCallback;
|
|
56
|
+
/** Effective notification callback. */
|
|
36
57
|
onNotification?: OnNotificationCallback;
|
|
37
58
|
};
|
|
38
59
|
/**
|
|
39
60
|
* Base server configuration with common optional fields
|
|
40
61
|
*/
|
|
62
|
+
/** Options shared by HTTP and stdio server configurations. */
|
|
41
63
|
interface BaseServerConfig extends CallbackConfig {
|
|
64
|
+
/** Client identity advertised to the server. */
|
|
42
65
|
clientInfo?: ClientInfo;
|
|
43
66
|
/** Initial roots advertised to the server. */
|
|
44
67
|
roots?: Root[];
|
|
@@ -48,12 +71,16 @@ interface BaseServerConfig extends CallbackConfig {
|
|
|
48
71
|
defaultRequestOptions?: RequestOptions;
|
|
49
72
|
}
|
|
50
73
|
/**
|
|
51
|
-
*
|
|
74
|
+
* Configures a local MCP server launched over standard input and output.
|
|
52
75
|
*/
|
|
53
76
|
export interface StdioServerConfig extends BaseServerConfig {
|
|
77
|
+
/** Executable used to start the server. */
|
|
54
78
|
command: string;
|
|
79
|
+
/** Arguments passed to {@link StdioServerConfig.command}. */
|
|
55
80
|
args: string[];
|
|
81
|
+
/** Environment variables merged with the current process environment. */
|
|
56
82
|
env?: Record<string, string>;
|
|
83
|
+
/** Working directory used to launch the server process. */
|
|
57
84
|
cwd?: string;
|
|
58
85
|
/**
|
|
59
86
|
* Protocol version negotiation mode. Defaults to `"legacy"` for stdio (the
|
|
@@ -69,20 +96,27 @@ export interface StdioServerConfig extends BaseServerConfig {
|
|
|
69
96
|
* by the other runtime.
|
|
70
97
|
*/
|
|
71
98
|
export interface AutoOAuthOptions {
|
|
99
|
+
/** Prefix used for persisted OAuth session keys. */
|
|
72
100
|
storageKeyPrefix?: string;
|
|
101
|
+
/** OAuth client display name. */
|
|
73
102
|
clientName?: string;
|
|
103
|
+
/** Public URL describing the OAuth client. */
|
|
74
104
|
clientUri?: string;
|
|
105
|
+
/** Public URL for the OAuth client logo. */
|
|
75
106
|
logoUri?: string;
|
|
107
|
+
/** OAuth redirect URI. The platform provider supplies a default when omitted. */
|
|
76
108
|
callbackUrl?: string;
|
|
109
|
+
/** URL of an OAuth Client ID Metadata Document. */
|
|
77
110
|
clientMetadataUrl?: string;
|
|
111
|
+
/** Space-delimited OAuth scopes to request. */
|
|
78
112
|
scope?: string;
|
|
79
113
|
/** Pre-registered public client id (skips DCR). */
|
|
80
114
|
staticClientInfo?: OAuthClientInformation;
|
|
81
|
-
/** Node
|
|
115
|
+
/** Preferred Node loopback port. Defaults to `33418`. */
|
|
82
116
|
preferredPort?: number;
|
|
83
|
-
/** Node
|
|
117
|
+
/** Number of Node loopback ports to try. Defaults to `10`. */
|
|
84
118
|
portRange?: number;
|
|
85
|
-
/** Node
|
|
119
|
+
/** Node loopback callback timeout in milliseconds. Defaults to five minutes. */
|
|
86
120
|
authTimeoutMs?: number;
|
|
87
121
|
/** Node: override browser launch (CLI prints the URL instead). */
|
|
88
122
|
openBrowser?: (url: string) => void | Promise<void>;
|
|
@@ -92,19 +126,24 @@ export interface AutoOAuthOptions {
|
|
|
92
126
|
useRedirectFlow?: boolean;
|
|
93
127
|
/** Browser: same-origin OAuth BFF base URL. */
|
|
94
128
|
oauthProxyUrl?: string;
|
|
95
|
-
/**
|
|
129
|
+
/** Whether browser OAuth HTTP uses `oauthProxyUrl`. Defaults to `true` when the URL is set. */
|
|
96
130
|
proxyOAuthRequests?: boolean;
|
|
97
131
|
}
|
|
98
132
|
/**
|
|
99
|
-
*
|
|
133
|
+
* Configures a remote MCP server accessed with streamable HTTP.
|
|
100
134
|
*/
|
|
101
135
|
export interface HttpServerConfig extends BaseServerConfig {
|
|
136
|
+
/** MCP endpoint URL. */
|
|
102
137
|
url: string;
|
|
138
|
+
/** Headers included with MCP transport requests. */
|
|
103
139
|
headers?: Record<string, string>;
|
|
140
|
+
/** Fetch implementation used by the HTTP transport. */
|
|
104
141
|
fetch?: typeof fetch;
|
|
142
|
+
/** Bearer token added as the `Authorization` header. */
|
|
105
143
|
authToken?: string;
|
|
106
144
|
/** Connection timeout in milliseconds. */
|
|
107
145
|
timeout?: number;
|
|
146
|
+
/** OAuth provider used when the server requires authorization. */
|
|
108
147
|
authProvider?: AuthProvider | OAuthClientProvider;
|
|
109
148
|
/**
|
|
110
149
|
* Auto-OAuth options for HTTP servers.
|
|
@@ -122,28 +161,51 @@ export interface HttpServerConfig extends BaseServerConfig {
|
|
|
122
161
|
*/
|
|
123
162
|
protocolNegotiation?: VersionNegotiationMode;
|
|
124
163
|
}
|
|
125
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Tests whether the client should create an OAuth provider for an HTTP server.
|
|
166
|
+
*
|
|
167
|
+
* @param serverConfig - Server configuration to inspect.
|
|
168
|
+
* @returns `true` for an HTTP configuration without explicit authorization.
|
|
169
|
+
*/
|
|
126
170
|
export declare function shouldAutoProvisionOAuth(serverConfig: ServerConfig): serverConfig is HttpServerConfig;
|
|
127
171
|
/**
|
|
128
|
-
*
|
|
172
|
+
* Configuration for either a local stdio server or a remote HTTP server.
|
|
129
173
|
*/
|
|
130
174
|
export type ServerConfig = StdioServerConfig | HttpServerConfig;
|
|
131
175
|
/**
|
|
132
|
-
* Top-level MCP client configuration
|
|
133
|
-
*
|
|
176
|
+
* Top-level MCP client configuration.
|
|
177
|
+
*
|
|
178
|
+
* Callback and client identity values act as defaults for individual servers.
|
|
134
179
|
*/
|
|
135
180
|
export interface MCPClientConfigShape extends CallbackConfig {
|
|
136
|
-
/** Default
|
|
181
|
+
/** Default client identity for all servers; overridable per server. */
|
|
137
182
|
clientInfo?: ClientInfo;
|
|
183
|
+
/** Server configurations keyed by the name used in client methods. */
|
|
138
184
|
mcpServers?: Record<string, ServerConfig>;
|
|
139
185
|
}
|
|
140
186
|
/**
|
|
141
|
-
* Normalizes and
|
|
142
|
-
*
|
|
187
|
+
* Normalizes a client identity and fills optional metadata with package defaults.
|
|
188
|
+
*
|
|
189
|
+
* @param input - Candidate client identity.
|
|
190
|
+
* @returns The supplied identity merged with defaults, or the complete default
|
|
191
|
+
* identity when `input` does not contain both `name` and `version`.
|
|
143
192
|
*/
|
|
144
193
|
export declare function normalizeClientInfo(input: unknown): ClientInfo;
|
|
145
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Expands the `capabilities.views` shorthand into the MCP Apps extension.
|
|
196
|
+
*
|
|
197
|
+
* @param clientOptions - SDK client options to normalize.
|
|
198
|
+
* @returns Normalized options, or `undefined` when no options were supplied.
|
|
199
|
+
*/
|
|
146
200
|
export declare function resolveClientOptions(clientOptions: ClientOptions | undefined): ClientOptions | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Creates an HTTP connector from a runtime-neutral server configuration.
|
|
203
|
+
*
|
|
204
|
+
* @param serverConfig - Server configuration to convert.
|
|
205
|
+
* @param connectorOptions - Connector options that override derived values.
|
|
206
|
+
* @returns An HTTP connector for the configured endpoint.
|
|
207
|
+
* @throws When `serverConfig` is a stdio configuration or has no recognized transport.
|
|
208
|
+
*/
|
|
147
209
|
export declare function createConnectorFromConfig(serverConfig: ServerConfig, connectorOptions?: Partial<ConnectorInitOptions>): BaseConnector;
|
|
148
210
|
export {};
|
|
149
211
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,IAAI,EACJ,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,IAAI,EACJ,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,uEAAuE;AACvE,MAAM,MAAM,2BAA2B,GACrC,cAAc,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,CAAC;AAErD,oEAAoE;AACpE,MAAM,MAAM,2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ist/core/node.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ export type { CallToolResult, MetaObject, Notification, Root, Tool, } from "./se
|
|
|
92
92
|
* Node.js-specific MCP client implementation with advanced features.
|
|
93
93
|
*
|
|
94
94
|
* The MCPClient class provides a complete MCP client implementation for Node.js
|
|
95
|
-
* environments, extending
|
|
95
|
+
* environments, extending the runtime-neutral `BaseMCPClient` with platform-specific capabilities:
|
|
96
96
|
*
|
|
97
97
|
* - **All Connector Types**: Supports Stdio, HTTP, and WebSocket connectors
|
|
98
98
|
* - **Code Execution Mode**: Execute code dynamically using VM or E2B sandboxes
|
|
@@ -135,7 +135,6 @@ export type { CallToolResult, MetaObject, Notification, Root, Tool, } from "./se
|
|
|
135
135
|
* const result = await client.executeCode('console.log("Hello!")');
|
|
136
136
|
* ```
|
|
137
137
|
*
|
|
138
|
-
* @see {@link BaseMCPClient} for base client functionality
|
|
139
138
|
* @see {@link MCPSession} for session management
|
|
140
139
|
*/
|
|
141
140
|
export declare class MCPClient extends BaseMCPClient {
|
|
@@ -183,9 +182,7 @@ export declare class MCPClient extends BaseMCPClient {
|
|
|
183
182
|
* @param config - Configuration object or path to JSON config file. If omitted,
|
|
184
183
|
* starts with empty configuration
|
|
185
184
|
* @param options - Optional client behavior configuration
|
|
186
|
-
*
|
|
187
|
-
* @param options.onSampling - Callback for handling sampling requests from servers
|
|
188
|
-
* @param options.onElicitation - Callback for handling elicitation requests
|
|
185
|
+
* Options can enable code mode or provide sampling and elicitation callbacks.
|
|
189
186
|
*
|
|
190
187
|
* @example
|
|
191
188
|
* ```typescript
|
|
@@ -251,7 +248,7 @@ export declare class MCPClient extends BaseMCPClient {
|
|
|
251
248
|
* });
|
|
252
249
|
* ```
|
|
253
250
|
*
|
|
254
|
-
* @see {@link
|
|
251
|
+
* @see {@link MCPClient} for direct instantiation
|
|
255
252
|
* @see {@link fromConfigFile} for loading from file
|
|
256
253
|
*/
|
|
257
254
|
static fromDict(cfg: Record<string, any>, options?: MCPClientOptions): MCPClient;
|
|
@@ -264,7 +261,7 @@ export declare class MCPClient extends BaseMCPClient {
|
|
|
264
261
|
* @param path - Path to the JSON configuration file
|
|
265
262
|
* @param options - Optional client behavior configuration
|
|
266
263
|
* @returns New MCPClient instance
|
|
267
|
-
* @throws
|
|
264
|
+
* @throws If the file cannot be read or parsed
|
|
268
265
|
*
|
|
269
266
|
* @example
|
|
270
267
|
* ```typescript
|
|
@@ -280,7 +277,7 @@ export declare class MCPClient extends BaseMCPClient {
|
|
|
280
277
|
* });
|
|
281
278
|
* ```
|
|
282
279
|
*
|
|
283
|
-
* @see {@link
|
|
280
|
+
* @see {@link MCPClient} for direct instantiation
|
|
284
281
|
* @see {@link fromDict} for inline configuration
|
|
285
282
|
*/
|
|
286
283
|
static fromConfigFile(path: string, options?: MCPClientOptions): MCPClient;
|
|
@@ -326,7 +323,7 @@ export declare class MCPClient extends BaseMCPClient {
|
|
|
326
323
|
* @param code - JavaScript/TypeScript code to execute
|
|
327
324
|
* @param timeout - Optional execution timeout in milliseconds
|
|
328
325
|
* @returns Execution result with output, errors, and return value
|
|
329
|
-
* @throws
|
|
326
|
+
* @throws If code mode is not enabled
|
|
330
327
|
*
|
|
331
328
|
* @example
|
|
332
329
|
* ```typescript
|
|
@@ -364,7 +361,7 @@ export declare class MCPClient extends BaseMCPClient {
|
|
|
364
361
|
* @param query - Optional search query to filter tools (defaults to empty string for all tools)
|
|
365
362
|
* @param detailLevel - Level of detail to return: "names", "descriptions", or "full"
|
|
366
363
|
* @returns Tool search results with matching tools
|
|
367
|
-
* @throws
|
|
364
|
+
* @throws If code mode is not enabled
|
|
368
365
|
*
|
|
369
366
|
* @example
|
|
370
367
|
* ```typescript
|
package/dist/core/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/core/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ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IAAI,MAAM,EAAE;IAOjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAUpC"}
|
package/dist/core/session.d.ts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import type { CallToolResult, CompleteRequestParams, CompleteResult, MetaObject, Notification, ProtocolEra, RequestOptions, Root, Tool } from "@modelcontextprotocol/client";
|
|
2
2
|
import type { BaseConnector, NotificationHandler } from "../transport/base.js";
|
|
3
|
-
/** Negotiated protocol era
|
|
3
|
+
/** Negotiated protocol era: `"legacy"` or `"modern"`. */
|
|
4
4
|
export type MCPProtocolEra = ProtocolEra;
|
|
5
5
|
/**
|
|
6
6
|
* Server information normalized across legacy sessionful and modern sessionless
|
|
7
7
|
* MCP protocols.
|
|
8
8
|
*/
|
|
9
9
|
export interface MCPServerInfo {
|
|
10
|
+
/** Stable server name. */
|
|
10
11
|
name: string;
|
|
12
|
+
/** Server version reported during initialization. */
|
|
11
13
|
version?: string;
|
|
14
|
+
/** Optional human-readable server title. */
|
|
12
15
|
title?: string;
|
|
16
|
+
/** Optional human-readable server description. */
|
|
13
17
|
description?: string;
|
|
18
|
+
/** Public website describing the server. */
|
|
14
19
|
websiteUrl?: string;
|
|
20
|
+
/** Icons advertised by the server. */
|
|
15
21
|
icons?: Array<{
|
|
22
|
+
/** Icon URL. */
|
|
16
23
|
src: string;
|
|
24
|
+
/** Icon media type. */
|
|
17
25
|
mimeType?: string;
|
|
26
|
+
/** Supported icon sizes, such as `"48x48"`. */
|
|
18
27
|
sizes?: string[];
|
|
19
28
|
}>;
|
|
20
29
|
}
|
|
@@ -25,11 +34,17 @@ export interface MCPServerInfo {
|
|
|
25
34
|
* callers to branch on the negotiated era.
|
|
26
35
|
*/
|
|
27
36
|
export interface MCPConnectionInfo {
|
|
37
|
+
/** Negotiated protocol era. */
|
|
28
38
|
protocolEra: MCPProtocolEra;
|
|
39
|
+
/** Negotiated MCP protocol version. */
|
|
29
40
|
protocolVersion: string;
|
|
41
|
+
/** Server identity reported during negotiation. */
|
|
30
42
|
server: MCPServerInfo;
|
|
43
|
+
/** Capabilities advertised by the server. */
|
|
31
44
|
capabilities: Record<string, unknown>;
|
|
45
|
+
/** Instructions advertised by the server. */
|
|
32
46
|
instructions?: string;
|
|
47
|
+
/** Protocol extension metadata advertised by the server. */
|
|
33
48
|
extensions: Record<string, unknown>;
|
|
34
49
|
}
|
|
35
50
|
/**
|
|
@@ -47,7 +62,7 @@ export interface MCPConnectionInfo {
|
|
|
47
62
|
* - Notification handling
|
|
48
63
|
* - Root directory management
|
|
49
64
|
*
|
|
50
|
-
* Sessions are typically created by
|
|
65
|
+
* Sessions are typically created by `MCPClient.createSession()` rather than
|
|
51
66
|
* being instantiated directly.
|
|
52
67
|
*
|
|
53
68
|
* @example
|
|
@@ -74,7 +89,6 @@ export interface MCPConnectionInfo {
|
|
|
74
89
|
* await session.initialize();
|
|
75
90
|
* ```
|
|
76
91
|
*
|
|
77
|
-
* @see {@link MCPClient} for managing multiple sessions
|
|
78
92
|
* @see {@link BaseConnector} for connector implementations
|
|
79
93
|
*/
|
|
80
94
|
export declare class MCPConnection {
|
|
@@ -284,7 +298,7 @@ export declare class MCPConnection {
|
|
|
284
298
|
/**
|
|
285
299
|
* Normalized server metadata for this ready connection.
|
|
286
300
|
*
|
|
287
|
-
* @throws
|
|
301
|
+
* @throws When called before protocol negotiation completes.
|
|
288
302
|
*/
|
|
289
303
|
get info(): MCPConnectionInfo;
|
|
290
304
|
/**
|
|
@@ -348,9 +362,18 @@ export declare class MCPConnection {
|
|
|
348
362
|
}[];
|
|
349
363
|
_meta?: {
|
|
350
364
|
[x: string]: unknown;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
365
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
366
|
+
version: string;
|
|
367
|
+
name: string;
|
|
368
|
+
websiteUrl?: string | undefined;
|
|
369
|
+
description?: string | undefined;
|
|
370
|
+
icons?: {
|
|
371
|
+
src: string;
|
|
372
|
+
mimeType?: string | undefined;
|
|
373
|
+
sizes?: string[] | undefined;
|
|
374
|
+
theme?: "light" | "dark" | undefined;
|
|
375
|
+
}[] | undefined;
|
|
376
|
+
title?: string | undefined;
|
|
354
377
|
} | undefined;
|
|
355
378
|
} | undefined;
|
|
356
379
|
nextCursor?: string | undefined;
|
|
@@ -407,9 +430,18 @@ export declare class MCPConnection {
|
|
|
407
430
|
}[];
|
|
408
431
|
_meta?: {
|
|
409
432
|
[x: string]: unknown;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
433
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
434
|
+
version: string;
|
|
435
|
+
name: string;
|
|
436
|
+
websiteUrl?: string | undefined;
|
|
437
|
+
description?: string | undefined;
|
|
438
|
+
icons?: {
|
|
439
|
+
src: string;
|
|
440
|
+
mimeType?: string | undefined;
|
|
441
|
+
sizes?: string[] | undefined;
|
|
442
|
+
theme?: "light" | "dark" | undefined;
|
|
443
|
+
}[] | undefined;
|
|
444
|
+
title?: string | undefined;
|
|
413
445
|
} | undefined;
|
|
414
446
|
} | undefined;
|
|
415
447
|
nextCursor?: string | undefined;
|
|
@@ -464,9 +496,18 @@ export declare class MCPConnection {
|
|
|
464
496
|
})[];
|
|
465
497
|
_meta?: {
|
|
466
498
|
[x: string]: unknown;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
499
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
500
|
+
version: string;
|
|
501
|
+
name: string;
|
|
502
|
+
websiteUrl?: string | undefined;
|
|
503
|
+
description?: string | undefined;
|
|
504
|
+
icons?: {
|
|
505
|
+
src: string;
|
|
506
|
+
mimeType?: string | undefined;
|
|
507
|
+
sizes?: string[] | undefined;
|
|
508
|
+
theme?: "light" | "dark" | undefined;
|
|
509
|
+
}[] | undefined;
|
|
510
|
+
title?: string | undefined;
|
|
470
511
|
} | undefined;
|
|
471
512
|
} | undefined;
|
|
472
513
|
}>;
|
|
@@ -485,9 +526,18 @@ export declare class MCPConnection {
|
|
|
485
526
|
subscribeToResource(uri: string, options?: RequestOptions): Promise<{
|
|
486
527
|
_meta?: {
|
|
487
528
|
[x: string]: unknown;
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
529
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
530
|
+
version: string;
|
|
531
|
+
name: string;
|
|
532
|
+
websiteUrl?: string | undefined;
|
|
533
|
+
description?: string | undefined;
|
|
534
|
+
icons?: {
|
|
535
|
+
src: string;
|
|
536
|
+
mimeType?: string | undefined;
|
|
537
|
+
sizes?: string[] | undefined;
|
|
538
|
+
theme?: "light" | "dark" | undefined;
|
|
539
|
+
}[] | undefined;
|
|
540
|
+
title?: string | undefined;
|
|
491
541
|
} | undefined;
|
|
492
542
|
} | undefined;
|
|
493
543
|
}>;
|
|
@@ -505,9 +555,18 @@ export declare class MCPConnection {
|
|
|
505
555
|
unsubscribeFromResource(uri: string, options?: RequestOptions): Promise<{
|
|
506
556
|
_meta?: {
|
|
507
557
|
[x: string]: unknown;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
558
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
559
|
+
version: string;
|
|
560
|
+
name: string;
|
|
561
|
+
websiteUrl?: string | undefined;
|
|
562
|
+
description?: string | undefined;
|
|
563
|
+
icons?: {
|
|
564
|
+
src: string;
|
|
565
|
+
mimeType?: string | undefined;
|
|
566
|
+
sizes?: string[] | undefined;
|
|
567
|
+
theme?: "light" | "dark" | undefined;
|
|
568
|
+
}[] | undefined;
|
|
569
|
+
title?: string | undefined;
|
|
511
570
|
} | undefined;
|
|
512
571
|
} | undefined;
|
|
513
572
|
}>;
|
|
@@ -545,9 +604,18 @@ export declare class MCPConnection {
|
|
|
545
604
|
}[];
|
|
546
605
|
_meta?: {
|
|
547
606
|
[x: string]: unknown;
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
607
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
608
|
+
version: string;
|
|
609
|
+
name: string;
|
|
610
|
+
websiteUrl?: string | undefined;
|
|
611
|
+
description?: string | undefined;
|
|
612
|
+
icons?: {
|
|
613
|
+
src: string;
|
|
614
|
+
mimeType?: string | undefined;
|
|
615
|
+
sizes?: string[] | undefined;
|
|
616
|
+
theme?: "light" | "dark" | undefined;
|
|
617
|
+
}[] | undefined;
|
|
618
|
+
title?: string | undefined;
|
|
551
619
|
} | undefined;
|
|
552
620
|
} | undefined;
|
|
553
621
|
nextCursor?: string | undefined;
|
|
@@ -655,9 +723,18 @@ export declare class MCPConnection {
|
|
|
655
723
|
}[];
|
|
656
724
|
_meta?: {
|
|
657
725
|
[x: string]: unknown;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
726
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
727
|
+
version: string;
|
|
728
|
+
name: string;
|
|
729
|
+
websiteUrl?: string | undefined;
|
|
730
|
+
description?: string | undefined;
|
|
731
|
+
icons?: {
|
|
732
|
+
src: string;
|
|
733
|
+
mimeType?: string | undefined;
|
|
734
|
+
sizes?: string[] | undefined;
|
|
735
|
+
theme?: "light" | "dark" | undefined;
|
|
736
|
+
}[] | undefined;
|
|
737
|
+
title?: string | undefined;
|
|
661
738
|
} | undefined;
|
|
662
739
|
} | undefined;
|
|
663
740
|
description?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,IAAI,EACJ,IAAI,EACL,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,
|
|
1
|
+
{"version":3,"file":"session.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;;;;;OAYG;IACG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIvD;;;;;;;;;;;;OAYG;IACG,OAAO,CACX,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAW,EACzC,OAAO,CAAC,EAAE,cAAc;CAI3B;AAED,6CAA6C;AAC7C,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,CAAC;AAGvC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/index-browser.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { BrowserOAuthClientProvider, type BrowserOAuthOptions, } from "./auth/br
|
|
|
11
11
|
export { onMcpAuthorization } from "./auth/callback.js";
|
|
12
12
|
export { completeOAuthFlow, isUnauthorized } from "./auth/flow.js";
|
|
13
13
|
export { auth, UnauthorizedError } from "@modelcontextprotocol/client";
|
|
14
|
+
/** Browser-compatible MCP client for HTTP servers. */
|
|
14
15
|
export { BrowserMCPClient as MCPClient } from "./core/browser.js";
|
|
15
16
|
export * from "./core/session.js";
|
|
16
17
|
export * from "./core/config.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../src/index-browser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,k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