Connect Tray.ai to ChatGPT: Manage Embedded Users and Solutions
Learn how to connect Tray.ai to ChatGPT using an auto-generated MCP server. Manage embedded users, provision solution instances, and automate integrations.
If you need to connect Tray.ai to ChatGPT to automate embedded integration workflows, manage multi-tenant end users, or orchestrate solution instance deployments, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's JSON-RPC tool calls and Tray.ai's underlying GraphQL and REST APIs. You can either build, host, 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 Tray.ai to Claude or explore our broader architectural overview on connecting Tray.ai to AI Agents.
Giving a Large Language Model (LLM) read and write access to a powerful embedded iPaaS platform like Tray.ai is a complex engineering challenge. You have to handle multi-tenant isolation, map highly nested GraphQL queries to flat MCP tool schemas, and navigate complex authentication slot assignments. Every time Tray.ai introduces a new solution configuration parameter or alters its embedded billing models, your custom server code must be updated, redeployed, and tested.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Tray.ai, connect it natively to ChatGPT, and execute complex embedded integration operations using natural language.
The Engineering Reality of the Tray.ai API
A custom MCP server is essentially a self-hosted integration layer. While the open MCP standard provides a predictable way for LLMs to discover tools, implementing it against Tray.ai's highly specific API surface is exceptionally painful.
If you decide to build a custom MCP server for Tray.ai, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with Tray Embedded:
The GraphQL Mutation Paradigm and Cursors
Unlike standard REST APIs that accept flat JSON bodies, Tray.ai heavily utilizes GraphQL for its administrative and embedded operations. When you list solutions or instances, you are navigating highly nested structures - data.viewer.solutions.edges.node. Mapping these deeply nested graph payloads into flat, predictable MCP tool definitions requires writing recursive parsers. Additionally, pagination is entirely cursor-based (pageInfo), meaning your LLM must be explicitly instructed on how to handle and return opaque cursor strings without modifying them, otherwise pagination loops break entirely.
Complex Solution Instance Upgrades
Deploying a new version of a Tray.ai solution is not a simple version bump. When you call the upgrade endpoint, you must explicitly migrate and map configValues and authValues. If an LLM attempts to upgrade a solution instance without understanding the required config slots defined by the new version, the deployment will fail. A custom MCP server must dynamically expose the required slots for each specific solution version at tool-calling time, which is notoriously difficult to represent in static JSON schemas.
Multi-Tenant Authentication Scoping
Tray Embedded relies heavily on isolating integrations per end user. An authentication created for a specific third-party service (e.g., Salesforce) belongs strictly to the end user and must be tied to a specific service_environment_id. When ChatGPT attempts to wire up an integration, your server must enforce strict tenant boundaries, ensuring it queries the correct externalUserId before ever attempting to bind an authentication to a solution instance. Failure to enforce this in the proxy layer results in cross-tenant data leaks.
Rate Limiting and Backoff Management
Tray.ai enforces strict rate limits on its administrative endpoints, particularly for heavy GraphQL queries that fetch hundreds of solution instances. Truto does not retry, throttle, or apply backoff on rate limit errors. When the Tray.ai upstream API returns an HTTP 429 Too Many Requests, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit info into standard headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec. If you build this yourself, or when using Truto, the ChatGPT client or agent framework invoking the tools is strictly responsible for interpreting these headers and executing exponential backoff.
Step-by-Step: Connecting Tray.ai to ChatGPT
To bypass these architectural hurdles, we will use Truto's SuperAI to automatically generate a documentation-driven MCP server scoped to your Tray.ai instance.
Step 1: Connect the Tray.ai Account
Before generating an MCP server, you need to establish an authenticated connection to Tray.ai. In the Truto dashboard, navigate to Integrated Accounts -> New Integrated Account, select Tray.ai, and provide your master token or OAuth credentials. Truto handles the credential storage and secure token refresh lifecycle, meaning ChatGPT never sees an expired token.
Step 2: Create the Tray.ai MCP Server
Truto scopes every MCP server to a specific integrated account using a secure, cryptographically hashed token embedded in the server URL. You can create this server via the Truto UI or programmatically via the API.
Method A: Via the Truto UI
- Navigate to the Integrated Accounts page in the Truto dashboard and select your Tray.ai connection.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Configure the server name, allowed methods (e.g.,
read,write), and tool tags to constrain what the LLM can access. - Copy the generated MCP Server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4...). Treat this URL as a sensitive credential.
Method B: Via the API You can programmatically generate MCP servers, which is ideal if you are dynamically spinning up agentic sessions for internal users.
curl -X POST https://api.truto.one/integrated-account/$INTEGRATED_ACCOUNT_ID/mcp \
-H "Authorization: Bearer $TRUTO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Tray.ai ChatGPT Admin",
"config": {
"methods": ["read", "write"],
"tags": ["users", "solutions", "instances"]
}
}'The API returns a payload containing the url. This single endpoint handles protocol initialization, tool listing, schema mapping, and execution routing.
Step 3: Connect the MCP Server to ChatGPT
With your MCP server URL in hand, you must now register it with ChatGPT. You can do this via the ChatGPT desktop UI or via a manual configuration file for custom agent frameworks.
Method A: Via the ChatGPT UI
- Open the ChatGPT Desktop App (Requires a Pro, Plus, Business, Enterprise, or Education plan).
- Navigate to Settings -> Apps -> Advanced settings.
- Toggle on Developer mode.
- Under MCP servers / Custom connectors, click Add new.
- Provide a name like "Tray.ai Embedded Admin" and paste the Truto MCP URL into the Server URL field.
- Click Save. ChatGPT will immediately handshake with the server and list the available Tray.ai tools.
Method B: Via Manual Configuration File (Agentic / CLI testing) If you are testing locally or integrating into a framework that requires a configuration file (like Claude Desktop or Cursor), you must route the connection through an SSE transport bridge. Truto provides this natively.
Create or update your mcp_config.json:
{
"mcpServers": {
"tray_ai_admin": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/YOUR_TRUTO_TOKEN"
]
}
}
}Run the agent. The client will execute the npx @modelcontextprotocol/server-sse command to establish a persistent connection to Truto's managed endpoints.
Hero Tools for Tray.ai
Once connected, ChatGPT gains access to the fully typed Tray.ai API surface. Truto dynamically translates Tray.ai's GraphQL schemas into standard JSON Schema for the LLM.
Here are the highest-leverage tools available for automating Tray Embedded workflows.
List All Tray.ai Solutions
Fetches all published solutions available to your end users. It returns the id, title, and highly critical configSlots and authSlots needed for deployment. Because Truto handles the GraphQL abstraction, the LLM simply receives an array of solution nodes.
"Fetch all available Tray.ai solutions for my organization. I need a list of their titles, IDs, and the required config slots for the 'Salesforce Sync' solution."
Create a Tray.ai User
Automates the first step of tenant onboarding. You pass the name and your system's external_user_id to establish a boundary for their authentications and solution instances. It returns the userId which is required for all subsequent operations.
"Provision a new Tray Embedded end user for the tenant 'Global Logistics Inc'. Use their tenant ID 'tenant_99812' as the external_user_id."
List All Tray.ai Authentications
Retrieves the stored third-party credentials belonging to a specific viewer. This is critical for auditing which end users have successfully connected their CRM or ERP before attempting to deploy a workflow.
"List all active authentications for the end user we just created. I need to know if they have a valid 'HubSpot' credential set up."
Create a Tray.ai Solution Instance
Deploys a specific solution for an end user. The LLM must supply the solution_id and a name. This triggers the backend deployment of the underlying workflows defined in the project.
"Deploy a new solution instance named 'Production HubSpot Sync' using solution ID 'sol_12345'. Link it to the user ID we generated earlier."
Upgrade Tray.ai Solution Instances
Applies a new version of a solution to an existing instance. This tool manages the complex mapping of older configValues to the newer version's requirements, keeping the end user's integration running smoothly without manual intervention.
"Upgrade the solution instance 'Production HubSpot Sync' to the latest version. Ensure the existing auth slots for Salesforce are mapped correctly to the new version requirements."
Export Tray.ai Projects
Generates a complete JSON backup of a Tray.ai project. This is vital for CI/CD pipelines, allowing you to back up a workspace or promote a project from a staging environment to production programmatically.
"Export the project with ID 'proj_8877' as a JSON payload so we can back up the current workflow logic before making schema changes."
For the complete inventory of tools, schemas, and required parameters, review the Tray.ai integration page.
Workflows in Action
Exposing individual tools is useful, but the true power of an MCP server lies in the LLM's ability to chain these tools together to execute multi-step orchestration. Here are two real-world scenarios.
Workflow 1: New Embedded Tenant Onboarding
When a new customer signs up for your SaaS product, your IT team or support engineers can use ChatGPT to instantly provision their embedded integration workspace without touching the Tray.ai console.
"We just signed 'Acme Corp'. Create a new Tray.ai embedded user for them using their ID 'acme_001'. Then, generate a one-time authorization code for them so they can authenticate their Salesforce account in our UI. Finally, prepare to deploy the 'Acme Standard Sync' solution."
Execution Steps:
- ChatGPT calls
create_a_tray_ai_userpassingname: "Acme Corp"andexternal_user_id: "acme_001". - The server returns the new
userId. - ChatGPT calls
tray_ai_users_generate_authorization_codeusing the returneduserId. - ChatGPT formats the authorization code and instructions, returning them to the human operator.
sequenceDiagram
participant User as Human Operator
participant ChatGPT as ChatGPT
participant MCP as Truto MCP Server
participant Tray as Tray.ai API
User->>ChatGPT: "Provision new embedded user Acme Corp..."
ChatGPT->>MCP: Call tool [create_a_tray_ai_user]
MCP->>Tray: POST /graphql (CreateUser)
Tray-->>MCP: Returns userId
MCP-->>ChatGPT: Returns userId
ChatGPT->>MCP: Call tool [tray_ai_users_generate_authorization_code]
MCP->>Tray: POST /graphql (GenerateAuthCode)
Tray-->>MCP: Returns authorizationCode
MCP-->>ChatGPT: Returns code
ChatGPT-->>User: "Provisioned Acme Corp. Auth code is: xyz123"Workflow 2: Bulk Solution Upgrade and Auditing
Managing solution versions across hundreds of embedded tenants is incredibly tedious. You can instruct ChatGPT to audit and upgrade outdated instances.
"Find all solution instances in our organization that belong to the 'Marketo Sync' solution. If any of them are disabled or running an old version, enable them and execute a solution instance upgrade."
Execution Steps:
- ChatGPT calls
list_all_tray_ai_solution_instancesto retrieve the master list of deployments. - It filters the results in-memory, identifying instances where
solutionVersionFlagsindicate an update is pending orenabledis false. - For each outdated instance, ChatGPT calls
tray_ai_solution_instances_upgrade, passing the instance ID. - For any disabled instance, it calls
update_a_tray_ai_solution_instance_by_idpassingenabled: true. - ChatGPT summarizes the total number of upgraded and activated instances to the user.
Security and Access Control
Giving an AI agent access to your integration infrastructure requires strict governance. Truto provides four distinct configuration filters to lock down your MCP server at the time of creation:
- Method Filtering (
methods): Restrict the server to read-only operations by passing["read"]. This allows the LLM to query users and instances without the ability to create, update, or delete them. - Tag Filtering (
tags): Scope the server to specific domains. By passing["users", "authentications"], the LLM can manage end users but cannot touch underlying project configurations or solution instances. - Expiration (
expires_at): Set a hard TTL (Time-To-Live) using an ISO datetime string. The server URL and underlying credentials will automatically self-destruct at the specified time, perfect for granting temporary access to contractors or short-lived agentic tasks. - Dual Authentication (
require_api_token_auth): Enable this flag to require the caller to provide a valid Truto API token in addition to possessing the MCP server URL. This prevents unauthorized execution even if the URL leaks in a Slack channel or log file.
Automate Embedded iPaaS Without the Boilerplate
Connecting Tray.ai to ChatGPT via MCP transforms how your organization manages embedded integrations. Instead of writing custom Node.js scripts to loop over GraphQL paginations or build custom dashboards for your support team, you can manage your entire multi-tenant architecture using natural language.
By leveraging a managed MCP infrastructure like Truto, you bypass the complexity of schema translation, authentication storage, and API versioning. Your AI agents get immediate, secure access to the tools they need, and your engineers get their time back.
FAQ
- Does Truto automatically retry when Tray.ai hits a rate limit?
- No. Truto passes upstream HTTP 429 Too Many Requests errors directly to the caller. Truto normalizes the rate limit information into standard headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset), but the caller (ChatGPT or your agent framework) is responsible for handling retry and exponential backoff logic.
- Can I restrict ChatGPT to only read data from Tray.ai?
- Yes. When creating the MCP server in Truto, you can configure the methods array to only include ["read"]. This ensures ChatGPT can list solutions and users but cannot create instances or modify authentications.
- How do I connect the MCP server to ChatGPT?
- You can connect via the ChatGPT desktop app by navigating to Settings -> Apps -> Advanced settings, enabling Developer mode, and adding the Truto MCP URL as a Custom Connector. Alternatively, for local agents, use a configuration file with the npx @modelcontextprotocol/server-sse command.
- Do I need to write GraphQL queries for the Tray.ai MCP tools?
- No. Truto automatically translates Tray.ai's nested GraphQL operations into flat, predictable JSON-RPC tool schemas that the LLM understands, abstracting away the complexity of cursors and nodes.