MCP server
@notifkit/mcp exposes notifkit over the
Model Context Protocol, so an agent in your
terminal can send notifications, preview and edit templates, run workflows, manage audiences
and read the delivery log, with no one-off scripts.
It speaks stdio, which every major MCP client supports: Claude Code, Claude Desktop, Cursor, Gemini, and anything that can spawn a process. It's a thin client over the REST API, with no state, no open ports and no database access. It can do whatever your API key can do.
Install
npm install -g @notifkit/mcp
Or skip the install and let your client fetch it with npx -y @notifkit/mcp, as the
examples below do.
Configure
Three environment variables:
| Variable | Required | What it does |
|---|---|---|
NOTIFKIT_API_KEY |
yes | Your ADMIN_API_KEY, or a project API key. The server exits without it. |
NOTIFKIT_URL |
yes |
Base URL of your notifkit API. Falls back to http://localhost:3000, so
set it unless your API really is there.
|
NOTIFKIT_PROJECT_ID |
yes |
Which project the admin key acts on, sent as x-project-id. Without it an
admin key gets 400 on everything except /v1/projects. Only a
project-scoped key can go without, since it carries its own project.
|
With a project API key instead of the admin key, drop the NOTIFKIT_PROJECT_ID line. It's the safer choice, since it can only reach one project.
Claude Code
claude mcp add notifkit \
--env NOTIFKIT_URL=http://localhost:3000 \
--env NOTIFKIT_API_KEY=your_admin_api_key \
--env NOTIFKIT_PROJECT_ID=6f1c9c1e-3b7a-4d2e-9f04-2c8a5b1d7e33 \
-- npx -y @notifkit/mcp
Claude Desktop
{
"mcpServers": {
"notifkit": {
"command": "npx",
"args": ["-y", "@notifkit/mcp"],
"env": {
"NOTIFKIT_URL": "http://localhost:3000",
"NOTIFKIT_API_KEY": "your_admin_api_key",
"NOTIFKIT_PROJECT_ID": "6f1c9c1e-3b7a-4d2e-9f04-2c8a5b1d7e33"
}
}
}
}
The server logs diagnostics to stderr and prints its target URL on startup, so a wrong
NOTIFKIT_URL shows up in your client's MCP log instead of failing silently.
One-off emails from the terminal
notifkit sends from templates, which normally live in your backend and ship with a deploy. From an agent in the terminal you often want a one-off formatted email instead.
Create a pass-through template named raw_email once. Triple braces
{{{body}}} keep HTML unescaped, so your agent can write any HTML and subject line
straight from your prompt.
First, register the template once:
You: "Register a template called raw_email for email with subject {{subject}} and body {{{body}}}."
Agent: callsupsert_template
{
"id": "raw_email",
"channel": "email",
"content": {
"subject": "{{subject}}",
"html": "{{{body}}}"
}
}
Then send one-off emails from a prompt:
You: "Send an email to [email protected] saying their invoice #9481 is ready to download at https://app.acme.corp/inv/9481."
Agent: callssend_campaign
{
"campaign": "invoice-link-alex-2026-08-20",
"template": "raw_email",
"emails": ["[email protected]"],
"data": {
"subject": "Your invoice #9481 is ready",
"body": "Hi Alex,
Your invoice is available: Download Invoice #9481.
"
}
}
Each one-off email is routed, deduplicated, tracked for opens and clicks, and tagged with a campaign label for reporting.
The tools
Each tool's description and annotations tell the agent when and how to use it.
Campaigns & Sending
| Tool | What it does |
|---|---|
send_campaign |
Send a template directly to a list of destination addresses on email, sms, push, or webhook. Automatically creates/updates user records, handles deduplication, and tags every message with a campaign label for reporting. |
send_notification |
Send to existing user(s), a segment tag, or a topic. Supports sendAt scheduling, priority lanes (critical, high, normal, low), and campaign tags. |
list_campaigns |
List recent campaign labels with message count and activity timestamps. Supports filtering by search keyword, channel, since/until date ranges, and minMessages count. |
get_campaign_stats |
Sent, delivered, failed, opened, clicked, bounced, complained, unsubscribed, with rates and a per-channel split. Surfaces provider tracking warnings. |
list_segments |
List all active segment audience tags across users. |
list_scheduled |
List sends queued for the future, including quiet-hours deferrals, with channel filter and pagination. |
get_delivery_logs |
Query the delivery log. Filter by search, templateId, workflowInstanceId, channel, status, campaign, taskId. |
get_notification |
Fetch the delivery status, attempt timestamps, and provider logs for a specific taskId. |
cancel_notification |
Cancel a pending or quiet-hours deferred notification before it is dispatched to the provider. |
Templates
| Tool | What it does |
|---|---|
preview_template |
Dry-run render a template with sample variable data without sending. Interpolates {{variable}} and {{{raw}}} placeholders with contextual escaping, reporting resolved and missing variables. |
render_template |
Alias for preview_template. Render template content with variable data without dispatching notifications. |
list_templates |
List registered templates, with optional filtering by channel, topic opt-out tag, and limit. |
get_template |
Fetch one template definition by ID, including its per-channel content, topic associations, and AI prompts. |
upsert_template |
Create or update a template with channel-specific content (e.g. subject, HTML body) and optional per-field AI prompts. |
delete_template |
Permanently delete a registered template by ID. |
Users & Preferences
| Tool | What it does |
|---|---|
list_users |
Page through users, filtered by search (external ID or email), segment tag, language, timezone, and channel contact. |
get_user |
Fetch full user profile, contact endpoints, assigned segments, preferences, and recent delivery logs. |
upsert_user |
Create or overwrite a user profile, contacts, timezone, segment tags, and notification preferences in one call. |
update_user |
Partially update an existing user (e.g. language, timezone, preferences, segments, or append new contacts). |
delete_user |
Permanently delete a user profile and all associated contacts and preferences. |
get_user_contacts |
List all registered destination addresses, phone numbers, push tokens, and webhook URLs for a user. |
add_user_contact |
Add a contact target to an existing user without replacing their other channels or devices. |
delete_user_contact |
Remove a single contact destination (e.g. an old device token or email) from a user. |
get_user_preferences |
Fetch channel/topic opt-in preferences and quiet hours windows for a user. |
update_user_preferences |
Update channel opt-ins, topic opt-outs, and quiet hours schedule for a user. |
Workflows & Events
| Tool | What it does |
|---|---|
create_workflow |
Define a named multi-step sequence (drip campaigns, onboarding flows, reminder chains) with notify, wait, and waitForEvent steps. |
list_workflows |
List registered workflow definitions and their steps. Supports filtering by search keyword. |
trigger_workflow |
Start a new execution instance of a workflow for a specific user with custom input data. |
get_workflow_run |
Fetch execution state, current step, and waiting conditions for a workflow instance. |
cancel_workflow_run |
Cancel an active or suspended workflow instance so remaining steps never fire. |
ingest_event |
Publish an application event (e.g. order.paid, user.onboarded) to resume workflow instances parked on waitForEvent. |
Suppressions
| Tool | What it does |
|---|---|
list_suppressions |
List suppressed destinations with reason (unsubscribed, complained, bounced, manual), channel, and target filter. |
suppress_address |
Manually suppress an email, phone number, or push token to prevent all future sends. |
unsuppress_address |
Remove an address from suppression list. (Marked destructive: use only on explicit user confirmation). |
Operations & Projects
| Tool | What it does |
|---|---|
get_system_health |
Health report of Redis, Postgres database, and background workers (enricher, engine, scheduler, delivery, ai, workflow). |
get_system_metrics |
Report queue depths across all Redis streams and delivery statistics for the project. |
get_dead_letters |
List messages that exhausted retries and landed in the dead-letter queue (DLQ) with error reasons. |
replay_dead_letter |
Re-queue a dead-lettered message for delivery after resolving the underlying issue. |
delete_dead_letter |
Permanently dismiss/delete an entry from the dead-letter queue. |
list_projects |
List all tenant projects configured in the deployment. |
create_project |
Create a new project tenant and generate its initial admin API key. |
update_project |
Update project rate limits and throttling window parameters. |
delete_project |
Permanently delete a project and its associated data. |
list_project_keys |
List API keys created for a specific project. |
create_project_key |
Generate a new project API key with admin or read_only role. |
delete_project_key |
Revoke and delete a project API key. |
How teams use it
1. Support and delivery triage
A user says they never got a password reset link or invoice receipt. The support engineer has no database access, so an agent reading the delivery log is the fastest way to the reason.
You: "User
usr_9182(email[email protected]) says they didn't receive their invoice receipt. Check why."
Agent:
1. Callsget_user({ id: "usr_9182" })to inspect registered contacts and quiet hours.
2. Callslist_suppressions({ target: "[email protected]" })to check if the address bounced or was marked as spam.
3. Callsget_delivery_logs({ search: "usr_9182", limit: 10 })to view dispatch attempts and provider status codes.
Agent response: "The user has quiet hours configured from 22:00 to 08:00 inAmerica/Chicago. The notification was deferred and is scheduled to dispatch at 08:01 AM tomorrow."
2. Previewing a template before a live send
Before a campaign goes out, read the rendered output and confirm every placeholder resolved, without sending to a real inbox.
You: "Preview the
order_shippedtemplate for user Sarah with order #8172 and FedEx tracking."
Agent: callspreview_template({ id: "order_shipped", data: { name: "Sarah", orderId: "8172", carrier: "FedEx", trackingNumber: "FX-817293" } })
{
"templateId": "order_shipped",
"channel": "email",
"rendered": {
"subject": "Order #8172 has shipped!",
"body": "Hi Sarah, your package is on its way via FedEx. Tracking: FX-817293"
},
"resolvedVariables": ["name", "orderId", "carrier", "trackingNumber"],
"unresolvedVariables": []
}
3. Campaign reporting
Delivery and engagement figures for yesterday's announcement in one place, instead of separate Resend, Twilio and Firebase dashboards.
You: "How did the
v2-launch-broadcastcampaign perform yesterday?"
Agent: callsget_campaign_stats({ campaign: "v2-launch-broadcast" })
{
"campaign": "v2-launch-broadcast",
"totals": {
"sent": 12450,
"delivered": 12250,
"failed": 200,
"opened": 5129,
"clicked": 1085,
"bounced": 140,
"complained": 2,
"deliveryRate": 98.4,
"openRate": 41.2,
"clickRate": 8.7,
"complaintRate": 0.02
}
}
Reading the numbers
Opens and clicks come from provider webhooks. SMS and push report none, and email reports none
unless the webhook is configured, so a 0% open rate may mean nobody measured.
get_campaign_stats returns a warnings array saying which applies, and
the tool description tells the agent to repeat the warning rather than show a flat 0%.
Watch the complaint rate. Above roughly 0.3%, mailbox providers start throttling or junking your mail, and on the same sending domain that hits your transactional email too. That's why it's reported separately.
Safety
send_campaign, send_notification, trigger_workflow,
and replay_dead_letter reach real people and can't be recalled. Every tool has MCP
annotations: read-only tools are marked so, and cancel_workflow_run and
unsuppress_address are marked destructive, so a client can auto-approve reads and
prompt for writes.
Where to go next
create_workflow is building for you.sendAt: the mechanics behind a scheduled broadcast.