Merge remote-tracking branch 'origin2/main' into meta_properies_in_tools

This commit is contained in:
lorenzo.neumann 2025-10-24 15:04:38 +02:00
commit caa1a2e1f5
5 changed files with 1559 additions and 776 deletions

View file

@ -121,10 +121,16 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
return window.location.origin + "/oauth/callback/debug";
}
get redirect_uris() {
// Normally register both redirect URIs to support both normal and debug flows
// In debug subclass, redirectUrl may be the same as debugRedirectUrl, so remove duplicates
// See: https://github.com/modelcontextprotocol/inspector/issues/825
return [...new Set([this.redirectUrl, this.debugRedirectUrl])];
}
get clientMetadata(): OAuthClientMetadata {
// Register both redirect URIs to support both normal and debug flows
return {
redirect_uris: [this.redirectUrl, this.debugRedirectUrl],
redirect_uris: this.redirect_uris,
token_endpoint_auth_method: "none",
grant_types: ["authorization_code", "refresh_token"],
response_types: ["code"],

View file

@ -14,7 +14,8 @@ export type ConfigItem = {
*/
export type InspectorConfig = {
/**
* Maximum time in milliseconds to wait for a response from the MCP server before timing out.
* Client-side timeout in milliseconds. The Inspector will cancel the request if no response
* is received within this time. Note: This is independent of any server-side timeouts.
*/
MCP_SERVER_REQUEST_TIMEOUT: ConfigItem;

View file

@ -43,8 +43,9 @@ export const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = {
MCP_SERVER_REQUEST_TIMEOUT: {
label: "Request Timeout",
description: "Timeout for requests to the MCP server (ms)",
value: 10000,
description:
"Client-side timeout (ms) - Inspector will cancel requests after this time",
value: 300000, // 5 minutes - increased to support elicitation and other long-running tools
is_session_item: false,
},
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {

View file

@ -67,6 +67,7 @@ interface UseConnectionOptions {
// Custom headers support
customHeaders?: CustomHeaders;
oauthClientId?: string;
oauthClientSecret?: string;
oauthScope?: string;
config: InspectorConfig;
connectionType?: "direct" | "proxy";
@ -90,6 +91,7 @@ export function useConnection({
env,
customHeaders,
oauthClientId,
oauthClientSecret,
oauthScope,
config,
connectionType = "proxy",
@ -127,12 +129,20 @@ export function useConnection({
return;
}
const clientInformation: { client_id: string; client_secret?: string } = {
client_id: oauthClientId,
};
if (oauthClientSecret) {
clientInformation.client_secret = oauthClientSecret;
}
saveClientInformationToSessionStorage({
serverUrl: sseUrl,
clientInformation: { client_id: oauthClientId },
clientInformation,
isPreregistered: true,
});
}, [oauthClientId, sseUrl]);
}, [oauthClientId, oauthClientSecret, sseUrl]);
const pushHistory = (request: object, response?: object) => {
setRequestHistory((prev) => [

View file

@ -21,7 +21,7 @@ function useCopy({ timeout = 500 }: UseCopyProps = {}) {
clearTimeout(timeoutId);
}
};
}, [copied]);
}, [copied, timeout]);
return { copied, setCopied };
}