Skip to content

Connect Novu to ChatGPT: Trigger Events and Orchestrate Workflows

Learn how to connect Novu to ChatGPT using a managed MCP server. Trigger notification events, orchestrate subscriber management, and automate environment syncs.

Uday Gajavalli Uday Gajavalli · · 9 min read
Connect Novu to ChatGPT: Trigger Events and Orchestrate Workflows

If you need to connect Novu to ChatGPT to automate notification delivery, manage subscriber preferences, or orchestrate environment promotions, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's tool calls and Novu's REST APIs. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL. If your team uses Claude, check out our guide on connecting Novu to Claude or explore our broader architectural overview on connecting Novu to AI Agents.

Giving a Large Language Model (LLM) read and write access to a sprawling notification infrastructure like Novu is an engineering challenge. You have to handle dynamic payload schemas, environment-specific API routing, and complex pagination. Every time Novu updates an endpoint or deprecates a field, you have to update your server code, redeploy, and test the integration. This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Novu, connect it natively to ChatGPT, and execute complex workflows using natural language.

The Engineering Reality of the Novu API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against Novu's APIs—or maintaining custom connectors for 100+ other platforms—is painful. You aren't just integrating a generic CRM; you are integrating a multi-channel notification engine that has strict requirements for state management and variable mapping.

If you decide to build a custom MCP server for Novu, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with Novu:

Dynamic Workflow Payload Validation

Triggering a workflow in Novu (/v1/events/trigger) is not a static operation. The payload object you must pass depends entirely on the variables defined within the specific Novu template you are targeting. If your workflow requires a magic_link_url and a first_name, failing to provide them results in a rejected event. If you build a custom MCP server, you must dynamically map Novu's template variables into the JSON schemas provided to the LLM. If your schemas are static, the LLM will hallucinate payload structures and fail to trigger notifications.

Subscriber State Lifecycle Management

You cannot simply trigger a notification to a raw email address. Novu requires a subscriberId—a unique identifier mapping to your internal database. If an LLM is instructed to "send an alert to ops-team@company.com," your MCP server must first query the subscribers endpoint, check if that email exists, create a new subscriber if it doesn't, and then extract the resulting subscriberId to pass to the events endpoint. Building this state-checking logic into your custom server requires complex, multi-step orchestration.

Environment Drift and Promotion

Novu strictly separates Development and Production environments. The workflows, templates, and integration configurations often drift between these states. If an LLM needs to promote a workflow, it must interact with specific diffing and publishing endpoints (/v1/environments/compare). This requires your MCP server to manage multiple environment IDs and securely map API keys across different deployment contexts, ensuring the AI does not accidentally overwrite production data with development test variables.

Rate Limits and 429 Exhaustion

When triggering bulk events or rapidly querying subscriber lists, you will hit Novu's API limits. Truto does not absorb, retry, or apply exponential backoff to rate limit errors. When the Novu API returns an HTTP 429, Truto passes that error directly back to the caller. However, Truto normalizes the upstream rate limit information into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). If you build a custom server, you must extract Novu's specific rate limit headers and translate them yourself. With Truto, the standardized headers are guaranteed, but your MCP client or AI agent must still implement the intelligence to pause execution and respect the ratelimit-reset window.

The Managed MCP Architecture

Instead of building a custom Node.js or Python application to translate JSON-RPC 2.0 messages into Novu API requests, Truto provides a managed infrastructure layer. Truto dynamically derives your MCP tools from Novu's OpenAPI definitions and Truto's own internal documentation records.

When a tool is called, Truto intercepts the flat arguments payload from the LLM, intelligently splits it into URL parameters, query strings, and body payloads based on the derived JSON schemas, and proxies the request to Novu.

sequenceDiagram
    participant ChatGPT as ChatGPT (Client)
    participant Truto as Truto MCP Router
    participant Novu as Novu API
    
    ChatGPT->>Truto: POST /mcp/:token<br>{"method": "tools/call", "params": {"name": "create_a_novu_event"}}
    Truto->>Truto: Validate Token Hash<br>Verify Environment Config
    Truto->>Truto: Parse Flat Arguments<br>Split into Body & Query
    Truto->>Novu: POST /v1/events/trigger<br>Headers: Authorization, etc.
    Novu-->>Truto: 201 Created (Transaction ID)
    Truto-->>ChatGPT: JSON-RPC 2.0 Result<br>{"content": [{"type": "text", "text": "..."}]}

Generating the Novu MCP Server

An MCP server in Truto is scoped directly to a single connected integration account. The generated URL contains a cryptographic token that acts as the authentication layer. You can create this server via the Truto dashboard or programmatically via the API.

Method 1: Via the Truto UI

  1. Navigate to the Integrated Accounts page in your Truto dashboard.
  2. Select your connected Novu environment.
  3. Click the MCP Servers tab.
  4. Click Create MCP Server.
  5. Select your desired configuration (e.g., restrict to read methods or specific tags like events).
  6. Copy the generated MCP Server URL (e.g., https://api.truto.one/mcp/a1b2c3d4e5f6...).

Method 2: Via the API

For teams deploying agents programmatically, you can generate MCP servers on the fly by hitting the Truto API. This provisions the secure URL, registers the token in the distributed storage layer, and immediately exposes the allowed tools.

curl -X POST https://api.truto.one/integrated-account/{account_id}/mcp \
  -H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Novu DevOps Agent Server",
    "config": {
      "methods": ["read", "write", "custom"]
    }
  }'

Connecting the MCP Server to ChatGPT

Once you have the generated URL, connecting it to your AI client takes seconds.

Method A: Via the ChatGPT UI

If you are using ChatGPT Enterprise, Pro, or Team with Developer Mode enabled:

  1. Open ChatGPT and navigate to Settings -> Apps -> Advanced settings.
  2. Enable Developer mode.
  3. Under MCP servers / Custom connectors, click Add new.
  4. Enter a name (e.g., "Novu Integration").
  5. Paste the Truto MCP URL into the Server URL field.
  6. Save the configuration. ChatGPT will immediately perform the initialization handshake and fetch the available Novu tools.

Method B: Via CLI or Config File (Claude Desktop / Cursor)

If you are using Claude Desktop or an IDE like Cursor, you configure the MCP server by modifying the application's JSON configuration file to start an SSE (Server-Sent Events) connection.

{
  "mcpServers": {
    "novu-production": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://api.truto.one/mcp/a1b2c3d4e5f6..."
      ]
    }
  }
}

Hero Tools for Novu

Truto exposes dozens of endpoints for Novu. Here are the highest-leverage tools available to your AI agent for orchestrating notifications and managing environments.

1. Trigger an Event (create_a_novu_event)

This is the core execution tool for Novu. It allows the LLM to trigger a specific workflow for one or more subscribers, injecting the necessary dynamic payload data.

Usage Notes: The LLM must supply the name (the workflow identifier) and a to array (subscriber identifiers). It must construct a JSON payload that matches the variables expected by the workflow.

"Trigger the 'critical-incident' workflow for subscriber 'ops-lead-01'. In the payload, set the 'service_name' to 'Database Primary' and 'error_code' to 'OOM_KILLED'."

2. Broadcast an Announcement (novu_events_broadcast)

When a global notification is required, this tool triggers a broadcast workflow to all existing subscribers simultaneously. It bypasses the need to query and iterate over thousands of subscriber records.

Usage Notes: Highly impactful tool. The LLM only needs the workflow name and the payload. Use with strict access controls to prevent accidental mass-messaging.

"We just resolved the platform outage. Trigger the 'system-status-update' broadcast event to all users. Set the payload message to 'All systems are fully operational'."

3. Create a Subscriber (create_a_novu_subscriber)

Before you can send targeted notifications to a new user, they must exist in Novu. This tool provisions a new subscriber or updates an existing one if the subscriberId matches.

Usage Notes: The LLM should provide the internal subscriberId, email, firstName, and lastName.

"Create a new Novu subscriber using the ID 'usr_9982'. Their email is 'sarah.connor@example.com' and their name is Sarah Connor. Also, pass in custom data indicating they are on the 'enterprise' tier."

4. Create a Workflow (create_a_novu_workflow)

This tool allows an LLM to dynamically generate new notification workflows within the Novu Cloud environment.

Usage Notes: Creating workflows programmatically is complex. The LLM must supply a valid name and optionally configure step logic, channels, and active statuses.

"Create a new workflow in Novu named 'Weekly Digest Sync'. Set its description to 'Automated weekly digest for active project contributors' and ensure the status is active."

5. Compare Environments (novu_environments_compare)

This tool diffs the configuration and workflow changes between two Novu environments (e.g., Development and Production), providing a detailed readout of additions, modifications, and deletions.

Usage Notes: Requires the target environment ID. The LLM can use this to audit drift before executing a publish operation.

"Run a comparison between the current Dev environment and our Production environment ID. List out any workflows that have been modified but not yet published."

6. Update Subscriber Preferences (update_a_novu_subscriber_preference_by_id)

This tool modifies a subscriber's channel preferences (email, SMS, in-app, push, chat) on a global level or for a specific workflow.

Usage Notes: The LLM needs the subscriber_id. It must specify the exact channel and whether it should be enabled or disabled.

"Update the notification preferences for subscriber 'usr_9982'. Disable all SMS notifications for them across all workflows, but leave email enabled."

To view the complete inventory of available Novu tools, required parameters, and JSON schemas, visit the Novu integration page.

Workflows in Action

By chaining these tools together, ChatGPT can execute complex, multi-step operations that normally require custom scripts or manual dashboard intervention.

Scenario 1: Automated Incident Triage and Alerting

An IT administrator wants ChatGPT to handle an alert from their monitoring stack by ensuring the on-call engineer is registered in Novu and then triggering an emergency page.

"The payment gateway just went down. Make sure engineer 'dev-oncall-44' is registered in Novu with the email 'oncall@company.com'. Then, trigger the 'p1-incident' workflow for them, passing 'Payment Gateway' and '503 Service Unavailable' in the payload."

  1. ChatGPT calls create_a_novu_subscriber to upsert dev-oncall-44 and set their contact details.
  2. ChatGPT calls create_a_novu_event, setting name to p1-incident, passing to: "dev-oncall-44", and constructing the dynamic payload.
  3. The user receives confirmation of the transaction ID from Novu, proving the alert was dispatched.

Scenario 2: Environment Auditing and Promotion

A DevOps engineer needs to safely promote notification templates tested in staging to the live production environment.

"Check the differences between our staging environment and production environment 'env_prod_883'. If the 'password-reset' workflow is the only thing modified, go ahead and publish the changes to production."

flowchart TD
    A["ChatGPT calls<br>novu_environments_compare"] --> B{"LLM parses diff"}
    B -->|Only password-reset changed| C["ChatGPT calls<br>novu_environments_publish"]
    B -->|Other unexpected changes| D["ChatGPT halts<br>and warns user"]
    C --> E["Novu promotes<br>workflow to Prod"]
  1. ChatGPT calls novu_environments_compare targeting the production ID.
  2. The LLM reads the resulting additions, modifications, and deletions arrays in the response.
  3. Recognizing that only the intended workflow is modified, ChatGPT calls novu_environments_publish to apply the changes.
  4. The user receives a summary of the successful promotion.

Security and Access Control

Exposing a critical communication infrastructure like Novu to an LLM requires strict boundary setting. Truto provides four declarative mechanisms to secure your MCP server:

  • Method Filtering: Constrain the MCP server to specific HTTP verbs. Set methods: ["read"] to allow the LLM to audit environments and list subscribers, but mathematically prevent it from triggering events or deleting data.
  • Tag Filtering: Group tools by functional area. By setting tags: ["events"], you can create an MCP server that only has access to event-triggering and broadcasting endpoints, hiding all environment administration tools.
  • Require API Token Auth: By enabling require_api_token_auth: true, the MCP client must supply a valid Truto API token in addition to the server URL. This prevents leaked URLs from being abused by unauthenticated actors.
  • Expiration Scheduling: Use the expires_at field to create ephemeral MCP servers. Ideal for granting an external contractor or an automated script temporary access to audit Novu configurations for a 24-hour window, after which the database records and fast-lookup storage are automatically purged.

Strategic Wrap-up

Connecting Novu to ChatGPT via a custom-built integration layer is an exercise in managing technical debt. You are forced to write and maintain logic for dynamic payload mapping, environment configuration, and complex error handling.

By leveraging Truto's dynamically generated MCP servers, you shift the burden of API maintenance to a managed infrastructure. Your engineering team can focus on designing better notification experiences and AI agent prompts, while Truto ensures that the schemas, connections, and rate limit headers remain perfectly synchronized with Novu's actual capabilities.

FAQ

Does Truto automatically retry failed Novu events?
No. Truto does not retry, throttle, or apply backoff on rate limit errors. When Novu returns a 429 Too Many Requests, Truto passes the error to the caller and normalizes the rate limit info into standardized IETF headers. The caller must handle the retry logic.
How do I restrict the ChatGPT agent from sending broadcast events?
You can configure the MCP server with Method Filtering or Tag Filtering during creation. By restricting the server to specific tags or excluding write operations entirely, the broadcast tools will not be exposed to the LLM.
Do I have to re-authenticate the MCP server when Novu updates their API?
No. Because Truto derives the tool schemas dynamically from its managed integration configurations, the MCP server automatically adapts to upstream schema updates without requiring you to redeploy code or re-authenticate.

More from our Blog