@ai-sdk/mcp 2.0.103 Patch Release: MCPClientError Now Preserves HTTP Context

@ai-sdk/mcp 2.0.103 fixes MCPClientError losing HTTP status code, URL, and response body.
`@ai-sdk/mcp@2.0.103` is a patch version containing only one fix: when an HTTP request fails and the response body contains a JSON-RPC error message, `MCPClientError` would lose the original HTTP status code, request URL, and response body. After the fix, these three types of information are preserved on the error object, allowing developers to retrieve the complete call chain context directly from the exception without additional packet capture or log digging. The article notes that MCP clients face error sources from the network layer, HTTP layer, and JSON-RPC protocol layer simultaneously, and preserving transport layer context essentially pushes observability down into the SDK's error objects, significantly shortening fault localization time in production. The patch contains no breaking changes and has low upgrade cost, but users are advised to check old logic that relies on parsing error message strings for status codes and switch to structured fields.
Title
@ai-sdk/mcp 2.0.103 Patch Release: MCPClientError Now Preserves HTTP Context
The MCP client package in the AI SDK ecosystem has received a minor version update. @ai-sdk/mcp@2.0.103 was released as a patch version, focusing on fixing an easily overlooked issue that impacts troubleshooting efficiency: when an HTTP request fails and the response body also contains a JSON-RPC error message, MCPClientError would lose the original HTTP status code, request URL, and response body.

What the Patch Does
The changelog for this release is very focused, containing only one patch change: fix(mcp): keep the HTTP status, URL, and response body on MCPClientError when a failed HTTP response contains a JSON-RPC error body.
In other words, previously when an MCP call failed, if the server returned a JSON-RPC formatted error body, the MCPClientError thrown by the client might only retain the JSON-RPC layer error information, losing the HTTP layer context. For debuggers, this meant you could only see that "the protocol layer reported an error" without knowing which URL was involved, what status code was returned, or what the raw response looked like.
After the patch, all three types of information are preserved on the error object, so you can directly retrieve the complete chain information from the exception when troubleshooting.
Why This Small Fix Matters
MCP (Model Context Protocol) is becoming an important protocol layer for connecting AI applications with external tools and data sources. Clients built on @ai-sdk/mcp often face three overlapping layers of error sources: the network layer, the HTTP layer, and the JSON-RPC protocol layer.
When error information is "compressed" into a single protocol error, the path for developers to troubleshoot is lengthened: they need to capture packets, dig through logs, or reproduce requests to locate the issue. Preserving the HTTP status, URL, and response body essentially pushes observability down into the SDK's error objects, allowing the exception itself to carry sufficient context.
For teams running MCP integrations in production, although this type of change doesn't alter functional behavior, it directly affects the speed of fault localization.
JSON-RPC is a lightweight remote procedure call protocol that uses JSON as its data format, organizing messages through fields such as id, method, params (request) and result, error, id (response). Its error object typically contains code, message, and an optional data field to express protocol-level call failures. MCP (Model Context Protocol) uses JSON-RPC 2.0 on top of the transport layer to define message interactions between clients and servers.
This creates a typical error layering problem: a single MCP call may simultaneously produce HTTP layer errors (such as 4xx/5xx status codes) and JSON-RPC layer errors (such as method not found or invalid parameters). If the SDK discovers a JSON-RPC error when parsing the response body and only throws the protocol layer error, then transport layer information such as the HTTP status code and request URL will be overwritten or discarded. The core of this fix is to make MCPClientError carry error context from both layers simultaneously, avoiding the need for developers to guess back and forth between protocol errors and transport errors during troubleshooting.
Release Cadence and Upgrade Recommendations
From the release record, this is a standard patch version with commit messages automatically generated by GitHub Actions, indicating the project uses an automated release process. Patch-level changes typically don't involve breaking changes, so the upgrade cost is low.
If your project is using @ai-sdk/mcp and has unified error capture and reporting for MCP calls, it's recommended to check your error handling logic after upgrading: code that previously relied on parsing error message strings to extract status codes can now directly read the structured fields on MCPClientError, and the logic can be simplified accordingly.
SemVer (Semantic Versioning) specifies the version number format as MAJOR.MINOR.PATCH: a major version change indicates incompatible API modifications, a minor version change indicates backward-compatible feature additions, and a patch version change indicates backward-compatible bug fixes. @ai-sdk/mcp@2.0.103 is a patch-level release and theoretically contains no breaking changes, so the upgrade risk is low.
However, a patch version doesn't mean it's completely transparent to callers. If your project's error handling code relies on old behavior—for example, parsing the MCPClientError.message string to extract status codes, or assuming certain fields don't exist on the error object—then these logic paths may need adjustment after upgrading. It's recommended to focus on checking the unified error capture and reporting modules during the upgrade, confirming that the new structured fields (HTTP status code, URL, response body) are correctly read and recorded, avoiding duplicate parsing or field conflicts.
Summary
@ai-sdk/mcp@2.0.103 is not a feature update but a fix aimed at developer experience. It reminds us that in the tool-calling chain of AI applications, the error object itself is part of the interface—the more complete the context preserved, the easier it is for integrators to pinpoint problems at the correct layer.
For developers building MCP client or server integrations, this type of detail is worth paying attention to during upgrades and worth learning from in your own SDK design.
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.