core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage (#5972)#6093
Conversation
…mable HTTP transport usage (#5972) The current experimental MCP client already supports the new HTTP transport through the custom transport option (over passing in a config). Updates documentation to illustrate usage of the new Streamable HTTP Transport with `experimental_createMCPClient` for tool conversion. As of now, `experimental_createMCPClient` is only used in the AI SDK as a way to fetch and call MCP server tools; for this reason, we are **not** adding support for Session Management or Resumable Streams - which are new features supported by the new HTTP transport. Examples have been updated to illustrate basic usage, and a new Next.js example has been added to illustrate setting up a **stateless** MCP **server** to be used with `useChat` and `streamText`. <!-- This task list is intended to help you keep track of what you need to do. Feel free to add tasks and remove unnecessary tasks as needed. Please check if the PR fulfills the following requirements: --> - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [ ] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) Given the deprecation of the SSE transport, we should likely deprecate on our end as well. We should consider fully deprecating native support for transports (e.g. our custom `stdio` transport), and enforcing users to always pass in a custom transport to limit need for maintenance on our end. Fixes #5984
lgrammel
approved these changes
May 2, 2025
samdenty
added a commit
that referenced
this pull request
May 2, 2025
* origin/v5: fix(providers/openai): logprobs for stream alongside completion model (#6091) chore (ai): move maxSteps into UseChatOptions (#6113) docs (ai): add notes on schema .optional() (#6111) chore: update references to use ai-sdk.dev (#6076) (#6107) Version Packages (canary) (#6069) chore (provider-utils): rename TestServerCall.requestBody to requestBodyJson (#6106) chore (ai): rename CoreMessage to ModelMessage (#6105) feat (ai): add filename to file ui parts (#6104) feat (docs): add Dify community provider (#4084) (#6067) (#6103) feat (docs): add Sarvam community provider (#6079) (#6096) fix(providers/openai): zod parse error with function (#6074) (#6095) feat(docs): add Weave observability provider (#6029) (#6094) core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage (#5972) (#6093) fix (docs): update formatting in useChat reference docs (#6100) chore (ai): replace useChat attachments with file ui parts (#6071) feat (ui/react): support resuming an ongoing stream (#6053) test (openai): update snapshot (#6086)
samdenty
added a commit
that referenced
this pull request
May 2, 2025
…call * origin/v5: (43 commits) chore (provider-utils): return IdGenerator interface (#6118) chore (provider): improve jsdoc comments (#6117) chore (ai): remove outdated typecasts (#6116) chore (ai): remove useChat keepLastMessageOnError (#6114) fix(providers/openai): logprobs for stream alongside completion model (#6091) chore (ai): move maxSteps into UseChatOptions (#6113) docs (ai): add notes on schema .optional() (#6111) chore: update references to use ai-sdk.dev (#6076) (#6107) Version Packages (canary) (#6069) chore (provider-utils): rename TestServerCall.requestBody to requestBodyJson (#6106) chore (ai): rename CoreMessage to ModelMessage (#6105) feat (ai): add filename to file ui parts (#6104) feat (docs): add Dify community provider (#4084) (#6067) (#6103) feat (docs): add Sarvam community provider (#6079) (#6096) fix(providers/openai): zod parse error with function (#6074) (#6095) feat(docs): add Weave observability provider (#6029) (#6094) core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage (#5972) (#6093) fix (docs): update formatting in useChat reference docs (#6100) chore (ai): replace useChat attachments with file ui parts (#6071) feat (ui/react): support resuming an ongoing stream (#6053) ...
iteratetograceness
added a commit
to iteratetograceness/ai
that referenced
this pull request
May 9, 2025
…mable HTTP transport usage (vercel#5972) (vercel#6093) The current experimental MCP client already supports the new HTTP transport through the custom transport option (over passing in a config). Updates documentation to illustrate usage of the new Streamable HTTP Transport with `experimental_createMCPClient` for tool conversion. As of now, `experimental_createMCPClient` is only used in the AI SDK as a way to fetch and call MCP server tools; for this reason, we are **not** adding support for Session Management or Resumable Streams - which are new features supported by the new HTTP transport. Examples have been updated to illustrate basic usage, and a new Next.js example has been added to illustrate setting up a **stateless** MCP **server** to be used with `useChat` and `streamText`. Given the deprecation of the SSE transport, we should likely deprecate on our end as well. We should consider fully deprecating native support for transports (e.g. our custom `stdio` transport), and enforcing users to always pass in a custom transport to limit need for maintenance on our end. Fixes vercel#5984 --------- Co-authored-by: Grace Yun <74513600+iteratetograceness@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current experimental MCP client already supports the new HTTP transport through the custom transport option (over passing in a config).
Updates documentation to illustrate usage of the new Streamable HTTP Transport with
experimental_createMCPClientfor tool conversion.As of now,
experimental_createMCPClientis only used in the AI SDK as a way to fetch and call MCP server tools; for this reason, we are not adding support for Session Management or Resumable Streams - which are new features supported by the new HTTP transport.Examples have been updated to illustrate basic usage, and a new Next.js example has been added to illustrate setting up a stateless MCP server to be used with
useChatandstreamText.pnpm changesetin the project root)pnpm prettier-fixin the project root)Given the deprecation of the SSE transport, we should likely deprecate on our end as well. We should consider fully deprecating native support for transports (e.g. our custom
stdiotransport), and enforcing users to always pass in a custom transport to limit need for maintenance on our end.Fixes #5984
Background
Summary
Verification
Tasks
pnpm changesetin the project root)pnpm prettier-fixin the project root)Future Work
Related Issues