Skip to content
Source
Sign inSign up
TanStack/ai

feat(ai-mcp): add attachResources, prompts, maxTools, and OAuth redirect helpers #2241

OpenJeffSouop(GitHub profile, opens in a new tab)wants to merge 10 commits intomain fromrefs/pull/2241/headopened View on GitHub

Showing 32 changed files with 69 additions and 4 deletions (loading 29).

x
0 of 32 viewed, 32 left
6 additions and 0 deletions.changeset/mcp-host-completeness.mdAdded
View file
@@ -0,0 +1,6 @@
+---
+'@tanstack/ai': minor
+'@tanstack/ai-mcp': minor
+---
+​
+MCP host completeness: multimodal resource blobs, `attachResources` / `prompts` / `maxTools` on `chat({ mcp })`, OAuth redirect helpers, and UI recipes for MCP interrupts.
63 additions and 4 deletionsdocs/tools/mcp-advanced.mdModified
View file
@@ -66,11 +66,70 @@
​
For a provider with stored tokens and a working refresh, this form is all you need.
​
-An interactive redirect flow needs one more step. After the redirect, you must call `finishAuth(code)` on the transport. `createMCPClient` makes the transport internally, so you cannot reach it. Make the transport yourself instead:
+### OAuth redirect helper
​
-1. Make a `StreamableHTTPClientTransport` with your `authProvider`, and keep a reference to it.
-2. In your OAuth callback route, call `transport.finishAuth(code)`.
-3. Pass the transport to `createMCPClient({ transport })`. See [Custom transport](#custom-transport).
+For a browser redirect (authorization code), use `createMCPClientWithOAuthRedirect` and `finishMCPOAuthRedirect`:
+​
+```ts
+import {
+ createMCPClientWithOAuthRedirect,
+ finishMCPOAuthRedirect,
+ createUserMcpTokenStore,
+} from '@tanstack/ai-mcp'
+​
+const tokenStore = createUserMcpTokenStore({
+ userId: 'user-1',