Skip to content

Connect the MultitaskAI MCP server to Mastra

Mastra builds agents in TypeScript. Add MultitaskAI as a server in an MCPClient with its URL and your API key, then give its tools to your agent.

Endpoint

Text
https://mcp.multitaskai.com

Steps

  1. Create an API key in your MultitaskAI account.
  2. Add the @mastra/mcp package to your Mastra project.
  3. Create the MCPClient below, with your key in place of YOUR_API_KEY.
  4. Pass await mcp.listTools() as your agent's tools and check that the multitaskai_ tools are listed.
TypeScript
import { MCPClient } from '@mastra/mcp'

export const mcp = new MCPClient({
  servers: {
    multitaskai: {
      url: new URL('https://mcp.multitaskai.com'),
      requestInit: {
        headers: {
          Authorization: 'Bearer YOUR_API_KEY',
        },
      },
    },
  },
})

Authentication

Mastra 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

  • Headers go under requestInit.headers.
  • listTools() prefixes each tool with the server name, as multitaskai_toolName.
  • listToolsets() returns tools per server, for passing as toolsets at runtime.
  • Keep the key in an environment variable in real code.

Official documentation

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