@mcp-use/client 2.2.3 → 2.2.4
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 +2 -2
- package/package.json +1 -1
- package/dist/.tsbuildinfo +0 -1
- package/dist/auth/browser.d.ts +0 -218
- package/dist/auth/browser.d.ts.map +0 -1
- package/dist/auth/callback.d.ts +0 -9
- package/dist/auth/callback.d.ts.map +0 -1
- package/dist/auth/flow.d.ts +0 -32
- package/dist/auth/flow.d.ts.map +0 -1
- package/dist/auth/node.d.ts +0 -212
- package/dist/auth/node.d.ts.map +0 -1
- package/dist/auth/popup.d.ts +0 -67
- package/dist/auth/popup.d.ts.map +0 -1
- package/dist/auth/session-store.d.ts +0 -125
- package/dist/auth/session-store.d.ts.map +0 -1
- package/dist/auth/storage-file.d.ts +0 -18
- package/dist/auth/storage-file.d.ts.map +0 -1
- package/dist/auth/storage.d.ts +0 -34
- package/dist/auth/storage.d.ts.map +0 -1
- package/dist/auth/url.d.ts +0 -17
- package/dist/auth/url.d.ts.map +0 -1
- package/dist/code-mode/connector.d.ts +0 -27
- package/dist/code-mode/connector.d.ts.map +0 -1
- package/dist/code-mode/executor-e2b.d.ts +0 -46
- package/dist/code-mode/executor-e2b.d.ts.map +0 -1
- package/dist/code-mode/executor-vm.d.ts +0 -39
- package/dist/code-mode/executor-vm.d.ts.map +0 -1
- package/dist/code-mode/executor.d.ts +0 -81
- package/dist/code-mode/executor.d.ts.map +0 -1
- package/dist/core/base.d.ts +0 -423
- package/dist/core/base.d.ts.map +0 -1
- package/dist/core/browser.d.ts +0 -32
- package/dist/core/browser.d.ts.map +0 -1
- package/dist/core/config.d.ts +0 -225
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/node.d.ts +0 -437
- package/dist/core/node.d.ts.map +0 -1
- package/dist/core/session.d.ts +0 -792
- package/dist/core/session.d.ts.map +0 -1
- package/dist/core/skills.d.ts +0 -47
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/index-browser.d.ts +0 -26
- package/dist/index-browser.d.ts.map +0 -1
- package/dist/index-browser.js +0 -4767
- package/dist/index-browser.js.map +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -6105
- package/dist/index.js.map +0 -1
- package/dist/react/McpClientProvider.d.ts +0 -254
- package/dist/react/McpClientProvider.d.ts.map +0 -1
- package/dist/react/index.d.ts +0 -39
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -9444
- package/dist/react/index.js.map +0 -1
- package/dist/react/rpc-logger.d.ts +0 -47
- package/dist/react/rpc-logger.d.ts.map +0 -1
- package/dist/react/storage.d.ts +0 -98
- package/dist/react/storage.d.ts.map +0 -1
- package/dist/react/token-expiry.d.ts +0 -9
- package/dist/react/token-expiry.d.ts.map +0 -1
- package/dist/react/types.d.ts +0 -727
- package/dist/react/types.d.ts.map +0 -1
- package/dist/react/useMcp-helpers.d.ts +0 -99
- package/dist/react/useMcp-helpers.d.ts.map +0 -1
- package/dist/react/useMcp-operations.d.ts +0 -180
- package/dist/react/useMcp-operations.d.ts.map +0 -1
- package/dist/react/useMcp.d.ts +0 -48
- package/dist/react/useMcp.d.ts.map +0 -1
- package/dist/react/useMcpServerQueues.d.ts +0 -403
- package/dist/react/useMcpServerQueues.d.ts.map +0 -1
- package/dist/react/view/ViewRenderer.d.ts +0 -20
- package/dist/react/view/ViewRenderer.d.ts.map +0 -1
- package/dist/react/view/ext-apps-bridge.d.ts +0 -3
- package/dist/react/view/ext-apps-bridge.d.ts.map +0 -1
- package/dist/react/view/initialized-sync.d.ts +0 -13
- package/dist/react/view/initialized-sync.d.ts.map +0 -1
- package/dist/react/view/inject-openai-file-apis.d.ts +0 -9
- package/dist/react/view/inject-openai-file-apis.d.ts.map +0 -1
- package/dist/react/view/parse-custom-props.d.ts +0 -10
- package/dist/react/view/parse-custom-props.d.ts.map +0 -1
- package/dist/react/view/resolve-view-resource.d.ts +0 -22
- package/dist/react/view/resolve-view-resource.d.ts.map +0 -1
- package/dist/react/view/sandbox-blob-url.d.ts +0 -27
- package/dist/react/view/sandbox-blob-url.d.ts.map +0 -1
- package/dist/react/view/types.d.ts +0 -220
- package/dist/react/view/types.d.ts.map +0 -1
- package/dist/react/view/use-display-mode.d.ts +0 -19
- package/dist/react/view/use-display-mode.d.ts.map +0 -1
- package/dist/react/view/view-detection.d.ts +0 -22
- package/dist/react/view/view-detection.d.ts.map +0 -1
- package/dist/react/view/view-host-policy.d.ts +0 -61
- package/dist/react/view/view-host-policy.d.ts.map +0 -1
- package/dist/sandbox.d.ts +0 -2
- package/dist/sandbox.d.ts.map +0 -1
- package/dist/sandbox.js +0 -288
- package/dist/sandbox.js.map +0 -1
- package/dist/telemetry/client-telemetry.d.ts +0 -13
- package/dist/telemetry/client-telemetry.d.ts.map +0 -1
- package/dist/telemetry/configure-browser.d.ts +0 -2
- package/dist/telemetry/configure-browser.d.ts.map +0 -1
- package/dist/telemetry/configure-node.d.ts +0 -2
- package/dist/telemetry/configure-node.d.ts.map +0 -1
- package/dist/telemetry/connector-telemetry.d.ts +0 -8
- package/dist/telemetry/connector-telemetry.d.ts.map +0 -1
- package/dist/telemetry/events.d.ts +0 -91
- package/dist/telemetry/events.d.ts.map +0 -1
- package/dist/telemetry/index.d.ts +0 -3
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/tel-fetch.d.ts +0 -19
- package/dist/telemetry/tel-fetch.d.ts.map +0 -1
- package/dist/telemetry/telemetry-browser.d.ts +0 -6
- package/dist/telemetry/telemetry-browser.d.ts.map +0 -1
- package/dist/telemetry/telemetry-node.d.ts +0 -8
- package/dist/telemetry/telemetry-node.d.ts.map +0 -1
- package/dist/telemetry/telemetry.d.ts +0 -75
- package/dist/telemetry/telemetry.d.ts.map +0 -1
- package/dist/transport/base.d.ts +0 -656
- package/dist/transport/base.d.ts.map +0 -1
- package/dist/transport/connection-manager.d.ts +0 -59
- package/dist/transport/connection-manager.d.ts.map +0 -1
- package/dist/transport/http.d.ts +0 -137
- package/dist/transport/http.d.ts.map +0 -1
- package/dist/transport/stdio.d.ts +0 -97
- package/dist/transport/stdio.d.ts.map +0 -1
- package/dist/utils/elicitation.d.ts +0 -54
- package/dist/utils/elicitation.d.ts.map +0 -1
- package/dist/utils/favicon.d.ts +0 -6
- package/dist/utils/favicon.d.ts.map +0 -1
- package/dist/utils/json-schema-validator.d.ts +0 -13
- package/dist/utils/json-schema-validator.d.ts.map +0 -1
- package/dist/utils/logging.d.ts +0 -33
- package/dist/utils/logging.d.ts.map +0 -1
- package/dist/utils/version.d.ts +0 -9
- package/dist/utils/version.d.ts.map +0 -1
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import type { ElicitResult } from "@modelcontextprotocol/client";
|
|
2
|
-
import type { SamplingCreateMessageResult } from "../core/config.js";
|
|
3
|
-
import React, { type ReactNode } from "react";
|
|
4
|
-
import type { StorageProvider } from "./storage.js";
|
|
5
|
-
import type { McpServer, McpServerConfig, PendingElicitationRequest, PendingSamplingRequest } from "./types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Context value for multi-server management
|
|
8
|
-
*/
|
|
9
|
-
export interface McpClientContextType {
|
|
10
|
-
/** Managed servers and their current reactive state. */
|
|
11
|
-
servers: McpServer[];
|
|
12
|
-
/** Idempotent — safe to call multiple times with the same id; duplicates are silently ignored. */
|
|
13
|
-
addServer: (id: string, config: McpServerConfig) => void;
|
|
14
|
-
/**
|
|
15
|
-
* Remove a server from the provider.
|
|
16
|
-
*
|
|
17
|
-
* By default this only tears down the live connection and leaves persisted
|
|
18
|
-
* OAuth credentials (tokens / client_info / PKCE verifier) intact, so routine
|
|
19
|
-
* remove+add churn (config refetches, deployment-status flips, env-scoped
|
|
20
|
-
* wrappers sharing a URL hash) does not silently log the user out.
|
|
21
|
-
*
|
|
22
|
-
* Pass `{ clearCredentials: true }` for an explicit logout / "forget this
|
|
23
|
-
* server" action to also wipe the persisted OAuth storage.
|
|
24
|
-
*/
|
|
25
|
-
removeServer: (id: string, opts?: {
|
|
26
|
-
clearCredentials?: boolean;
|
|
27
|
-
}) => Promise<void>;
|
|
28
|
-
/** Updates cached presentation metadata for a managed server. */
|
|
29
|
-
updateServerMetadata: (id: string, metadata: {
|
|
30
|
-
name: string;
|
|
31
|
-
}) => Promise<void>;
|
|
32
|
-
/** Merges configuration changes into a managed server. */
|
|
33
|
-
updateServer: (id: string, options: Partial<McpServerConfig>) => Promise<void>;
|
|
34
|
-
/** Returns a managed server by ID. */
|
|
35
|
-
getServer: (id: string) => McpServer | undefined;
|
|
36
|
-
/** Whether storage has finished loading (true if no storage provider) */
|
|
37
|
-
storageLoaded: boolean;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Props for McpClientProvider
|
|
41
|
-
*/
|
|
42
|
-
export interface McpClientProviderProps {
|
|
43
|
-
/** React subtree that can access the MCP client context. */
|
|
44
|
-
children: ReactNode;
|
|
45
|
-
/**
|
|
46
|
-
* Initial servers configuration (like Python MCPClient.from_dict)
|
|
47
|
-
* Servers defined here will be auto-connected on mount
|
|
48
|
-
*/
|
|
49
|
-
mcpServers?: Record<string, McpServerConfig>;
|
|
50
|
-
/**
|
|
51
|
-
* Default OAuth callback URL for all servers.
|
|
52
|
-
* Can be overridden per-server via the callbackUrl option in addServer().
|
|
53
|
-
* Useful when the app is mounted at a sub-path (e.g. /inspector) so the
|
|
54
|
-
* OAuth redirect lands on the correct route without requiring a server-side
|
|
55
|
-
* redirect shim.
|
|
56
|
-
*/
|
|
57
|
-
defaultCallbackUrl?: string;
|
|
58
|
-
/** Default same-origin OAuth BFF URL for browser OAuth requests. */
|
|
59
|
-
defaultOAuthProxyUrl?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Default proxy configuration for all servers
|
|
62
|
-
* Can be overridden per-server in addServer() options
|
|
63
|
-
*/
|
|
64
|
-
defaultProxyConfig?: {
|
|
65
|
-
/** Default MCP proxy endpoint. */
|
|
66
|
-
proxyAddress?: string;
|
|
67
|
-
/** Default headers sent to the MCP proxy. */
|
|
68
|
-
headers?: Record<string, string>;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Enable automatic proxy fallback for all servers by default
|
|
72
|
-
* When enabled, if a direct connection fails with FastMCP or CORS errors,
|
|
73
|
-
* automatically retries using proxy configuration
|
|
74
|
-
* @defaultValue false
|
|
75
|
-
*/
|
|
76
|
-
defaultAutoProxyFallback?: boolean | {
|
|
77
|
-
/** Whether automatic proxy fallback is enabled. */
|
|
78
|
-
enabled?: boolean;
|
|
79
|
-
/** Proxy endpoint used after direct connection fails. */
|
|
80
|
-
proxyAddress?: string;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Default connection options merged under each server's options (per-server wins).
|
|
84
|
-
* Useful for app-wide auth UX such as `preventAutoAuth` or `useRedirectFlow`.
|
|
85
|
-
*/
|
|
86
|
-
defaultServerConfig?: Partial<McpServerConfig>;
|
|
87
|
-
/**
|
|
88
|
-
* Client info for all servers (used for OAuth registration and server capabilities).
|
|
89
|
-
* Can be overridden per-server in addServer() options.
|
|
90
|
-
*
|
|
91
|
-
* The optional `capabilities` field sets default MCP capabilities advertised to
|
|
92
|
-
* every server managed by this provider (e.g. MCP Apps / SEP-1865 extensions).
|
|
93
|
-
* It is merged with per-server `clientOptions.capabilities` (per-server takes
|
|
94
|
-
* precedence) and is stripped from the actual MCP `clientInfo` wire field.
|
|
95
|
-
*/
|
|
96
|
-
clientInfo?: {
|
|
97
|
-
/** Client name displayed on OAuth consent pages (required) */
|
|
98
|
-
name: string;
|
|
99
|
-
/** Client title/display name */
|
|
100
|
-
title?: string;
|
|
101
|
-
/** Client version (required) */
|
|
102
|
-
version: string;
|
|
103
|
-
/** Client description */
|
|
104
|
-
description?: string;
|
|
105
|
-
/** Client icons (first icon used as logo_uri for OAuth) */
|
|
106
|
-
icons?: Array<{
|
|
107
|
-
/** Icon URL. */
|
|
108
|
-
src: string;
|
|
109
|
-
/** Icon media type. */
|
|
110
|
-
mimeType?: string;
|
|
111
|
-
/** Supported icon sizes, such as `"48x48"`. */
|
|
112
|
-
sizes?: string[];
|
|
113
|
-
}>;
|
|
114
|
-
/** Client website URL (used as client_uri for OAuth) */
|
|
115
|
-
websiteUrl?: string;
|
|
116
|
-
/**
|
|
117
|
-
* Default capabilities advertised to all servers managed by this provider.
|
|
118
|
-
* Per-server `clientOptions.capabilities` are merged on top, with per-server
|
|
119
|
-
* values taking precedence. Stripped from the MCP `clientInfo` wire field.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```tsx
|
|
123
|
-
* capabilities: {
|
|
124
|
-
* views: true,
|
|
125
|
-
* // or explicitly:
|
|
126
|
-
* extensions: {
|
|
127
|
-
* "io.modelcontextprotocol/ui": { mimeTypes: ["text/html;profile=mcp-app"] },
|
|
128
|
-
* },
|
|
129
|
-
* }
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
capabilities?: Record<string, unknown>;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Storage provider for persisting server configurations
|
|
136
|
-
* When provided, automatically loads servers on mount and saves on changes
|
|
137
|
-
*/
|
|
138
|
-
storageProvider?: StorageProvider;
|
|
139
|
-
/**
|
|
140
|
-
* Enable RPC logging for debugging (browser only)
|
|
141
|
-
* Logs all MCP protocol messages to console
|
|
142
|
-
*/
|
|
143
|
-
enableRpcLogging?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Callback when a server is added
|
|
146
|
-
*/
|
|
147
|
-
onServerAdded?: (id: string, server: McpServer) => void;
|
|
148
|
-
/**
|
|
149
|
-
* Callback when a server is removed
|
|
150
|
-
*/
|
|
151
|
-
onServerRemoved?: (id: string) => void;
|
|
152
|
-
/**
|
|
153
|
-
* Callback when a server's state changes
|
|
154
|
-
*/
|
|
155
|
-
onServerStateChange?: (id: string, state: McpServer["state"]) => void;
|
|
156
|
-
/**
|
|
157
|
-
* Callback when a sampling request is received from any server
|
|
158
|
-
* @param request - The sampling request details
|
|
159
|
-
* @param serverId - The ID of the server that sent the request
|
|
160
|
-
* @param serverName - The name of the server
|
|
161
|
-
* @param approve - Function to approve the request
|
|
162
|
-
* @param reject - Function to reject the request
|
|
163
|
-
*/
|
|
164
|
-
onSamplingRequest?: (request: PendingSamplingRequest, serverId: string, serverName: string, approve: (requestId: string, result: SamplingCreateMessageResult) => void, reject: (requestId: string, error?: string) => void) => void;
|
|
165
|
-
/**
|
|
166
|
-
* Callback when an elicitation request is received from any server
|
|
167
|
-
* @param request - The elicitation request details
|
|
168
|
-
* @param serverId - The ID of the server that sent the request
|
|
169
|
-
* @param serverName - The name of the server
|
|
170
|
-
* @param approve - Function to approve the request
|
|
171
|
-
* @param reject - Function to reject the request
|
|
172
|
-
*/
|
|
173
|
-
onElicitationRequest?: (request: PendingElicitationRequest, serverId: string, serverName: string, approve: (requestId: string, result: ElicitResult) => void, reject: (requestId: string, error?: string) => void) => void;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Provider for managing multiple MCP server connections
|
|
177
|
-
*
|
|
178
|
-
* Provides a context for adding/removing servers and accessing their state.
|
|
179
|
-
* Each server maintains its own connection, notification history, and
|
|
180
|
-
* pending sampling/elicitation requests.
|
|
181
|
-
*
|
|
182
|
-
* Supports:
|
|
183
|
-
* - Initial server configuration via `mcpServers` prop
|
|
184
|
-
* - Persistence via pluggable `storageProvider`
|
|
185
|
-
* - RPC logging for debugging
|
|
186
|
-
* - Lifecycle callbacks for state changes
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* ```tsx
|
|
190
|
-
* // With initial servers
|
|
191
|
-
* <McpClientProvider
|
|
192
|
-
* mcpServers={{
|
|
193
|
-
* linear: { url: "https://mcp.linear.app/sse" },
|
|
194
|
-
* github: { url: "https://mcp.github.com/mcp" }
|
|
195
|
-
* }}
|
|
196
|
-
* >
|
|
197
|
-
* <MyApp />
|
|
198
|
-
* </McpClientProvider>
|
|
199
|
-
*
|
|
200
|
-
* // With persistence
|
|
201
|
-
* <McpClientProvider
|
|
202
|
-
* storageProvider={new LocalStorageProvider("my-servers")}
|
|
203
|
-
* enableRpcLogging={true}
|
|
204
|
-
* >
|
|
205
|
-
* <MyApp />
|
|
206
|
-
* </McpClientProvider>
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
export declare function McpClientProvider({ children, mcpServers, defaultCallbackUrl, defaultOAuthProxyUrl, defaultProxyConfig, defaultAutoProxyFallback, defaultServerConfig, clientInfo, storageProvider, enableRpcLogging, onServerAdded, onServerRemoved, onServerStateChange, onSamplingRequest, onElicitationRequest, }: McpClientProviderProps): React.JSX.Element;
|
|
210
|
-
/**
|
|
211
|
-
* Hook to access the MCP client context
|
|
212
|
-
*
|
|
213
|
-
* Provides access to all servers and management functions.
|
|
214
|
-
* Must be used within a McpClientProvider.
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```tsx
|
|
218
|
-
* const {
|
|
219
|
-
* servers,
|
|
220
|
-
* addServer,
|
|
221
|
-
* removeServer,
|
|
222
|
-
* updateServer,
|
|
223
|
-
* updateServerMetadata,
|
|
224
|
-
* } = useMcpClient();
|
|
225
|
-
*
|
|
226
|
-
* // Add a server
|
|
227
|
-
* addServer("linear", { url: "https://mcp.linear.app/sse" });
|
|
228
|
-
*
|
|
229
|
-
* // Update a server's configured display name without reconnecting
|
|
230
|
-
* await updateServerMetadata("linear", { name: "Linear Production" });
|
|
231
|
-
*
|
|
232
|
-
* // Update connection-affecting configuration and reconnect
|
|
233
|
-
* await updateServer("linear", { headers: { Authorization: "Bearer ..." } });
|
|
234
|
-
* // Or from a connected server handle:
|
|
235
|
-
* await servers[0].setHeaders({ Authorization: "Bearer ..." });
|
|
236
|
-
*
|
|
237
|
-
* // Rename without reconnecting
|
|
238
|
-
* await servers[0].setDisplayName("Linear Production");
|
|
239
|
-
*
|
|
240
|
-
* // Access servers
|
|
241
|
-
* servers.forEach(server => {
|
|
242
|
-
* console.log(server.id, server.state);
|
|
243
|
-
* });
|
|
244
|
-
* ```
|
|
245
|
-
*/
|
|
246
|
-
export declare function useMcpClient(): McpClientContextType;
|
|
247
|
-
/**
|
|
248
|
-
* Retrieve the McpServer object for a given server id.
|
|
249
|
-
*
|
|
250
|
-
* @returns The `McpServer` for the provided `id`, or `undefined` if no matching server is registered.
|
|
251
|
-
* @throws If called outside of a `McpClientProvider` (context not available).
|
|
252
|
-
*/
|
|
253
|
-
export declare function useMcpServer(id: string): McpServer | undefined;
|
|
254
|
-
//# sourceMappingURL=McpClientProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpClientProvider.d.ts","sourceRoot":"","sources":["../../src/react/McpClientProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,yBAAyB,EACzB,sBAAsB,EAEvB,MAAM,YAAY,CAAC;AAUpB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,kGAAkG;IAClG,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACzD;;;;;;;;;;OAUG;IACH,YAAY,EAAE,CACZ,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KAClC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,iEAAiE;IACjE,oBAAoB,EAAE,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE;QAAE,IAAI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EAAE,MAAM,EAClB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,EAC1D,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,KAChD,IAAI,CAAC;CACX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAgC,EAChC,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,gBAAwB,EACxB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,GACrB,EAAE,sBAAsB,qBAojBxB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,YAAY,IAAI,oBAAoB,CAMnD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAM9D"}
|
package/dist/react/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React entry point for the MCP connection console.
|
|
3
|
-
*
|
|
4
|
-
* Provides the `useMcp` hook, the multi-server `McpClientProvider`, and the
|
|
5
|
-
* supporting storage / logging utilities for connecting to MCP servers from a
|
|
6
|
-
* React app. MCP Apps host rendering lives in {@link ViewRenderer}.
|
|
7
|
-
*/
|
|
8
|
-
export type { UseMcpOptions, UseMcpResult, ReconnectionOptions, McpServer, McpServerConfig,
|
|
9
|
-
/** @deprecated Use McpServerConfig */
|
|
10
|
-
McpServerOptions, PersistedMcpServerConfig, McpNotification, PendingSamplingRequest, PendingElicitationRequest, } from "./types.js";
|
|
11
|
-
export type { Skill, SkillDirectoryEntry, SkillDirectoryReadResult, SkillGetResult, SkillResource, SkillsListResult, } from "../core/skills.js";
|
|
12
|
-
export { SKILLS_EXTENSION_ID } from "../core/skills.js";
|
|
13
|
-
export { pickPersistedServerConfig, toPersistedServerConfig } from "./types.js";
|
|
14
|
-
export { useMcp } from "./useMcp.js";
|
|
15
|
-
export { detectFavicon } from "../utils/favicon.js";
|
|
16
|
-
export { onMcpAuthorization } from "../auth/callback.js";
|
|
17
|
-
export { isOAuthInteractionRequired } from "../auth/flow.js";
|
|
18
|
-
export { Tel, Telemetry, setTelemetrySource, } from "../telemetry/telemetry-browser.js";
|
|
19
|
-
export type { CallToolResult, ContentBlock, ElicitRequestFormParams, ElicitRequestURLParams, ElicitResult, GetPromptResult, JSONRPCMessage, Prompt, ReadResourceResult, Resource, ResourceTemplateType, Tool, Transport, } from "@modelcontextprotocol/client";
|
|
20
|
-
export type { SamplingCreateMessageParams, SamplingCreateMessageResult, } from "../core/config.js";
|
|
21
|
-
import type { SamplingCreateMessageParams, SamplingCreateMessageResult } from "../core/config.js";
|
|
22
|
-
/** JSON-RPC envelope for `sampling/createMessage`. */
|
|
23
|
-
export type SamplingCreateMessageRequest = {
|
|
24
|
-
/** JSON-RPC method name. */
|
|
25
|
-
method: "sampling/createMessage";
|
|
26
|
-
/** Sampling request parameters. */
|
|
27
|
-
params: SamplingCreateMessageParams;
|
|
28
|
-
};
|
|
29
|
-
/** @deprecated Use {@link SamplingCreateMessageRequest}. */
|
|
30
|
-
export type { SamplingCreateMessageRequest as CreateMessageRequest };
|
|
31
|
-
/** @deprecated Use {@link SamplingCreateMessageResult}. */
|
|
32
|
-
export type { SamplingCreateMessageResult as CreateMessageResult };
|
|
33
|
-
export { specTypeSchemas } from "@modelcontextprotocol/client";
|
|
34
|
-
export { McpClientProvider, useMcpClient, useMcpServer, } from "./McpClientProvider.js";
|
|
35
|
-
export type { McpClientContextType, McpClientProviderProps, } from "./McpClientProvider.js";
|
|
36
|
-
export { LocalStorageProvider, MemoryStorageProvider, type CachedServerMetadata, type StorageProvider, } from "./storage.js";
|
|
37
|
-
export { getRpcLogs, getAllRpcLogs, subscribeToRpcLogs, clearRpcLogs, type RpcLogEntry, } from "./rpc-logger.js";
|
|
38
|
-
export { ViewRenderer, resolveViewResource, getViewResourceUri, isViewResource, isViewTool, isToolVisibleToModel, parseCustomProps, buildSandboxProxyBlobHtml, buildViewSandboxBlobUrl, buildViewSandboxUrl, type ViewRendererProps, type ViewConnection, type ViewDisplayMode, type ViewCspMode, type ViewRendererSource, type ResolvedViewResource, type ViewCspViolation, type ViewLifecycleEvent, type ViewLifecycleStatus, type ViewAppToolConnection, type McpUiDownloadFileRequest, type McpUiDownloadFileResult, type McpUiHostCapabilities, type McpUiHostContext, type McpUiResourceCsp, type McpUiResourcePermissions, type McpUiSupportedContentBlockModalities, } from "./view/ViewRenderer.js";
|
|
39
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,eAAe;AACf,sCAAsC;AACtC,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAA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