Skip to content

Conversation

@qchuchu
Copy link
Contributor

@qchuchu qchuchu commented Nov 20, 2025

Background

The MCP client was using a hardcoded client version ('1.0.0') that couldn't be customized by users. This prevented users from setting their own client version when creating an MCP client instance, which may be needed for version tracking, compatibility requirements, or integration with specific MCP servers.

Summary

Added an optional version parameter to MCPClientConfig interface that allows users to set a custom client version when creating an MCP client. The parameter defaults to '1.0.0' (the existing CLIENT_VERSION constant) to maintain backward compatibility. Changes:

  • Added optional version property to MCPClientConfig interface with JSDoc documentation
  • Updated DefaultMCPClient constructor to accept version parameter with default value
  • Modified clientInfo assignment to use the provided version instead of hardcoded CLIENT_VERSION

Manual Verification

Created an MCP client with a custom version and verified that:

  1. The client initializes successfully with the custom version
  2. The client version is correctly set in the clientInfo object
  3. Existing code without the version parameter continues to work with the default '1.0.0' version

Checklist

  • 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)
  • I have reviewed this pull request (self-review)

@vercel-ai-sdk vercel-ai-sdk bot added the ai/mcp label Nov 20, 2025
'@ai-sdk/mcp': patch
---

Add the possibility to define client version in mcp client definition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the majority of the change set files follow conventional commits semantics, although I’m not sure if there are any specific rules behind it. Cant find anything about it in the CONTRIBUTING.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback - updated the file then :)

@gr2m gr2m added the feature New feature or request label Nov 24, 2025
Copy link
Contributor

@aayush-kapoor aayush-kapoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good but just edit the changeset file

@aayush-kapoor
Copy link
Contributor

@qchuchu can you also look into the failing CI tests? thanks

@aayush-kapoor aayush-kapoor merged commit ba2ca2d into vercel:main Nov 24, 2025
21 checks passed
vercel-ai-sdk bot pushed a commit that referenced this pull request Nov 24, 2025
…ental_createMCPClient (#10398)

## Background

The MCP client was using a hardcoded client version ('1.0.0') that
couldn't be customized by users. This prevented users from setting their
own client version when creating an MCP client instance, which may be
needed for version tracking, compatibility requirements, or integration
with specific MCP servers.

## Summary

Added an optional version parameter to MCPClientConfig interface that
allows users to set a custom client version when creating an MCP client.
The parameter defaults to '1.0.0' (the existing CLIENT_VERSION constant)
to maintain backward compatibility. **Changes**:

- Added optional version property to MCPClientConfig interface with
JSDoc documentation
- Updated DefaultMCPClient constructor to accept version parameter with
default value
- Modified clientInfo assignment to use the provided version instead of
hardcoded CLIENT_VERSION

## Manual Verification

Created an MCP client with a custom version and verified that:
1. The client initializes successfully with the custom version
2. The client version is correctly set in the clientInfo object
3. Existing code without the version parameter continues to work with
the default '1.0.0' version

## Checklist

<!--
Do not edit this list. Leave items unchecked that don't apply. If you
need to track subtasks, create a new "## Tasks" section

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] I have reviewed this pull request (self-review)

---------

Co-authored-by: josh <[email protected]>
Co-authored-by: Aayush Kapoor <[email protected]>
@vercel-ai-sdk vercel-ai-sdk bot removed the backport label Nov 24, 2025
@vercel-ai-sdk
Copy link
Contributor

vercel-ai-sdk bot commented Nov 24, 2025

✅ Backport PR created: #10562

vercel-ai-sdk bot added a commit that referenced this pull request Nov 24, 2025
…he experimental_createMCPClient (#10562)

This is an automated backport of #10398 to the release-v5.0 branch. FYI
@qchuchu

Co-authored-by: Quentin Churet <[email protected]>
Co-authored-by: josh <[email protected]>
Co-authored-by: Aayush Kapoor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/mcp feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants