mcp-use 2.0.0-beta.63 → 2.0.0-beta.65
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/dist/bin.js +1 -1
- package/dist/{chunk-VJ4S2BU7.js → chunk-ZG2PVYTM.js} +1 -1
- package/dist/context.d.ts +7 -0
- package/dist/index-node.js +14 -12
- package/dist/index.d.ts +10 -7
- package/dist/index.js +1 -1
- package/dist/internal/usage.js +1 -1
- package/dist/landing.d.ts +17 -4
- package/dist/middleware/mcp-middleware.d.ts +18 -0
- package/dist/next/config.d.ts +33 -4
- package/dist/next/handler.d.ts +16 -0
- package/dist/next/index.d.ts +5 -0
- package/dist/node-bridge.d.ts +33 -4
- package/dist/oauth/auth0.d.ts +24 -0
- package/dist/oauth/better-auth.d.ts +23 -0
- package/dist/oauth/clerk.d.ts +26 -0
- package/dist/oauth/keycloak.d.ts +28 -0
- package/dist/oauth/provider.d.ts +17 -1
- package/dist/oauth/supabase.d.ts +36 -1
- package/dist/oauth/workos.d.ts +27 -0
- package/dist/react/components/error-boundary.d.ts +3 -0
- package/dist/react/components/theme-provider.d.ts +4 -3
- package/dist/react/hooks/use-view-tool.d.ts +3 -3
- package/dist/react/index.d.ts +5 -13
- package/dist/react/index.js +7 -177
- package/dist/react/runtime/bootstrap-view.d.ts +3 -3
- package/dist/react/runtime/view-runtime.d.ts +0 -2
- package/dist/react/types/file-types.d.ts +2 -0
- package/dist/react/types/host-types.d.ts +2 -0
- package/dist/response-helpers.d.ts +8 -0
- package/dist/server.d.ts +2 -0
- package/dist/views/types.d.ts +3 -3
- package/package.json +8 -12
- package/dist/chunk-4TTKTNKI.js +0 -1
- package/dist/chunk-ZBN5QPYD.js +0 -1
- package/dist/compat-v1/oauth.d.ts +0 -37
- package/dist/compat-v1.d.ts +0 -528
- package/dist/compat-v1.js +0 -43
- package/dist/landing-handler-2IDA43KU.js +0 -630
- package/dist/mcp-proxy-O6GLK2IL.js +0 -2
- package/dist/public-route-GWDSKOSN.js +0 -1
- package/dist/react/compat-v1.d.ts +0 -221
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deprecated browser adapters for unchanged mcp-use v1 widgets.
|
|
3
|
-
*
|
|
4
|
-
* The adapters are deliberately composed from the native v2 runtime and
|
|
5
|
-
* hooks. They do not recreate the v1 bridge or its global event machinery.
|
|
6
|
-
*/
|
|
7
|
-
import type { CallToolResult, StandardSchemaWithJSON } from "@modelcontextprotocol/server";
|
|
8
|
-
import React, { type ReactNode } from "react";
|
|
9
|
-
import { ViewControls } from "./components/view-controls.js";
|
|
10
|
-
import type { DisplayMode, SafeAreaInsets } from "./types/host-types.js";
|
|
11
|
-
/** @deprecated Use native v2 registered result types. Removed in mcp-use v3. */
|
|
12
|
-
export type UnknownObject = Record<string, unknown>;
|
|
13
|
-
/** @deprecated Use native v2 host types. Removed in mcp-use v3. */
|
|
14
|
-
export type Theme = "light" | "dark";
|
|
15
|
-
/**
|
|
16
|
-
* Metadata accepted by `resources/<name>/widget.tsx` during v1 compatibility
|
|
17
|
-
* discovery.
|
|
18
|
-
*
|
|
19
|
-
* @deprecated Export native v2 `viewConfig` from `views/<name>/view.tsx` and
|
|
20
|
-
* bind resource facts on the server tool. Removed in mcp-use v3.
|
|
21
|
-
*/
|
|
22
|
-
export interface WidgetMetadata {
|
|
23
|
-
/** Widget title. */
|
|
24
|
-
title?: string;
|
|
25
|
-
/** Widget description. */
|
|
26
|
-
description?: string;
|
|
27
|
-
/** Widget props/input schema. */
|
|
28
|
-
props?: StandardSchemaWithJSON | unknown[];
|
|
29
|
-
/** Deprecated alias for props. */
|
|
30
|
-
inputs?: StandardSchemaWithJSON | unknown[];
|
|
31
|
-
/** Deprecated alias for props. */
|
|
32
|
-
schema?: StandardSchemaWithJSON | unknown[];
|
|
33
|
-
/** Model-facing output for an auto-registered widget tool. */
|
|
34
|
-
toolOutput?: CallToolResult | ((params: UnknownObject) => CallToolResult | Promise<CallToolResult>);
|
|
35
|
-
/** Whether CLI discovery auto-registers a same-named tool. */
|
|
36
|
-
exposeAsTool?: boolean;
|
|
37
|
-
/** Tool/resource annotations used by the compatibility registration. */
|
|
38
|
-
annotations?: UnknownObject;
|
|
39
|
-
/** Extension metadata. */
|
|
40
|
-
_meta?: UnknownObject;
|
|
41
|
-
/** Unified legacy widget metadata. */
|
|
42
|
-
metadata?: {
|
|
43
|
-
/** Resource description. */
|
|
44
|
-
description?: string;
|
|
45
|
-
/** MCP Apps CSP. */
|
|
46
|
-
csp?: UnknownObject;
|
|
47
|
-
/** Host border preference. */
|
|
48
|
-
prefersBorder?: boolean;
|
|
49
|
-
/** Dedicated view domain. */
|
|
50
|
-
domain?: string;
|
|
51
|
-
/** Human-readable Apps SDK widget summary. */
|
|
52
|
-
widgetDescription?: string;
|
|
53
|
-
/** Whether the v2 bootstrap automatically reports size changes. */
|
|
54
|
-
autoResize?: boolean;
|
|
55
|
-
/** Invocation status text. */
|
|
56
|
-
invoking?: string;
|
|
57
|
-
/** Completion status text. */
|
|
58
|
-
invoked?: string;
|
|
59
|
-
};
|
|
60
|
-
/** Legacy OpenAI Apps SDK resource metadata. */
|
|
61
|
-
appsSdkMetadata?: UnknownObject;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* v1 provider props translated onto native v2 theme and control components.
|
|
65
|
-
*
|
|
66
|
-
* @deprecated Compose native v2 view components directly. Removed in mcp-use
|
|
67
|
-
* v3.
|
|
68
|
-
*/
|
|
69
|
-
export interface McpUseProviderProps {
|
|
70
|
-
/** Widget children. */
|
|
71
|
-
children: ReactNode;
|
|
72
|
-
/** Show the debug overlay. */
|
|
73
|
-
debugger?: boolean;
|
|
74
|
-
/** Show display-mode controls. */
|
|
75
|
-
viewControls?: boolean | "pip" | "fullscreen";
|
|
76
|
-
/** Retained for source compatibility; sizing is owned by viewConfig/bootstrap. */
|
|
77
|
-
autoSize?: boolean;
|
|
78
|
-
/** Apply the active theme as the document color scheme. */
|
|
79
|
-
colorScheme?: boolean;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* v1 widget provider composed over the native v2 view runtime.
|
|
83
|
-
*
|
|
84
|
-
* @deprecated Use native v2 hooks/components from `mcp-use/react`. Removed in
|
|
85
|
-
* mcp-use v3.
|
|
86
|
-
*/
|
|
87
|
-
export declare function McpUseProvider({ children, debugger: enableDebugger, viewControls, colorScheme, }: McpUseProviderProps): React.ReactElement;
|
|
88
|
-
/** @deprecated Use native v2 `CallToolResult`. Removed in mcp-use v3. */
|
|
89
|
-
export interface CallToolResponse extends CallToolResult {
|
|
90
|
-
/** Joined text content convenience field. */
|
|
91
|
-
result: string;
|
|
92
|
-
}
|
|
93
|
-
/** @deprecated Use native v2 `SafeAreaInsets`. Removed in mcp-use v3. */
|
|
94
|
-
export interface SafeArea {
|
|
95
|
-
/** Host safe-area insets. */
|
|
96
|
-
insets: SafeAreaInsets;
|
|
97
|
-
}
|
|
98
|
-
/** @deprecated Use native v2 host context. Removed in mcp-use v3. */
|
|
99
|
-
export interface UserAgent {
|
|
100
|
-
/** Coarse device category. */
|
|
101
|
-
device: {
|
|
102
|
-
type: "mobile" | "tablet" | "desktop" | "unknown";
|
|
103
|
-
};
|
|
104
|
-
/** Input capabilities. */
|
|
105
|
-
capabilities: {
|
|
106
|
-
hover: boolean;
|
|
107
|
-
touch: boolean;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Common v1 `useWidget()` return surface.
|
|
112
|
-
*
|
|
113
|
-
* @deprecated Use focused native v2 hooks such as `useToolContext`,
|
|
114
|
-
* `useHostContext`, and `useCallTool`. Removed in mcp-use v3.
|
|
115
|
-
*/
|
|
116
|
-
interface UseWidgetResultBase<TState = UnknownObject, TOutput = UnknownObject, TMetadata = UnknownObject, TToolInput = UnknownObject> {
|
|
117
|
-
/** Complete or partial tool input. */
|
|
118
|
-
toolInput: TToolInput;
|
|
119
|
-
/** Structured tool output, or null while pending/error. */
|
|
120
|
-
output: TOutput | null;
|
|
121
|
-
/** Tool result metadata. */
|
|
122
|
-
metadata: TMetadata | null;
|
|
123
|
-
/** Locally cached model-visible widget state. */
|
|
124
|
-
state: TState | null;
|
|
125
|
-
/** Update model-visible widget state. */
|
|
126
|
-
setState(state: TState | ((previous: TState | null) => TState)): Promise<void>;
|
|
127
|
-
/** Active host theme. */
|
|
128
|
-
theme: Theme;
|
|
129
|
-
/** Current display mode. */
|
|
130
|
-
displayMode: DisplayMode;
|
|
131
|
-
/** Host safe-area wrapper. */
|
|
132
|
-
safeArea: SafeArea;
|
|
133
|
-
/** Maximum host height, using the v1 600px default when unbounded. */
|
|
134
|
-
maxHeight: number;
|
|
135
|
-
/** Maximum host width. */
|
|
136
|
-
maxWidth?: number;
|
|
137
|
-
/** v1 device summary. */
|
|
138
|
-
userAgent: UserAgent;
|
|
139
|
-
/** Host locale. */
|
|
140
|
-
locale: string;
|
|
141
|
-
/** Host timezone. */
|
|
142
|
-
timeZone: string;
|
|
143
|
-
/** Public MCP origin exposed inside the sandbox. */
|
|
144
|
-
mcp_url: string;
|
|
145
|
-
/** Call any server tool through the native MCP Apps bridge. */
|
|
146
|
-
callTool(name: string, args: UnknownObject): Promise<CallToolResponse>;
|
|
147
|
-
/** Send a follow-up user message. */
|
|
148
|
-
sendFollowUpMessage(content: string | Array<{
|
|
149
|
-
type: string;
|
|
150
|
-
[key: string]: unknown;
|
|
151
|
-
}>): Promise<void>;
|
|
152
|
-
/** Ask the host to open an external URL. */
|
|
153
|
-
openExternal(href: string): void;
|
|
154
|
-
/** Request a host display mode. */
|
|
155
|
-
requestDisplayMode(mode: DisplayMode): Promise<{
|
|
156
|
-
mode: DisplayMode;
|
|
157
|
-
}>;
|
|
158
|
-
/** Whether the native MCP Apps bridge is connected. */
|
|
159
|
-
isAvailable: boolean;
|
|
160
|
-
/** Best-effort partial input while pending. */
|
|
161
|
-
partialToolInput: Partial<TToolInput> | null;
|
|
162
|
-
/** Whether partial input is currently available. */
|
|
163
|
-
isStreaming: boolean;
|
|
164
|
-
/** Connected host identity. */
|
|
165
|
-
hostInfo?: {
|
|
166
|
-
name: string;
|
|
167
|
-
version: string;
|
|
168
|
-
};
|
|
169
|
-
/** Connected host capabilities. */
|
|
170
|
-
hostCapabilities?: UnknownObject;
|
|
171
|
-
/** Raw native host context. */
|
|
172
|
-
hostContext?: UnknownObject;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Common v1 `useWidget()` return surface. `isPending` narrows `props` exactly
|
|
176
|
-
* as it did in v1, so unchanged widgets can safely render required props.
|
|
177
|
-
*
|
|
178
|
-
* @deprecated Use focused native v2 hooks. Removed in mcp-use v3.
|
|
179
|
-
*/
|
|
180
|
-
export type UseWidgetResult<TProps = UnknownObject, TState = UnknownObject, TOutput = UnknownObject, TMetadata = UnknownObject, TToolInput = UnknownObject> = UseWidgetResultBase<TState, TOutput, TMetadata, TToolInput> & ({
|
|
181
|
-
isPending: true;
|
|
182
|
-
props: Partial<TProps>;
|
|
183
|
-
} | {
|
|
184
|
-
isPending: false;
|
|
185
|
-
props: TProps;
|
|
186
|
-
});
|
|
187
|
-
/**
|
|
188
|
-
* v1 all-in-one widget hook implemented from the native v2 runtime channels.
|
|
189
|
-
*
|
|
190
|
-
* @deprecated Use focused native v2 hooks from `mcp-use/react`. Removed in
|
|
191
|
-
* mcp-use v3.
|
|
192
|
-
*/
|
|
193
|
-
export declare function useWidget<TProps = UnknownObject, TState = UnknownObject, TOutput = UnknownObject, TMetadata = UnknownObject, TToolInput = UnknownObject>(defaultProps?: TProps): UseWidgetResult<TProps, TState, TOutput, TMetadata, TToolInput>;
|
|
194
|
-
/**
|
|
195
|
-
* Read v1 widget props.
|
|
196
|
-
*
|
|
197
|
-
* @deprecated Use native v2 `useToolContext`. Removed in mcp-use v3.
|
|
198
|
-
*/
|
|
199
|
-
export declare function useWidgetProps<TProps = UnknownObject>(defaultProps?: TProps): Partial<TProps>;
|
|
200
|
-
/**
|
|
201
|
-
* Read the v1 widget theme.
|
|
202
|
-
*
|
|
203
|
-
* @deprecated Use native v2 `useViewTheme`. Removed in mcp-use v3.
|
|
204
|
-
*/
|
|
205
|
-
export declare function useWidgetTheme(): Theme;
|
|
206
|
-
/**
|
|
207
|
-
* Read and update v1 widget state.
|
|
208
|
-
*
|
|
209
|
-
* @deprecated Use native v2 model-context APIs. Removed in mcp-use v3.
|
|
210
|
-
*/
|
|
211
|
-
export declare function useWidgetState<TState>(defaultState?: TState): readonly [
|
|
212
|
-
TState | null,
|
|
213
|
-
(state: TState | ((previous: TState | null) => TState)) => Promise<void>
|
|
214
|
-
];
|
|
215
|
-
/**
|
|
216
|
-
* v1 name for native v2 `ViewControls`.
|
|
217
|
-
*
|
|
218
|
-
* @deprecated Use `ViewControls`. Removed in mcp-use v3.
|
|
219
|
-
*/
|
|
220
|
-
export declare const WidgetControls: typeof ViewControls;
|
|
221
|
-
export {};
|