-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: allow the client version to be set from the user in the experimental_createMCPClient #10398
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
feat: allow the client version to be set from the user in the experimental_createMCPClient #10398
Conversation
.changeset/tender-cups-shout.md
Outdated
| '@ai-sdk/mcp': patch | ||
| --- | ||
|
|
||
| Add the possibility to define client version in mcp client definition |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
aayush-kapoor
left a comment
There was a problem hiding this 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
…ibility-to-set-client-version
…ibility-to-set-client-version
|
@qchuchu can you also look into the failing CI tests? thanks |
…ibility-to-set-client-version
…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]>
|
✅ Backport PR created: #10562 |
…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]>
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:
Manual Verification
Created an MCP client with a custom version and verified that:
Checklist
pnpm changesetin the project root)