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
|`StreamableHTTPError`| REMOVED (use `SdkError` with `SdkErrorCode.ClientHttp*`)|
98
+
|`StreamableHTTPError`| REMOVED (use `SdkHttpError` with `SdkErrorCode.ClientHttp*`) |
99
99
|`WebSocketClientTransport`| REMOVED (use `StreamableHTTPClientTransport` or `StdioClientTransport`) |
100
100
101
101
All other **type** symbols from `@modelcontextprotocol/sdk/types.js` retain their original names. **Zod schemas** (e.g., `CallToolResultSchema`, `ListToolsResultSchema`) are no longer part of the public API — they are internal to the SDK. For runtime validation, use
102
102
`isSpecType.TypeName(value)` (e.g., `isSpecType.CallToolResult(v)`) or `specTypeSchemas.TypeName` for the `StandardSchemaV1Sync` validator object. The keys are typed as `SpecTypeName`, a literal union of all spec type names.
103
103
104
104
### Error class changes
105
105
106
-
Two error classes now exist:
106
+
Three error classes now exist:
107
107
108
108
-**`ProtocolError`** (renamed from `McpError`): Protocol errors that cross the wire as JSON-RPC responses
109
109
-**`SdkError`** (new): Local SDK errors that never cross the wire
110
+
-**`SdkHttpError`** (extends `SdkError`): HTTP transport errors with typed `.status` and `.statusText` accessors
Copy file name to clipboardExpand all lines: docs/migration.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -652,10 +652,11 @@ These replace the pattern of calling `server.sendLoggingMessage()`, `server.crea
652
652
653
653
### Error hierarchy refactoring
654
654
655
-
The SDK now distinguishes between two types of errors:
655
+
The SDK now distinguishes between three types of errors:
656
656
657
657
1.**`ProtocolError`** (renamed from `McpError`): Protocol errors that cross the wire as JSON-RPC error responses
658
658
2.**`SdkError`**: Local SDK errors that never cross the wire (timeouts, connection issues, capability checks)
659
+
3.**`SdkHttpError`** (extends `SdkError`): HTTP transport errors with typed `.status` and `.statusText` accessors
659
660
660
661
#### Renamed exports
661
662
@@ -725,7 +726,7 @@ The new `SdkErrorCode` enum contains string-valued codes for local SDK errors:
725
726
726
727
#### `StreamableHTTPError` removed
727
728
728
-
The `StreamableHTTPError` class has been removed. HTTP transport errors are now thrown as `SdkError` with specific `SdkErrorCode` values that provide more granular error information:
729
+
The `StreamableHTTPError` class has been removed. HTTP transport errors are now thrown as `SdkHttpError` (a subclass of `SdkError` with typed `.status` and `.statusText` accessors) with specific `SdkErrorCode` values that provide more granular error information:
0 commit comments