Re-use vercel-mcp-adapter tool definition in frontend chat component?

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:

  1. The MCP server uses HTTPStreamable as the transport (default OOTB behaviour for vercel-mcp-adapter), but I don’t see any way to make a client use HTTPStreamable as the transport - the only supported option appears to be sse.
  2. I have some chunky tool definitions in /api/mcp/route.ts that define available tools and argument schemas. I don’t see any obvious way of adapting these to the tools arg that eg streamText exposes:
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?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.