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
{{ message }}
Repository navigation
Commit 8dbbfbd
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/client.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -439,7 +439,7 @@ The result's `action` is `.accept`, `.decline` or `.cancel`. Only a form `.accep
439
439
440
440
### URL elicitation required
441
441
442
-
A server can refuse a request until the user completes URL elicitations. It answers with `urlElicitationRequired` (-32042), whose `data.elicitations` lists `URLElicitationInfo` values (`elicitationId`, `url`, `message`). The SDK neither opens the URLs nor retries.
442
+
On 2025-11-25 connections, a server can refuse a request until the user completes URL elicitations. It answers with `urlElicitationRequired` (-32042), whose `data.elicitations` lists `URLElicitationInfo` values (`elicitationId`, `url`, `message`). If the received data contains malformed elicitations or other fields, it decodes as `serverError` so the data remains available. The SDK neither opens the URLs nor retries.
|`headerMismatch`| -32020 |`Mcp-*` headers do not match the body. See [Header parameters](#header-parameters). |
995
995
|`missingRequiredClientCapabilities`| -32021 | The request needs capabilities the client did not declare (`data.requiredCapabilities`). |
996
996
|`unsupportedProtocolVersion(supported:requested:)`| -32022 | The server does not serve the requested version (`data.supported`). |
997
-
|`urlElicitationRequired(message:elicitations:)`| -32042 | Complete the listed URL elicitations, then retry. |
998
-
|`serverError(code:message:data:)`|other|Any other code, including -32000 and -32001 received from a server. |
997
+
|`urlElicitationRequired(message:elicitations:)`| -32042 | Complete the listed URL elicitations, then retry (2025-11-25 only). |
998
+
|`serverError(code:message:data:)`|any|Unknown codes, -32000 and -32001 received from a server, or a known code whose data cannot fit its typed case. |
999
999
|`connectionClosed`, `transportError`| -32000, -32001 | Local transport failures; never decoded from the wire. |
1000
1000
1001
1001
See [troubleshooting.md](troubleshooting.md) for causes and fixes.
Copy file name to clipboardExpand all lines: docs/migration.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ each change that breaks source code.
19
19
|---|---|---|
20
20
|`MCPError`| New cases; `serverError` has a third associated value | Update exhaustive `switch` statements and `serverError` patterns |
21
21
|`MCPError` decoding | -32000 and -32001 decode as `serverError`; -32602 with `data.uri` as `resourceNotFound`; without `data.detail`, the standard cases drop their own message text | Match the new cases |
22
+
| -32042 error decoding | If the data cannot be represented entirely by `urlElicitationRequired`, decodes as `serverError` and keeps `data`| Handle `serverError(code:message:data:)` for malformed or extended URL elicitation errors |
22
23
|`HTTPResponse`|`.data` and `.error` have new associated values | Update patterns |
23
24
|`Client.Capabilities.experimental`|`[String: String]?` became `[String: Value]?`| Pass `Value`s |
24
25
|`OAuthAuthorizationError`| A struct with a `code`, not an enum; eight new codes | Read details from properties instead of binding associated values |
@@ -60,7 +61,7 @@ each change that breaks source code.
60
61
61
62
| Case | Code |`data`|
62
63
|---|---|---|
63
-
|`serverError(code:message:data:)`| any other code | as sent |
64
+
|`serverError(code:message:data:)`| any code | as sent |
Copy file name to clipboardExpand all lines: docs/protocol.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1098,8 +1098,8 @@ Every JSON-RPC error the SDK sends or receives is an `MCPError`. `code` is the J
1098
1098
|`headerMismatch(_:)`| -32020 |`{"detail"}`|`Mcp-Method`, `Mcp-Name`, `Mcp-Param-*` or `MCP-Protocol-Version` missing or different from the body. |
1099
1099
|`missingRequiredClientCapabilities(_:message:)`| -32021 |`{"requiredCapabilities"}`| An input-required result needs a client capability the request did not declare; a tool that requires tasks, a task method or a listen stream naming tasks from a client without the tasks extension. |
1100
1100
|`unsupportedProtocolVersion(supported:requested:)`| -32022 |`{"supported", "requested"}`| Version not served; stateless request to the stateful transport. |
1101
-
|`urlElicitationRequired(message:elicitations:)`| -32042 |`{"elicitations"}`| The user must complete URL elicitations first. |
1102
-
|`serverError(code:message:data:)`| any other| as sent | Implementation-defined codes; -32000 and -32001 from a peer. |
1101
+
|`urlElicitationRequired(message:elicitations:)`| -32042 |`{"elicitations"}`| The user must complete URL elicitations first (2025-11-25 only). |
1102
+
|`serverError(code:message:data:)`| any code| as sent | Implementation-defined codes, -32000 and -32001 from a peer, or a known code whose data cannot fit its typed case. |
1103
1103
|`connectionClosed`| -32000 | none | Local only: the transport closed. |
1104
1104
|`transportError(_:)`| -32001 |`{"error"}`| Local only: an I/O error. |
Copy file name to clipboardExpand all lines: docs/src/client.src.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,7 +238,7 @@ The result's `action` is `.accept`, `.decline` or `.cancel`. Only a form `.accep
238
238
239
239
### URL elicitation required
240
240
241
-
A server can refuse a request until the user completes URL elicitations. It answers with `urlElicitationRequired` (-32042), whose `data.elicitations` lists `URLElicitationInfo` values (`elicitationId`, `url`, `message`). The SDK neither opens the URLs nor retries.
241
+
On 2025-11-25 connections, a server can refuse a request until the user completes URL elicitations. It answers with `urlElicitationRequired` (-32042), whose `data.elicitations` lists `URLElicitationInfo` values (`elicitationId`, `url`, `message`). If the received data contains malformed elicitations or other fields, it decodes as `serverError` so the data remains available. The SDK neither opens the URLs nor retries.
@@ -523,8 +523,8 @@ If a peer result does not decode as the expected type, catch `ResponseDecodingEr
523
523
|`headerMismatch`| -32020 |`Mcp-*` headers do not match the body. See [Header parameters](#header-parameters). |
524
524
|`missingRequiredClientCapabilities`| -32021 | The request needs capabilities the client did not declare (`data.requiredCapabilities`). |
525
525
|`unsupportedProtocolVersion(supported:requested:)`| -32022 | The server does not serve the requested version (`data.supported`). |
526
-
|`urlElicitationRequired(message:elicitations:)`| -32042 | Complete the listed URL elicitations, then retry. |
527
-
|`serverError(code:message:data:)`|other|Any other code, including -32000 and -32001 received from a server. |
526
+
|`urlElicitationRequired(message:elicitations:)`| -32042 | Complete the listed URL elicitations, then retry (2025-11-25 only). |
527
+
|`serverError(code:message:data:)`|any|Unknown codes, -32000 and -32001 received from a server, or a known code whose data cannot fit its typed case. |
528
528
|`connectionClosed`, `transportError`| -32000, -32001 | Local transport failures; never decoded from the wire. |
529
529
530
530
See [troubleshooting.md](troubleshooting.md) for causes and fixes.
Copy file name to clipboardExpand all lines: docs/src/migration.src.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ each change that breaks source code.
17
17
|---|---|---|
18
18
|`MCPError`| New cases; `serverError` has a third associated value | Update exhaustive `switch` statements and `serverError` patterns |
19
19
|`MCPError` decoding | -32000 and -32001 decode as `serverError`; -32602 with `data.uri` as `resourceNotFound`; without `data.detail`, the standard cases drop their own message text | Match the new cases |
20
+
| -32042 error decoding | If the data cannot be represented entirely by `urlElicitationRequired`, decodes as `serverError` and keeps `data`| Handle `serverError(code:message:data:)` for malformed or extended URL elicitation errors |
20
21
|`HTTPResponse`|`.data` and `.error` have new associated values | Update patterns |
21
22
|`Client.Capabilities.experimental`|`[String: String]?` became `[String: Value]?`| Pass `Value`s |
22
23
|`OAuthAuthorizationError`| A struct with a `code`, not an enum; eight new codes | Read details from properties instead of binding associated values |
@@ -58,7 +59,7 @@ each change that breaks source code.
58
59
59
60
| Case | Code |`data`|
60
61
|---|---|---|
61
-
|`serverError(code:message:data:)`| any other code | as sent |
62
+
|`serverError(code:message:data:)`| any code | as sent |
0 commit comments