cline/cline · error · Error

MCP server "${serverName}" did not start an OAuth stateful a

Error message

MCP server "${serverName}" did not start an OAuth stateful authorization flow.

What it means

Error "MCP server "${serverName}" did not start an OAuth stateful authorization flow." thrown in cline/cline.

Source

Thrown at sdk/packages/core/src/extensions/mcp/oauth.ts:614

					throw new Error(
						`MCP server "${serverName}" OAuth authorization was cancelled.`,
					);
				}
				throw new Error(
					"Timed out waiting for MCP OAuth authorization callback.",
				);
			}
			if (callback.error) {
				throw new Error(`OAuth authorization failed: ${callback.error}`);
			}
			if (!callback.code) {
				throw new Error(
					"OAuth callback did not include an authorization code.",
				);
			}
			const expectedState = oauthContext.getLastOAuthState();
			if (!expectedState) {
				throw new Error(
					`MCP server "${serverName}" did not start an OAuth stateful authorization flow.`,
				);
			}
			if (callback.state !== expectedState) {
				throw new Error("OAuth authorization failed: state mismatch.");
			}

			await transport.finishAuth(callback.code);
			retryClient = buildClient(options);
			const retryTransport = createMcpSdkTransport({
				registration,
				oauthProvider: oauthContext.provider,
				fetch: options.fetch,
			});
			await retryClient.connect(retryTransport, {
				timeout: requestTimeoutMs,
				signal: options.signal,
			});

View on GitHub (pinned to 491b30b806)

When it happens

Trigger: Thrown at sdk/packages/core/src/extensions/mcp/oauth.ts:614 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cline/cline@491b30b806 (2026-08-25). Data as JSON: /api/errors/967986b2545463e6. Report an issue: GitHub.