Skip to content

core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage (#5972)#6093

Merged
lgrammel merged 2 commits intov5from
v5-5972
May 2, 2025
Merged

core (ai/mcp): update experimental MCP client documentation for Streamable HTTP transport usage (#5972)#6093
lgrammel merged 2 commits intov5from
v5-5972

Conversation

@samdenty
Copy link
Contributor

@samdenty samdenty commented May 1, 2025

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.

  • Tests have been added / updated (for bug fixes / features)
  • 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)
  • 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

Background

Summary

Verification

Tasks

  • Tests have been added / updated (for bug fixes / features)
  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Future Work

Related Issues

…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 lgrammel merged commit e574a12 into v5 May 2, 2025
8 checks passed
@lgrammel lgrammel deleted the v5-5972 branch May 2, 2025 06:23
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants