Skip to content

Connect the MultitaskAI MCP server to Vercel AI SDK

The Vercel AI SDK can load tools from MCP servers. Create an MCP client for MultitaskAI with your API key and pass its tools to generateText or streamText.

Endpoint

Text
https://mcp.multitaskai.com

Steps

  1. Create an API key in your MultitaskAI account.
  2. Install the MCP package with npm install @ai-sdk/mcp.
  3. Create the client below, with your key in place of YOUR_API_KEY, and pass its tools to generateText or streamText.
  4. Run your code and check that the model calls MultitaskAI tools, then close the client.
TypeScript
import { createMCPClient } from '@ai-sdk/mcp';

const mcpClient = await createMCPClient({
  transport: {
    type: 'http',
    url: 'https://mcp.multitaskai.com',
    headers: { Authorization: 'Bearer YOUR_API_KEY' },
  },
});

try {
  const tools = await mcpClient.tools();
} finally {
  await mcpClient.close();
}

Authentication

Vercel AI SDK sends your MultitaskAI API key in the Authorization header. Create a key in your account and use it in place of YOUR_API_KEY. Keep the key out of files you share or commit.

Text
Authorization: Bearer YOUR_API_KEY

Good to know

  • createMCPClient is imported from @ai-sdk/mcp.
  • The tools object goes straight into the tools option of generateText or streamText.

Official documentation

The Vercel MCP documentation covers Vercel AI SDK's own settings in detail. See the overview for the endpoint and authentication, and pricing for the daily free requests.