You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix escaped negation in transient-check examples and table formatting
The KNOWN_OAUTH_ERROR_CODES examples carried a stray backslash before
the negation operator, making the snippets invalid TypeScript when
copied. The client-side context note sat mid-table between the task
rows with a non-symbol left cell; it now reads as prose after the
mapping table, matching how migration.md presents it.
if (errorinstanceofOAuthError&&error.code===OAuthErrorCode.InvalidClient) { ... }
219
219
```
220
220
221
-
The code property is `error.code` (`OAuthErrorCode | string`). Behavioral trap: v1 collapsed unrecognized response error codes into `ServerError`; v2 preserves the raw code. When rewriting `instanceof ServerError` retry/transient checks, treat unknown codes as transient to preserve v1 behavior: `\!new Set<string>(Object.values(OAuthErrorCode)).has(error.code)`.
221
+
The code property is `error.code` (`OAuthErrorCode | string`). Behavioral trap: v1 collapsed unrecognized response error codes into `ServerError`; v2 preserves the raw code. When rewriting `instanceof ServerError` retry/transient checks, treat unknown codes as transient to preserve v1 behavior: `!new Set<string>(Object.values(OAuthErrorCode)).has(error.code)`.
222
222
223
223
**Unchanged APIs** (only import paths changed): `Client` constructor and most methods, `McpServer` constructor, `server.connect()`, `server.close()`, all client transports (`StreamableHTTPClientTransport`, `SSEClientTransport`, `StdioClientTransport`), `StdioServerTransport`, all
224
224
Zod schemas, all callback return types. Note: `callTool()` and `request()` signatures changed (schema parameter removed, see section 11).
The same restructure applies client-side: `ClientContext` = `BaseContext`, so client-side handlers (elicitation, sampling, roots) receive the same `ctx` shape, and client handler mocks must provide `{ mcpReq: { signal, id, ... } }` rather than the v1 flat `extra` object.
459
+
459
460
`ServerContext` convenience methods (new in v2, no v1 equivalent):
0 commit comments