Skip to content
nofeb

nofeb with Mastra

Agent framework · configuration checked against the vendor's documentation on 2026-10-01

Create an MCPClient from @mastra/mcp with a nofeb server whose url is a URL object and whose requestInit.headers carries the Authorization header. Use listTools() for static tools on an Agent, or listToolsets() when credentials vary per request.

Checked against the engine on .

Where does the configuration go?

MCPClient from @mastra/mcp.

Install
npm install @mastra/mcp@latest

How do I connect Mastra?

  1. npm install @mastra/mcp@latest.
  2. Create the client as below; headers go under requestInit.
  3. Pass await mcpClient.listTools() to your Agent, or use listToolsets() to supply a different nofeb key per request (for example one per end customer).
Mastra: TypeScript
import { MCPClient } from '@mastra/mcp'

export const mcpClient = new MCPClient({
  id: 'nofeb-mcp-client',
  servers: {
    nofeb: {
      url: new URL('https://api.nofeb.com/mcp'),
      requestInit: {
        headers: {
          Authorization: `Bearer ${process.env.NOFEB_API_KEY}`,
        },
      },
    },
  },
})

// static tools for an Agent:
const tools = await mcpClient.listTools()
// per-request credentials: await mcpClient.listToolsets()

Checked against Mastra's documentation on . source: mastra.ai

What should I know about Mastra's setup?

  • url must be a URL object, and headers go under requestInit.
  • The method names are listTools() and listToolsets(); getTools() and getToolsets() are the older names.

What can I ask it to do?

A per-customer agent that receives that customer's pod-scoped nofeb key through listToolsets(), so it can only see that customer's inboxes.

117 tools are available, including create_inbox, wait_for_email, reply_to_message, get_thread_context, set_thread_state and get_dns_setup. Whether a send goes out at once or waits for a person is decided by the inbox's autonomy tier on the server, not by Mastra.

Frequently asked questions

Why listToolsets() for multi-tenant apps?

It lets each request carry its own nofeb key. With pod-scoped keys, one customer's agent cannot reach another customer's inboxes.

Status of everything on this page

Every capability named above, with its status as reconciled against the engine.

CapabilityWhat it doesStatus
MCP server A remote MCP server over streamable HTTP whose tools are generated from the same operation table as the REST API and dispatched through the same router, so a tool cannot behave differently from its endpoint. Shipped
Scoped API keys Keys bound to the organization, one pod or one inbox, holding only the scopes they are given. A key cannot mint a key wider than itself. Shipped
Autonomy tiers enforced by the server Every inbox carries a sending policy, from read-only to autonomous, enforced on the server for every surface that sends, so switching from the API to MCP cannot bypass it. Shipped
Wait for an email Long-poll an inbox for up to a minute until a message matching sender, subject or has-a-code arrives. Shipped
TypeScript and Python SDKs Official clients generated from the OpenAPI document: @nofeb/sdk for Node, Deno, Bun and edge runtimes, and nofeb for Python with sync and asyncio clients. Both chain long polls for waitForEmail, retry idempotent requests, page through lists and verify webhook signatures. Shipped
MCP sign-in with OAuth MCP clients connect by signing in instead of pasting a key: OAuth 2.1 with discovery, dynamic client registration, client ID metadata documents, PKCE, tokens bound to the MCP server, refresh-token rotation and immediate revocation. A person approves the scopes, and optionally one inbox, in the console, and can disconnect the app at any time. API keys keep working beside it. Shipped