From a5d582aaffce1a7457e3da0835a046ba6738c442 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Thu, 8 Oct 2026 15:21:14 +0100 Subject: [PATCH] fix(mcp): keep McpOptions assignable to OAuthOptions under exactOptionalPropertyTypes (#11635) --- .changeset/mcp-options-exact-optional-property-types.md | 5 +++++ packages/mcp/src/plugin.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/mcp-options-exact-optional-property-types.md diff --git a/.changeset/mcp-options-exact-optional-property-types.md b/.changeset/mcp-options-exact-optional-property-types.md new file mode 100644 index 0000000000..060144e2ae --- /dev/null +++ b/.changeset/mcp-options-exact-optional-property-types.md @@ -0,0 +1,5 @@ +--- +"@better-auth/mcp": patch +--- + +Projects that enable `exactOptionalPropertyTypes` with `skipLibCheck: false` no longer get a TS2430 error from the `@better-auth/mcp` type declarations. diff --git a/packages/mcp/src/plugin.ts b/packages/mcp/src/plugin.ts index 313d9c1988..4b63499dc3 100644 --- a/packages/mcp/src/plugin.ts +++ b/packages/mcp/src/plugin.ts @@ -41,9 +41,9 @@ export interface McpOptions extends OAuthOptions { * * @default 30 */ - refreshTokenReuseInterval?: OAuthOptions< - Scope[] - >["refreshTokenReuseInterval"]; + refreshTokenReuseInterval?: NonNullable< + OAuthOptions["refreshTokenReuseInterval"] + >; /** * The canonical protected resource identifier (RFC 8707 / RFC 9728) for this * MCP server. Issued tokens are audience-bound to it, and it is published as