Using vercel-mcp-adapter I've got a functional MCP server up and running as an api route under my next.js app at /api/mcp . Now I want to add a chat page in my next.js app at /app/chat that has access to the tools at /api/mcp.
However I have two problems:
- The MCP server uses
HTTPStreamableas the transport (default OOTB behaviour forvercel-mcp-adapter), but I don't see any way to make a client useHTTPStreamableas the transport - the only supported option appears to besse. - I have some chunky tool definitions in
/api/mcp/route.tsthat define available tools and argument schemas. I don't see any obvious way of adapting these to thetoolsarg that egstreamTextexposes:
const result = streamText({ model: lmstudio('google/gemma-3-27b'), messages: convertToModelMessages(messages), maxRetries: 1, tools: ???, /* how can I re-use my tool defs from /api/mcp/route.ts? */ stopWhen: stepCountIs(5),});Am I missing something obvious? Why does the MCP adapter use a totally different transport mechanism to the full-size AI SDK's MCP client?