MCP server for
notifications.
Each route in your catalog becomes an MCP tool. Claude, Cursor, and Copilot call them to send emails, SMS, or push notifications with validated inputs.
mcp-server.ts
import { createNotify, createClient } from '@betternotify/core'; import { emailChannel } from '@betternotify/email'; import { resendTransport } from '@betternotify/resend'; import { createMcpServer } from '@betternotify/mcp'; const rpc = createNotify({ channels: { email: emailChannel() }, }); const catalog = rpc.catalog({ welcome, invoice, alert, }); const mcp = createMcpServer({ catalog }); const mail = createClient({ catalog, transportsByChannel: { email: resendTransport({ apiKey }) }, plugins: [mcp.plugin()], }); mcp.connect(mail); await mcp.start({ type: 'stdio' });
Setup
Three calls. That's it.
Zod schemas convert to JSON Schema for tool discovery. Middleware, hooks, and failover run on every agent send, same as programmatic calls.
mcp-server.ts
import { createMcpServer } from '@betternotify/mcp'; const mcp = createMcpServer(({ catalog }); const mail = createClient(({ catalog, transportsByChannel: { email: resendTransport(({ apiKey }) }, plugins: [mcp.plugin()], }); mcp.connect(mail); await mcp.start(({ type: 'stdio' });
stdio for dev
Add to Claude Code, Cursor, or Windsurf config. The server runs as a child process.
{
"mcpServers": {
"betternotify": {
"command": "npx",
"args": ["tsx", "mcp-server.ts"]
}
}
}HTTP for prod
Deploy as a network service. Bearer token, API key, or custom auth. Sessions multiplex over a single endpoint.
await mcp.start(({ type: 'http', port: 3100, authenticate: bearerAuth(secret), });
Route filtering
expose and deny accept glob patterns. Lock agents to transactional routes; keep marketing routes code-only.
Let your agents send notifications.
One package. Works with any MCP client. Add @betternotify/mcp and start the server.