feat(mcp): add per-call auth headers and docs#124
Open
sergical wants to merge 2 commits intovercel:mainfrom
Open
feat(mcp): add per-call auth headers and docs#124sergical wants to merge 2 commits intovercel:mainfrom
sergical wants to merge 2 commits intovercel:mainfrom
Conversation
Add `mcpServers` to ChatConfig and expose `chat.mcp` with `listTools()`, `callTool()`, and `refresh()` methods. Supports SSE and Streamable HTTP transports with static or dynamic auth headers. Uses dynamic imports so users who don't configure MCP pay zero cost. Failed server connections log warnings and don't block initialization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add McpCallToolOptions with per-call headers override for per-user/per-tenant auth scenarios. When headers are provided, a temporary client+transport is created for the duration of the call. Also adds MCP feature docs and API reference updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
@sergical is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
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.
Summary
callTool()now accepts an optionaloptions.headersparameter for per-user/per-tenant authentication. When provided, a temporary MCP client+transport is created with the override headers for the duration of the call.mcp.mdxguide covering configuration, tool listing/calling, transport types, three auth patterns (service-level, per-tenant, per-user), multiple servers, and error codes.mcpServersto theChatconstructor table and amcpproperty section.Test plan
pnpm --filter chat test src/mcp.test.ts)pnpm --filter docs dev→/docs/mcp)Prompts
🤖 Generated with Claude Code