Skip to content

feat(mcp): add per-call auth headers and docs#124

Open
sergical wants to merge 2 commits intovercel:mainfrom
sergical:feat/mcp-client-support
Open

feat(mcp): add per-call auth headers and docs#124
sergical wants to merge 2 commits intovercel:mainfrom
sergical:feat/mcp-client-support

Conversation

@sergical
Copy link

@sergical sergical commented Feb 26, 2026

Summary

  • Per-call auth headers: callTool() now accepts an optional options.headers parameter 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 feature docs: New mcp.mdx guide covering configuration, tool listing/calling, transport types, three auth patterns (service-level, per-tenant, per-user), multiple servers, and error codes.
  • API reference updates: Added mcpServers to the Chat constructor table and a mcp property section.

Test plan

  • 19/19 MCP tests pass (pnpm --filter chat test src/mcp.test.ts)
  • 466/466 total tests pass
  • TypeScript type-check passes
  • Lint/format passes
  • Preview docs locally (pnpm --filter docs dev/docs/mcp)

Prompts

🤖 Generated with Claude Code

sergical and others added 2 commits February 26, 2026 12:37
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>
@vercel
Copy link
Contributor

vercel bot commented Feb 26, 2026

@sergical is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​modelcontextprotocol/​sdk@​1.27.19910010099100

View full report

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.

1 participant