Skip to content

feat(mcp): propagate the server name through dynamic tool parts#14813

Merged
aayush-kapoor merged 10 commits intomainfrom
aayush/mcp-server-name
Apr 30, 2026
Merged

feat(mcp): propagate the server name through dynamic tool parts#14813
aayush-kapoor merged 10 commits intomainfrom
aayush/mcp-server-name

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor commented Apr 29, 2026

Background

#14387

some users had the request of propagating the MCP server name, from which the tool originated, in the UI

Summary

expose providerMetadata on dynamic tools and then merge the providerMetadata that is returned from the model along with the static providerMetadata we define

Manual Verification

verified by running the example http://localhost:3000/chat/mcp

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • 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)

Related Issues

fixes #14387

@aayush-kapoor aayush-kapoor marked this pull request as draft April 29, 2026 15:26
@aayush-kapoor aayush-kapoor marked this pull request as ready for review April 30, 2026 19:36
Copy link
Copy Markdown
Contributor

@vercel vercel Bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

MCP server name (providerMetadata) is not propagated when users provide explicit schemas via the schemas option, only when schemas === 'automatic'.

Fix on Vercel

Comment thread examples/ai-e2e-next/app/chat/mcp/page.tsx Outdated
@aayush-kapoor aayush-kapoor added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 30, 2026
@aayush-kapoor aayush-kapoor merged commit 08d2129 into main Apr 30, 2026
22 checks passed
@aayush-kapoor aayush-kapoor deleted the aayush/mcp-server-name branch April 30, 2026 20:25
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.0-beta.115
@ai-sdk/alibaba 2.0.0-beta.37
@ai-sdk/amazon-bedrock 5.0.0-beta.46
@ai-sdk/angular 3.0.0-beta.115
@ai-sdk/anthropic 4.0.0-beta.42
@ai-sdk/assemblyai 3.0.0-beta.32
@ai-sdk/azure 4.0.0-beta.42
@ai-sdk/baseten 2.0.0-beta.35
@ai-sdk/black-forest-labs 2.0.0-beta.31
@ai-sdk/bytedance 2.0.0-beta.32
@ai-sdk/cerebras 3.0.0-beta.35
@ai-sdk/cohere 4.0.0-beta.32
@ai-sdk/deepgram 3.0.0-beta.31
@ai-sdk/deepinfra 3.0.0-beta.35
@ai-sdk/deepseek 3.0.0-beta.33
@ai-sdk/elevenlabs 3.0.0-beta.31
@ai-sdk/fal 3.0.0-beta.31
@ai-sdk/fireworks 3.0.0-beta.35
@ai-sdk/gateway 4.0.0-beta.66
@ai-sdk/gladia 3.0.0-beta.31
@ai-sdk/google 4.0.0-beta.49
@ai-sdk/google-vertex 5.0.0-beta.63
@ai-sdk/groq 4.0.0-beta.34
@ai-sdk/huggingface 2.0.0-beta.35
@ai-sdk/hume 3.0.0-beta.31
@ai-sdk/klingai 4.0.0-beta.32
@ai-sdk/langchain 3.0.0-beta.115
@ai-sdk/llamaindex 3.0.0-beta.115
@ai-sdk/lmnt 3.0.0-beta.31
@ai-sdk/luma 3.0.0-beta.31
@ai-sdk/mcp 2.0.0-beta.37
@ai-sdk/mistral 4.0.0-beta.33
@ai-sdk/moonshotai 3.0.0-beta.35
@ai-sdk/open-responses 2.0.0-beta.33
@ai-sdk/openai 4.0.0-beta.42
@ai-sdk/openai-compatible 3.0.0-beta.35
@ai-sdk/otel 1.0.0-beta.61
@ai-sdk/perplexity 4.0.0-beta.34
@ai-sdk/prodia 2.0.0-beta.34
@ai-sdk/provider-utils 5.0.0-beta.30
@ai-sdk/react 4.0.0-beta.115
@ai-sdk/replicate 3.0.0-beta.32
@ai-sdk/revai 3.0.0-beta.32
@ai-sdk/rsc 3.0.0-beta.116
@ai-sdk/svelte 5.0.0-beta.115
@ai-sdk/togetherai 3.0.0-beta.35
@ai-sdk/valibot 3.0.0-beta.30
@ai-sdk/vercel 3.0.0-beta.35
@ai-sdk/voyage 1.0.0-beta.4
@ai-sdk/vue 4.0.0-beta.115
@ai-sdk/workflow 1.0.0-beta.30
@ai-sdk/xai 4.0.0-beta.48

aayush-kapoor added a commit that referenced this pull request Apr 30, 2026
…arts (#14870)

## Background

backport of #14813

some users had the request of propagating the MCP server name, from
which the tool originated, in the UI

## Summary

expose providerMetadata on dynamic tools and then merge the
providerMetadata that is returned from the model along with the static
providerMetadata we define

## Manual Verification

verified by running the example `http://localhost:3000/chat/mcp`

## Checklist

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [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)

## Related Issues

fixes #14387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Admins only: add this label to a pull request in order to backport it to the prior version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose existing createMCPClient({ name }) value on client-side dynamic-tool parts in useChat

2 participants