@cline/core 0.0.70 → 0.0.71-nightly.1786072417

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.
@@ -6,4 +6,19 @@ export interface DefaultMcpServerClientFactoryOptions {
6
6
  clientVersion?: string;
7
7
  fetch?: FetchLike;
8
8
  }
9
+ export interface ProbeMcpServerConnectionOptions extends Omit<DefaultMcpServerClientFactoryOptions, "settingsPath"> {
10
+ serverName: string;
11
+ filePath?: string;
12
+ }
13
+ export interface ProbeMcpServerConnectionResult {
14
+ serverName: string;
15
+ connected: boolean;
16
+ authorizationRequired: boolean;
17
+ error?: string;
18
+ }
9
19
  export declare function createDefaultMcpServerClientFactory(options?: DefaultMcpServerClientFactoryOptions): McpServerClientFactory;
20
+ /**
21
+ * Passively verifies a configured remote MCP endpoint. This may use or refresh
22
+ * existing credentials, but it never starts an interactive OAuth redirect.
23
+ */
24
+ export declare function probeMcpServerConnection(options: ProbeMcpServerConnectionOptions): Promise<ProbeMcpServerConnectionResult>;
@@ -1,11 +1,18 @@
1
1
  import type { BasicLogger } from "@cline/shared";
2
- import type { McpManager, McpServerOAuthState, McpServerOAuthStatus, McpServerRegistration } from "./types";
2
+ import type { McpManager, McpServerOAuthClientConfig, McpServerOAuthState, McpServerOAuthStatus, McpServerRegistration } from "./types";
3
3
  export interface McpSettingsFile {
4
4
  mcpServers: Record<string, Omit<McpServerRegistration, "name">>;
5
5
  }
6
6
  export interface LoadMcpSettingsOptions {
7
7
  filePath?: string;
8
8
  }
9
+ export interface UpdateMcpServerOAuthStateOptions extends LoadMcpSettingsOptions {
10
+ /**
11
+ * When present, only update OAuth state while the server still has this
12
+ * configured client. `null` asserts that dynamic registration is still in use.
13
+ */
14
+ expectedOAuthClient?: McpServerOAuthClientConfig | null;
15
+ }
9
16
  export interface RegisterMcpServersFromSettingsOptions {
10
17
  filePath?: string;
11
18
  }
@@ -24,6 +31,9 @@ export type McpSettingsMutator<T> = (settings: Record<string, unknown>) => T;
24
31
  export declare class McpSettingsUpdateSkippedError extends Error {
25
32
  constructor(message: string);
26
33
  }
34
+ export declare class McpOAuthClientChangedError extends Error {
35
+ constructor(serverName: string);
36
+ }
27
37
  export declare class McpSettingsLockTimeoutError extends Error {
28
38
  constructor(message: string);
29
39
  }
@@ -61,6 +71,14 @@ export declare function loadMcpSettingsFile(options?: LoadMcpSettingsOptions): M
61
71
  export declare function normalizeMcpServerOAuthState(value: McpServerOAuthState | undefined): McpServerOAuthState | undefined;
62
72
  export declare function hasMcpSettingsFile(options?: LoadMcpSettingsOptions): boolean;
63
73
  export declare function resolveMcpServerRegistrations(options?: LoadMcpSettingsOptions): McpServerRegistration[];
74
+ /**
75
+ * Parses one raw MCP settings entry without requiring sibling entries to be
76
+ * valid. Hosts with an editable settings UI can use this to keep healthy and
77
+ * repairable entries visible when a hand-edited sibling is malformed.
78
+ */
79
+ export declare function parseMcpServerRegistration(name: string, value: unknown): McpServerRegistration;
80
+ /** Resolves one configured server without requiring sibling entries to parse. */
81
+ export declare function resolveMcpServerRegistration(serverName: string, options?: LoadMcpSettingsOptions): McpServerRegistration | undefined;
64
82
  export declare function setMcpServerDisabled(options: SetMcpServerDisabledOptions): void;
65
83
  export declare function getMcpServerOAuthState(serverName: string, options?: LoadMcpSettingsOptions): McpServerOAuthState | undefined;
66
84
  /**
@@ -71,12 +89,14 @@ export declare function getMcpServerOAuthState(serverName: string, options?: Loa
71
89
  *
72
90
  * TODO: Delete once all callers migrate to {@link updateMcpServerOAuthStateAsync}.
73
91
  */
74
- export declare function updateMcpServerOAuthState(serverName: string, updater: (current: McpServerOAuthState) => McpServerOAuthState, options?: LoadMcpSettingsOptions): McpServerOAuthState;
92
+ export declare function updateMcpServerOAuthState(serverName: string, updater: (current: McpServerOAuthState) => McpServerOAuthState, options?: UpdateMcpServerOAuthStateOptions): McpServerOAuthState;
75
93
  /**
76
94
  * Scoped read-modify-write of one server's `oauth` block that yields the event
77
95
  * loop while acquiring the lock. The updater is synchronous and pure; it
78
96
  * receives the server's current OAuth state and returns the next state.
79
97
  */
80
- export declare function updateMcpServerOAuthStateAsync(serverName: string, updater: (current: McpServerOAuthState) => McpServerOAuthState, options?: LoadMcpSettingsOptions): Promise<McpServerOAuthState>;
98
+ export declare function updateMcpServerOAuthStateAsync(serverName: string, updater: (current: McpServerOAuthState) => McpServerOAuthState, options?: UpdateMcpServerOAuthStateOptions): Promise<McpServerOAuthState>;
81
99
  export declare function listMcpServerOAuthStatuses(options?: LoadMcpSettingsOptions): McpServerOAuthStatus[];
100
+ /** Calculates OAuth status for one already-parsed registration. */
101
+ export declare function getMcpServerOAuthStatus(registration: McpServerRegistration): McpServerOAuthStatus;
82
102
  export declare function registerMcpServersFromSettingsFile(manager: Pick<McpManager, "registerServer">, options?: RegisterMcpServersFromSettingsOptions): Promise<McpServerRegistration[]>;
@@ -1,7 +1,7 @@
1
- export type { DefaultMcpServerClientFactoryOptions } from "./client";
2
- export { createDefaultMcpServerClientFactory } from "./client";
3
- export type { LoadMcpSettingsOptions, McpSettingsFile, McpSettingsLockOptions, McpSettingsMutator, RegisterMcpServersFromSettingsOptions, SetMcpServerDisabledOptions, } from "./config-loader";
4
- export { getMcpServerOAuthState, hasMcpSettingsFile, listMcpServerOAuthStatuses, loadMcpSettingsFile, McpSettingsLockTimeoutError, McpSettingsMutatorPurityError, McpSettingsUpdateSkippedError, registerMcpServersFromSettingsFile, resolveDefaultMcpSettingsPath, resolveMcpServerRegistrations, setMcpServerDisabled, updateMcpServerOAuthState, updateMcpServerOAuthStateAsync, updateMcpSettingsFile, updateMcpSettingsFileSync, } from "./config-loader";
1
+ export type { DefaultMcpServerClientFactoryOptions, ProbeMcpServerConnectionOptions, ProbeMcpServerConnectionResult, } from "./client";
2
+ export { createDefaultMcpServerClientFactory, probeMcpServerConnection, } from "./client";
3
+ export type { LoadMcpSettingsOptions, McpSettingsFile, McpSettingsLockOptions, McpSettingsMutator, RegisterMcpServersFromSettingsOptions, SetMcpServerDisabledOptions, UpdateMcpServerOAuthStateOptions, } from "./config-loader";
4
+ export { getMcpServerOAuthState, getMcpServerOAuthStatus, hasMcpSettingsFile, listMcpServerOAuthStatuses, loadMcpSettingsFile, McpOAuthClientChangedError, McpSettingsLockTimeoutError, McpSettingsMutatorPurityError, McpSettingsUpdateSkippedError, parseMcpServerRegistration, registerMcpServersFromSettingsFile, resolveDefaultMcpSettingsPath, resolveMcpServerRegistration, resolveMcpServerRegistrations, setMcpServerDisabled, updateMcpServerOAuthState, updateMcpServerOAuthStateAsync, updateMcpSettingsFile, updateMcpSettingsFileSync, } from "./config-loader";
5
5
  export { InMemoryMcpManager } from "./manager";
6
6
  export type { AuthorizeMcpServerOAuthOptions, AuthorizeMcpServerOAuthResult, CreateMcpOAuthProviderContextOptions, McpOAuthProviderContext, } from "./oauth";
7
7
  export { authorizeMcpServerOAuth } from "./oauth";
@@ -11,4 +11,4 @@ export type { CreateDisabledMcpToolPoliciesOptions, CreateDisabledMcpToolPolicyO
11
11
  export { createDisabledMcpToolPolicies, createDisabledMcpToolPolicy, } from "./policies";
12
12
  export { augmentMcpTimeoutError } from "./timeout";
13
13
  export { createMcpTools } from "./tools";
14
- export type { CreateMcpToolsOptions, McpConnectionStatus, McpManager, McpManagerOptions, McpServerClient, McpServerClientFactory, McpServerOAuthState, McpServerOAuthStatus, McpServerRegistration, McpServerSnapshot, McpServerTransportConfig, McpSseTransportConfig, McpStdioTransportConfig, McpStreamableHttpTransportConfig, McpToolCallRequest, McpToolCallResult, McpToolDescriptor, McpToolNameTransform, McpToolProvider, } from "./types";
14
+ export type { CreateMcpToolsOptions, McpConnectionStatus, McpManager, McpManagerOptions, McpServerClient, McpServerClientFactory, McpServerOAuthClientConfig, McpServerOAuthState, McpServerOAuthStatus, McpServerRegistration, McpServerSnapshot, McpServerTransportConfig, McpSseTransportConfig, McpStdioTransportConfig, McpStreamableHttpTransportConfig, McpToolCallRequest, McpToolCallResult, McpToolDescriptor, McpToolNameTransform, McpToolProvider, } from "./types";
@@ -1,15 +1,17 @@
1
1
  import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
2
2
  import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
3
3
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
4
+ import type { OAuthClientInformationMixed } from "@modelcontextprotocol/sdk/shared/auth.js";
4
5
  import type { FetchLike } from "@modelcontextprotocol/sdk/shared/transport.js";
5
6
  import { type OAuthServerCloseInfo, type OAuthServerListeningInfo } from "../../auth/server";
6
- import type { McpServerRegistration } from "./types";
7
+ import type { McpServerOAuthClientConfig, McpServerRegistration } from "./types";
7
8
  export type McpSdkAuthCapableTransport = SSEClientTransport | StreamableHTTPClientTransport;
8
9
  export interface CreateMcpOAuthProviderContextOptions {
9
10
  settingsPath?: string;
10
11
  serverName: string;
11
12
  redirectUrl: string;
12
13
  onAuthorizationUrl?: (url: string) => void | Promise<void>;
14
+ clientInformation?: OAuthClientInformationMixed;
13
15
  }
14
16
  export interface McpOAuthProviderContext {
15
17
  provider: OAuthClientProvider;
@@ -17,6 +19,8 @@ export interface McpOAuthProviderContext {
17
19
  getLastOAuthState(): string | undefined;
18
20
  resetInteractiveState(): Promise<void>;
19
21
  markError(errorMessage: string): Promise<void>;
22
+ markConnectionError(errorMessage: string): Promise<void>;
23
+ markAuthorizationRequired(errorMessage: string): Promise<void>;
20
24
  clearError(): Promise<void>;
21
25
  }
22
26
  export interface AuthorizeMcpServerOAuthOptions {
@@ -33,12 +37,14 @@ export interface AuthorizeMcpServerOAuthOptions {
33
37
  successHtml?: string;
34
38
  onServerListening?: (info: OAuthServerListeningInfo) => void | Promise<void>;
35
39
  onServerClose?: (info: OAuthServerCloseInfo) => void | Promise<void>;
40
+ signal?: AbortSignal;
36
41
  }
37
42
  export interface AuthorizeMcpServerOAuthResult {
38
43
  serverName: string;
39
44
  authorized: true;
40
45
  message: string;
41
46
  }
47
+ export declare function createMcpOAuthClientInformation(config: McpServerOAuthClientConfig | undefined): OAuthClientInformationMixed | undefined;
42
48
  export declare function createMcpOAuthProviderContext(options: CreateMcpOAuthProviderContextOptions): McpOAuthProviderContext;
43
49
  export declare function createMcpSdkTransport(input: {
44
50
  registration: McpServerRegistration;
@@ -0,0 +1,9 @@
1
+ import type { McpServerTransportConfig, McpStdioTransportConfig, McpStreamableHttpTransportConfig } from "./types";
2
+ /**
3
+ * Recognizes the exact no-option `npx mcp-remote <url>` proxy shape emitted by
4
+ * older marketplace entries. Cline has a native Streamable HTTP transport, so
5
+ * spawning the proxy would duplicate OAuth handling and let the child process
6
+ * open a browser as a side effect of merely enabling the server.
7
+ */
8
+ export declare function resolveMcpRemoteProxyTransport(transport: McpStdioTransportConfig): McpStreamableHttpTransportConfig | undefined;
9
+ export declare function resolveNativeMcpTransport(transport: McpServerTransportConfig): McpServerTransportConfig;
@@ -54,6 +54,11 @@ export interface McpServerOAuthState {
54
54
  redirectUrl?: string;
55
55
  lastError?: string;
56
56
  lastAuthenticatedAt?: number;
57
+ authorizationRequired?: boolean;
58
+ }
59
+ export interface McpServerOAuthClientConfig {
60
+ clientId: string;
61
+ clientSecret?: string;
57
62
  }
58
63
  export interface McpServerRegistration {
59
64
  name: string;
@@ -69,6 +74,7 @@ export interface McpServerRegistration {
69
74
  */
70
75
  timeoutSeconds?: number;
71
76
  metadata?: Record<string, unknown>;
77
+ oauthClient?: McpServerOAuthClientConfig;
72
78
  oauth?: McpServerOAuthState;
73
79
  }
74
80
  export interface McpServerSnapshot {
@@ -95,6 +101,7 @@ export interface McpServerOAuthStatus {
95
101
  serverName: string;
96
102
  oauthSupported: boolean;
97
103
  oauthConfigured: boolean;
104
+ authorizationRequired: boolean;
98
105
  lastError?: string;
99
106
  lastAuthenticatedAt?: number;
100
107
  }