Skip to content

Connect Nango to ChatGPT: Sync Data & Manage Auth Connections

A complete engineering guide to connecting Nango to ChatGPT via Truto's auto-generated MCP server to automate OAuth connections, proxy routing, and data syncs.

Uday Gajavalli Uday Gajavalli · · 9 min read
Connect Nango to ChatGPT: Sync Data & Manage Auth Connections

If you need to connect Nango to ChatGPT to orchestrate integration functions, trigger data syncs, or manage third-party OAuth credentials, you need a Model Context Protocol (MCP) server. This server translates ChatGPT's unstructured tool requests into Nango's strict REST API schemas. You can spend weeks building, hosting, and managing this translation layer in-house, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL in seconds.

If your team uses Claude, check out our guide on connecting Nango to Claude or explore our broader architectural overview on connecting Nango to AI Agents.

Giving a Large Language Model (LLM) agent control over an integration framework like Nango introduces a unique meta-challenge. Nango itself is an API that manages other APIs. When you expose Nango to an LLM, you are asking the LLM to understand not just Nango's data model, but the third-party payloads Nango routes. Building custom MCP tool schemas for Nango deployments, connection metadata, and proxy execution requires constant maintenance.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Nango, connect it natively to ChatGPT, and execute complex integration workflows using natural language.

Stop writing boilerplate API integration code. Let Truto generate secure, managed MCP servers for your AI agents in seconds. :::

The Engineering Reality of the Nango 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, implementing it against an integration-management API like Nango is painful. If you decide to build a custom MCP server for Nango, you own the entire API lifecycle.

Here are the specific integration challenges that break standard CRUD assumptions when working with Nango:

The Two-Headed Authentication Monster

Nango handles third-party API authentication, but managing those credentials programmatically is split into two completely different paradigms. To initiate an OAuth flow for an end-user, your LLM must call an endpoint to generate a temporary connect_link (a short-lived session token). But to inject hardcoded credentials (like a vendor API key), the LLM must hit a completely different connection upsert endpoint, passing complex provider-specific schema configurations. Your MCP tool definitions must strictly differentiate these behaviors, otherwise the LLM will hallucinate passing raw API keys into frontend session endpoints.

Async Teardown and Deployments

When an LLM wants to deploy a new TypeScript integration function via Nango, the operation is fundamentally asynchronous. Pushing code to Nango returns an immediate 202 Accepted with a deployment ID, not a success status. If the LLM needs to know if the deployment succeeded before triggering a data sync, your custom MCP server must expose separate polling tools, teaching the LLM to query the deployment status until it reaches a terminal state.

The Opaque Passthrough of the Nango Proxy

Nango's proxy endpoints allow you to hit third-party APIs directly using Nango's managed tokens. However, the Nango proxy is "opaque"—it simply forwards the HTTP method, path, headers, and JSON body to the downstream vendor exactly as received. If the LLM uses the proxy to POST data to Salesforce, it must construct a perfectly valid Salesforce JSON payload and pass it as a nested string inside the Nango proxy JSON payload. Double-nested JSON schemas are notoriously difficult for LLMs to generate correctly without meticulously crafted JSON Schema definitions in the MCP tool description.

How to Generate an MCP Server for Nango

Truto automatically derives MCP tools from an integration's resource definitions and schema documentation. To expose Nango to ChatGPT, you just generate an MCP server mapped to your Nango account.

You can do this using either the Truto UI or the API.

Method 1: Via the Truto UI

For ad-hoc configurations and testing, generating the server through the dashboard is the fastest route:

  1. Navigate to the Integrated Accounts page in your Truto dashboard and select your active Nango connection.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Configure your server constraints. You can restrict the server to specific operations (e.g., read-only) or specific resource tags.
  5. Copy the generated MCP Server URL (e.g., https://api.truto.one/mcp/a1b2c3d4e5f6...). Keep this secure; the token in the path acts as the authentication key.

Method 2: Via the Truto API

For production workflows, you should generate MCP servers programmatically on behalf of your users. This ensures each ChatGPT session gets an isolated, securely scoped server.

Send a POST request to the /integrated-account/:id/mcp endpoint:

curl -X POST https://api.truto.one/integrated-account/<nango_account_id>/mcp \
  -H "Authorization: Bearer YOUR_TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ChatGPT Nango Manager",
    "config": {
      "methods": ["read", "write"],
      "tags": ["connections", "syncs"]
    },
    "expires_at": "2026-12-31T23:59:59Z"
  }'

The Truto API will evaluate the Nango integration, ensure the requested tools exist, generate a secure token hashed via HMAC in Cloudflare KV, and return the server details:

{
  "id": "mcp-789-xyz",
  "name": "ChatGPT Nango Manager",
  "expires_at": "2026-12-31T23:59:59Z",
  "url": "https://api.truto.one/mcp/a1b2c3d4e5f67890"
}

Connecting the MCP Server to ChatGPT

Once you have the Truto MCP URL, providing ChatGPT with access to Nango requires zero code on the client side. The connection can be established either through the UI or a configuration file.

Method A: Via the ChatGPT UI

If you are using ChatGPT Enterprise or an account with developer/custom connector capabilities:

  1. Open ChatGPT and go to Settings -> Apps -> Advanced settings.
  2. Enable Developer mode.
  3. Under MCP servers / Custom connectors, click to add a new server.
  4. Name: Enter a recognizable name (e.g., "Nango Integration Ops").
  5. Server URL: Paste the https://api.truto.one/mcp/... URL generated in the previous step.
  6. Save the configuration. ChatGPT will immediately perform the initialize handshake and pull the list of available Nango tools.

Method B: Via Manual Config File

If you are running a local LLM client or an agentic framework (like LangChain or Cursor) that supports MCP config files, you can connect using the official Server-Sent Events (SSE) transport wrapper:

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

Hero Tools for Nango

Truto maps Nango's API endpoints to snake_case MCP tools using highly descriptive JSON Schemas. Here are the highest-leverage tools available for ChatGPT to automate Nango.

create_a_nango_connect_session

Generates a short-lived (30 minute) URL for the Nango Connect UI. This is critical when an agent needs to prompt an end-user to authenticate a third-party app via OAuth.

"Generate a Nango connect session for our new client to authenticate HubSpot. Return the connect_link so I can send it to them."

list_all_nango_connections

Retrieves all active Nango connections (without sensitive credentials) across your tenant. Use this to audit which users have successfully linked which providers, check connection IDs, and review custom metadata tags.

"List all active Nango connections and check if tenant-xyz has successfully authorized the Salesforce provider."

nango_sync_trigger

Forces an immediate, one-off execution of a configured data sync. If your agent determines that data in the downstream app is stale, it can use this tool to bypass the scheduled cadence and force a refresh.

"The customer says their recent invoices aren't showing up. Trigger the 'invoice_sync' for connection 'tenant-abc-stripe' immediately."

nango_functions_create_deployment

Deploys a new integration function using submitted TypeScript source code. This starts the async deployment process and returns an ID that must be polled.

"Deploy this updated TypeScript mapping logic to the 'hubspot-contacts' integration. Note the deployment ID returned."

nango_functions_get_deployment

Queries the status of an async deployment triggered by the tool above. Agents must loop this tool until the status returns SUCCESS or FAILED.

"Check the status of deployment ID 'dep_98765'. Let me know if the build failed or if the function is now live."

create_a_nango_proxy

Forwards a POST request to a third-party API via Nango's managed authentication. The LLM supplies the any_path and the exact JSON payload the downstream vendor expects.

"Use the Nango proxy to POST a new contact record to the Zendesk API for connection 'acme-zendesk'. Ensure the payload matches Zendesk's user schema."

For a comprehensive view of all available operations, query parameters, and JSON schemas, see the complete Nango integration page.

Workflows in Action

To see how ChatGPT orchestrates multi-step processes via these tools, let's look at real-world agentic workflows.

Scenario 1: Provisioning a New Integration and Triggering a Sync

Persona: Support Engineer setting up a new enterprise customer.

"We just signed Acme Corp. Check if they have a Nango connection established for HubSpot. If they do not, generate a Connect UI session link for them. If they do, trigger their 'deals_pipeline' sync right now so we have fresh data."

Tool Execution Sequence:

sequenceDiagram
    participant User
    participant Agent as ChatGPT (Client)
    participant MCP as Truto MCP Server
    participant Upstream as Nango API

    User->>Agent: "Check Acme Corp's HubSpot connection..."
    Agent->>MCP: Call list_all_nango_connections <br> (filter by metadata)
    MCP->>Upstream: GET /connection
    Upstream-->>MCP: Returns active connections
    MCP-->>Agent: Connections list (Acme not found)
    Agent->>MCP: Call create_a_nango_connect_session
    MCP->>Upstream: POST /connection/session
    Upstream-->>MCP: Returns connect_link URL
    MCP-->>Agent: Session URL
    Agent-->>User: "Acme has no connection. Here is their secure Connect UI link: https://api.nango.dev/connect/..."

What happens: ChatGPT first uses list_all_nango_connections to search for Acme's provider key. Realizing the connection is missing, it dynamically switches contexts, calling create_a_nango_connect_session to generate the exact URL the support engineer needs to send to the client.

Scenario 2: Deploying Code and Verifying Rollout

Persona: Integration Developer testing a new API mapping logic.

"Deploy this new mapping script to the 'salesforce-sync' function in Nango. Once you trigger the deployment, monitor it until it's finished and tell me if it was successful."

Tool Execution Sequence:

flowchart TD
    A["Agent receives <br> deployment request"] --> B["Call nango_functions_create_deployment"]
    B --> C{"Status <br> returned?"}
    C -->|"Returns ID: dep_123"| D["Call nango_functions_get_deployment <br> with ID"]
    D --> E{"Status?"}
    E -->|"PENDING"| D
    E -->|"SUCCESS"| F["Return success <br> message to user"]
    E -->|"FAILED"| G["Return error <br> logs to user"]

What happens: ChatGPT understands the async nature of the Nango deployment process. It calls nango_functions_create_deployment, extracts the ID, and then deliberately loops nango_functions_get_deployment until the state machine resolves.

Security and Access Control

Giving an LLM direct API execution rights into an orchestration layer like Nango requires strict security boundaries. Truto's MCP architecture enforces control at the server level:

  • Method Filtering: Restrict an MCP server to only allow read operations. If a user asks ChatGPT to delete a Nango connection, the tool call is rejected by the Truto router before it even touches the upstream API.
  • Tag Filtering: Scope the MCP server to specific functional areas using config.tags. You can create a server that only has access to the syncs tools, hiding connections and functions entirely.
  • API Token Auth Layer: By enabling require_api_token_auth, the Truto MCP server URL alone is not enough to execute a tool. The client connecting to the server must also pass a valid Truto API token in the Authorization header.
  • Auto-Expiring Servers: Use the expires_at property to grant ChatGPT temporary access to Nango. Once the timestamp passes, a Durable Object alarm fires and the token is purged from Cloudflare KV, permanently killing the server.

Handling Nango API Rate Limits

When orchestrating high-volume syncs or polling deployment statuses, it is easy for an LLM loop to hit Nango's rate limits.

Truto does not retry, throttle, or apply backoff on rate limit errors.

If Nango returns an HTTP 429 Too Many Requests error, Truto passes that 429 error directly back to the caller (ChatGPT). However, Truto heavily normalizes the upstream response. It translates Nango's specific rate limit headers into the standard IETF specification (ratelimit-limit, ratelimit-remaining, ratelimit-reset).

When ChatGPT receives a 429 error via the MCP tool result, it is the LLM's responsibility to read the ratelimit-reset context, pause its execution, and retry the tool call when the window clears. Do not assume the Truto middleware will absorb or hide upstream throttling from your AI agent.

Strategic Wrap-Up

Connecting Nango to ChatGPT transforms how your engineering and support teams manage third-party integrations. Instead of clicking through dashboards to check connection statuses, read proxy logs, or trigger ad-hoc data syncs, you can orchestrate your entire integration layer using natural language.

By leveraging Truto's documentation-driven MCP server generation, you avoid writing the massive boilerplate required to manually map Nango's complex integration schemas into JSON-RPC tool definitions. Truto handles the schema translation, token security, and request routing, letting you focus entirely on building high-leverage agent workflows.

FAQ

Can I use ChatGPT to trigger Nango data syncs?
Yes. By connecting Nango to ChatGPT via an MCP server, you can expose the nango_sync_trigger tool to start one-off syncs or kick off scheduled sync pipelines natively from the chat interface.
How do I filter which Nango functions ChatGPT can access?
When creating the MCP server via Truto, you can use method filtering (e.g., config: { methods: ["read"] }) or tag filtering to strictly limit the LLM to specific tools, preventing destructive actions like connection deletion.
Does Truto handle Nango API rate limits automatically?
No. Truto passes HTTP 429 rate limit errors directly back to the calling client (ChatGPT) without retrying or applying backoff. It normalizes Nango's limit headers into standard IETF ratelimit-* headers, leaving retry orchestration up to the caller.

More from our Blog