-
Notifications
You must be signed in to change notification settings - Fork 2.3k
core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage #5972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
iteratetograceness
merged 24 commits into
vercel:main
from
iteratetograceness:http-transport
Apr 30, 2025
Merged
core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage #5972
iteratetograceness
merged 24 commits into
vercel:main
from
iteratetograceness:http-transport
Apr 30, 2025
Conversation
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
lgrammel
reviewed
Apr 25, 2025
lgrammel
reviewed
Apr 25, 2025
lgrammel
reviewed
Apr 25, 2025
content/docs/07-reference/01-ai-sdk-core/21-create-mcp-client.mdx
Outdated
Show resolved
Hide resolved
lgrammel
reviewed
Apr 25, 2025
lgrammel
reviewed
Apr 25, 2025
lgrammel
reviewed
Apr 25, 2025
lgrammel
reviewed
Apr 25, 2025
lgrammel
reviewed
Apr 25, 2025
MCPClient
to support HTTP transport resumabilityMCPClient
to support HTTP transport resumability and strictMode
configuration
lgrammel
reviewed
Apr 26, 2025
lgrammel
reviewed
Apr 26, 2025
lgrammel
reviewed
Apr 26, 2025
lgrammel
reviewed
Apr 26, 2025
sessionId
and strictMode
configuration to experimental MCP clientassertCapability
method to experimental MCP client and documentation for Streamable HTTP transport usage
does the
or
|
No, the experimental client accepts either a custom transport or a MCPTransportConfig (which is what you're pointing to) |
lgrammel
approved these changes
Apr 29, 2025
lgrammel
reviewed
Apr 29, 2025
Also consider splitting into 2 PRs? 1 for docs changes and one for |
4 tasks
assertCapability
method to experimental MCP client and documentation for Streamable HTTP transport usage
iteratetograceness
added a commit
that referenced
this pull request
Apr 29, 2025
…ent (#6047) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background Splits up #5972 into package changes and updates to examples. ## Summary Moves capabilities validation downstream to the request level instead of the method level. This PR adds a new private `assertCapability` method called at the request level. This means our custom, lightweight client defaults strict mode to true for tool listing and tool calling. ## Verification <!-- For features & bugfixes. Please explain how you *manually* verified that the change works end-to-end as expected (independent of automated tests). Remove the section if it's not needed (e.g. for docs). --> ## Tasks <!-- 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) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] 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) ## Future Work <!-- Feel free to mention things not covered by this PR that can be done in future PRs. Remove the section if it's not needed. --> ## Related Issues <!-- List related issues here, e.g. "Fixes #1234". Remove the section if it's not needed. -->
lgrammel
pushed a commit
that referenced
this pull request
Apr 30, 2025
…ent (#6047) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background Splits up #5972 into package changes and updates to examples. ## Summary Moves capabilities validation downstream to the request level instead of the method level. This PR adds a new private `assertCapability` method called at the request level. This means our custom, lightweight client defaults strict mode to true for tool listing and tool calling. ## Verification <!-- For features & bugfixes. Please explain how you *manually* verified that the change works end-to-end as expected (independent of automated tests). Remove the section if it's not needed (e.g. for docs). --> ## Tasks <!-- 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) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] 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) ## Future Work <!-- Feel free to mention things not covered by this PR that can be done in future PRs. Remove the section if it's not needed. --> ## Related Issues <!-- List related issues here, e.g. "Fixes #1234". Remove the section if it's not needed. -->
lgrammel
added a commit
that referenced
this pull request
Apr 30, 2025
…ent (#6047) (#6058) ## Background Splits up #5972 into package changes and updates to examples. ## Summary Moves capabilities validation downstream to the request level instead of the method level. This PR adds a new private `assertCapability` method called at the request level. This means our custom, lightweight client defaults strict mode to true for tool listing and tool calling. Co-authored-by: Grace Yun <[email protected]>
samdenty
pushed a commit
that referenced
this pull request
May 1, 2025
…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
pushed a commit
that referenced
this pull request
May 2, 2025
…mable HTTP transport usage (#5972) (#6093) ## Background The current experimental MCP client already supports the new HTTP transport through the custom transport option (over passing in a config). ## Summary 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`. ## Future Work 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 --------- Co-authored-by: Grace Yun <[email protected]>
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
…ent (vercel#6047) (vercel#6058) ## Background Splits up vercel#5972 into package changes and updates to examples. ## Summary Moves capabilities validation downstream to the request level instead of the method level. This PR adds a new private `assertCapability` method called at the request level. This means our custom, lightweight client defaults strict mode to true for tool listing and tool calling. Co-authored-by: Grace Yun <[email protected]>
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 <[email protected]>
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.
Background
The current experimental MCP client already supports the new HTTP transport through the custom transport option (over passing in a config).
Summary
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
andstreamText
.Tasks
pnpm changeset
in the project root)pnpm prettier-fix
in the project root)Future Work
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.Related Issues
Fixes #5984