Skip to content

Connect Lirium to ChatGPT: Manage Crypto Customer KYC and Orders

Learn how to build a Lirium MCP server to connect ChatGPT to your crypto infrastructure. Automate KYC document uploads, partner orders, and fiat workflows.

Uday Gajavalli Uday Gajavalli · · 9 min read
Connect Lirium to ChatGPT: Manage Crypto Customer KYC and Orders

If you need to connect Lirium to ChatGPT to automate crypto operations, KYC document processing, or partner fiat settlements, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's tool calls and Lirium's highly specific REST API. You can either spend weeks building and maintaining 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 Lirium to Claude, or explore our broader architectural overview on connecting Lirium to AI Agents). If you're new to the protocol, first read about what is an MCP server and how it works.

Giving a Large Language Model (LLM) read and write access to a live financial and crypto infrastructure ecosystem is an engineering challenge with zero margin for error. You have to handle complex nested fiat schemas, multi-step authorization loops, and strict rate limits. Every time Lirium updates an endpoint or deprecates a KYC 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 Lirium MCP server, connect it natively to ChatGPT, and execute complex crypto compliance and trading workflows using natural language.

The Engineering Reality of the Lirium 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 Lirium's APIs is painful. You aren't just integrating a standard CRM—you are orchestrating regulated financial transactions.

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

The Fiat Settlement Schema Maze Executing a fiat withdrawal in Lirium isn't a simple value transfer. Lirium operates across multiple jurisdictions, requiring specific banking standards depending on the region. A withdrawal object for Argentina requires an ar_cvu or ar_cbu payload, while a withdrawal in Mexico requires an mx_clabe sub-object. If your MCP server doesn't provide strict JSON schemas to the LLM detailing exactly which fields are required for which region, ChatGPT will hallucinate the banking payload and the transaction will hard-fail.

KYC Document Uploads and Multipart Formatting Submitting customer identity documents (create_a_lirium_customer_document) is not a standard JSON POST request. It requires handling file uploads with specific document_type and file_type parameters, encoded properly. Building an MCP tool that allows an AI agent to accept a file reference, encode it, and push it to Lirium's compliance engine requires custom middleware that understands file streaming and validation.

Asynchronous Order Authorizations In Lirium, some orders (like external sends) require explicit partner authorization before processing. An agent cannot simply fire a create order and assume completion. Your MCP setup must map tools to list_all_lirium_partner_authorizations, isolate pending orders, and provide a dedicated tool (update_a_lirium_order_authorization_by_id) for the LLM to programmatically approve or reject the hold.

Rate Limits and 429 Errors Financial APIs aggressively rate limit anomalous behavior. Truto does not retry, throttle, or apply backoff on rate limit errors. When Lirium returns an HTTP 429, Truto passes that error directly to the caller. However, Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) following the IETF spec. The AI agent or calling framework is strictly responsible for inspecting these headers and implementing its own delay and backoff logic before retrying the tool call. If you build this manually, you have to write the interceptor logic to parse these headers and instruct the LLM to wait.

Instead of forcing your engineering team to build a bespoke financial transaction layer, you can use Truto to generate a managed MCP server that inherits Lirium's resources dynamically. This approach aligns with the auto-generated MCP tools architecture designed for zero-maintenance infrastructure.

How to Generate the Lirium MCP Server

Truto's dynamic tool generation engine reads the Lirium integration's resource schemas and automatically outputs a JSON-RPC 2.0 endpoint that ChatGPT understands. You can generate this server via the Truto UI or programmatically via the API.

Method 1: Via the Truto UI

For IT admins or operations teams who want to rapidly provision an AI integration without writing code:

  1. Log into your Truto dashboard and navigate to your connected Lirium Integrated Account.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Select the desired configuration (name, allowed methods like read or write, and tag filters).
  5. Copy the generated MCP server URL. (e.g., https://api.truto.one/mcp/a1b2c3d4...)

Method 2: Via the API

For engineering teams building automated provisioning pipelines, you can generate an MCP server dynamically by hitting the Truto API. The infrastructure creates a secure, hashed token in a distributed key-value store to authenticate the session.

Endpoint: POST /integrated-account/:id/mcp

{
  "name": "Lirium KYC and Trading AI",
  "config": {
    "methods": ["read", "write", "custom"],
    "require_api_token_auth": false
  },
  "expires_at": "2026-12-31T23:59:59Z"
}

The API returns a ready-to-use secure token URL. This URL encapsulates the routing, authentication, and schema definitions required to query Lirium.

Connecting the MCP Server to ChatGPT

Once you have your Truto MCP URL, you need to register it with ChatGPT so the LLM knows how to discover the Lirium tools. This is the same mechanism used to bring custom connectors to ChatGPT for broader workflow automation.

Method A: Via the ChatGPT UI

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

  1. In ChatGPT, navigate to Settings → Apps → Advanced settings.
  2. Enable Developer mode.
  3. Under MCP servers / Custom connectors, click Add.
  4. Enter a name (e.g., "Lirium Ops").
  5. Paste the Truto MCP server URL and click Save.

ChatGPT will immediately ping the server, request the initialization schemas, and populate your available tools.

Method B: Via Manual Config File

If you are running a local instance of Claude Desktop or an enterprise ChatGPT client wrapper that relies on file-based configuration, you can mount the MCP server using Server-Sent Events (SSE).

Add this JSON block to your client's MCP configuration file:

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

Hero Tools for Lirium

When ChatGPT connects, it ingests the available tool definitions. Because Truto generates tools directly from the Lirium documentation records, the LLM receives highly accurate query and body schemas.

Here are the critical hero tools your AI agent uses to manage crypto operations.

list_all_lirium_exchange_rates

Retrieves real-time bid and ask prices for all supported cryptocurrencies on your partner account. Crucial for agents assessing market timing or calculating expected fiat equivalent values before placing orders.

Contextual usage notes: If your Lirium account utilizes multiple settlement accounts, the quote_currency parameter becomes mandatory. Otherwise, it defaults to your primary base.

"What is the current bid and ask price for BTC and ETH in USD on our Lirium account? Provide the spread percentage for both."

create_a_lirium_customer_document

Uploads KYC documentation to unblock user verification states. This is a complex endpoint that requires the file payload, document type classification, and formatting to meet Lirium's compliance engine requirements.

Contextual usage notes: The AI must supply the exact document_type (e.g., national_id, passport) and a supported file_type. The response updates the customer's data_requirements object to show the submission status.

"Upload this passport image for customer ID cust_987654. The document type is passport and the file type is image/jpeg. Check their data requirements afterward to confirm it moved to 'processing'."

create_a_lirium_customer_order

Executes a new crypto transaction for an end-user. This tool handles buys, sells, sends, receives, swaps, and investment subscriptions.

Contextual usage notes: The LLM must structure the asset sub-object correctly based on the operation type. Truto handles the schema translation, ensuring the LLM knows what fields are required for a swap versus a basic buy.

"Execute a buy order for customer ID cust_112233. Purchase 0.05 BTC using their USD available balance."

list_all_lirium_partner_authorizations

Fetches all orders (typically external sends or high-value withdrawals) that require explicit administrative approval before Lirium settles them on-chain.

Contextual usage notes: Use the authorization_state filter to narrow results to 'pending'. This tool returns the fee structure and destination details needed to make an informed approval decision.

"Pull all pending partner authorizations. For any send order under $500 equivalent, summarize the destination network and the transaction fee."

update_a_lirium_order_authorization_by_id

Approves or rejects a pending order that was flagged for partner authorization.

Contextual usage notes: Requires the customer_id, order_id, the specific authorization id, and the target state (approved or rejected).

"Approve the pending authorization auth_8899 for order ord_5566 belonging to customer cust_1234. Change its state to approved."

create_a_lirium_partner_order

Orchestrates a corporate-level transaction, most commonly a fiat withdrawal to sweep funds from your Lirium settlement account to an outside bank.

Contextual usage notes: This requires precise local banking data. The tool schema dynamically dictates whether the agent should pass ar_cvu (Argentina), mx_clabe (Mexico), or an address_book_item depending on the transfer type.

"Create a partner withdrawal order to sweep $50,000 USD to our corporate bank account. Use the whitelisted withdrawal destination ID wd_998877 as the target."

For the complete inventory of available Lirium tools, endpoints, and schema definitions, visit the Lirium integration page.

Workflows in Action

Connecting tools to ChatGPT transitions your operations from manual dashboard clicking to agentic workflows. Here is how a compliance officer and a treasury manager use these tools in reality.

Workflow 1: KYC Verification and Automated Approval

When a new user signs up and fails automated ID verification, an operations agent can use ChatGPT to review the account, upload the manual ID file, and monitor the compliance state.

"Look up customer reference 'user_998'. Check their missing data requirements. Upload the attached driver's license file to clear the requirement, and let me know if their overall state changes to active."

Step-by-step execution:

  1. list_all_lirium_customers: The agent queries the reference ID to find the internal customer_id and checks the data_requirements array to confirm the missing item.
  2. create_a_lirium_customer_document: The agent formats the provided file and pushes it to Lirium, tagging it as a driver's license.
  3. get_single_lirium_customer_by_id: The agent polls the customer record to verify that the state transitioned from pending to active based on the document processing.
sequenceDiagram
    participant ChatGPT as "ChatGPT (Client)"
    participant Truto as "Truto MCP Server"
    participant Lirium as "Lirium API"

    ChatGPT->>Truto: Call list_all_lirium_customers (ref: user_998)
    Truto->>Lirium: GET /customers?reference_id=user_998
    Lirium-->>Truto: Returns customer details & missing KYC
    Truto-->>ChatGPT: Returns data_requirements

    ChatGPT->>Truto: Call create_a_lirium_customer_document
    Truto->>Lirium: POST /customers/{id}/documents (multipart)
    Lirium-->>Truto: Returns document submission status
    Truto-->>ChatGPT: Confirms upload
    
    ChatGPT->>Truto: Call get_single_lirium_customer_by_id
    Truto->>Lirium: GET /customers/{id}
    Lirium-->>Truto: Returns updated state (Active)
    Truto-->>ChatGPT: Customer is unblocked

Workflow 2: Treasury Operations and Settlement Sweeps

A treasury manager needs to monitor their Lirium settlement balances and sweep excess fiat to their external corporate bank account, but only if the exchange rate conditions are optimal.

"Check our partner balance for USD. If the available balance exceeds $100,000, trigger a partner withdrawal order to sweep $50,000 to our primary US bank destination. Confirm the transaction ID when done."

Step-by-step execution:

  1. list_all_lirium_partner_balances: The agent checks the overarching corporate accounts and identifies the available_amount for USD.
  2. list_all_lirium_partner_withdrawal_destinations: The agent retrieves the whitelisted corporate bank accounts to find the ID for the "primary US bank" label.
  3. create_a_lirium_partner_order: Because the balance condition is met, the agent constructs the withdrawal payload, linking the destination ID and the $50,000 amount.
  4. The agent returns the generated partner order id and state to the user.

Security and Access Control

Exposing financial infrastructure to an LLM requires strict boundary setting. Truto's MCP servers are designed to limit blast radius at the token level, not just the network level.

  • Method Filtering: You can strictly limit an MCP server to read-only operations by passing methods: ["read"] during creation. This ensures ChatGPT can query exchange rates and view balances, but physically cannot invoke a create or update tool to move money.
  • Tag Filtering: Integrations support semantic tagging. You can restrict an MCP token to only expose tools tagged for compliance (KYC, documents) while hiding all trading or treasury operations.
  • Mandatory API Token Authentication: By enabling require_api_token_auth: true, possession of the MCP URL is no longer enough to execute a tool. The client must pass a valid Truto API session token, forcing human-in-the-loop identity validation.
  • Automatic Expiry: Temporary access should be ephemeral. Set expires_at to an ISO timestamp when generating the server. Once the deadline hits, the infrastructure's durable alarm system automatically purges the token from the distributed key-value store, permanently invalidating the URL.

Connecting ChatGPT to Lirium transforms a chat interface into a fully functional crypto operations terminal. By relying on a managed MCP server architecture, you bypass the punishing maintenance of fiat schemas, KYC multipart formatting, and authorization loops. Your AI agents gain immediate, structured access to trade execution and compliance routing, while your engineering team avoids writing a single line of integration boilerplate.

FAQ

How does Truto handle Lirium API rate limits for AI agents?
Truto passes upstream 429 rate limit errors directly to the calling agent. It normalizes the rate limit information into standardized IETF headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`). The AI agent or client framework is responsible for handling the retry and backoff logic.
Can I prevent ChatGPT from executing live crypto trades on Lirium?
Yes. When creating the Truto MCP server, you can set the `methods` filter to `["read"]`. This restricts the AI agent to querying data (like exchange rates and balances) and physically prevents it from invoking write tools like `create_a_lirium_customer_order`.
How do KYC document uploads work via the MCP server?
Truto automatically translates the `create_a_lirium_customer_document` endpoint into a structured MCP tool. The LLM is provided the exact schema required to format the multipart upload, including the necessary `document_type` and `file_type` parameters.
Do I have to re-authenticate the MCP server frequently?
The MCP server is authenticated by a secure, hashed token in the connection URL. Unless you explicitly configure an `expires_at` timestamp or enable `require_api_token_auth` for secondary validation, the URL remains active indefinitely for that specific integrated Lirium account.

More from our Blog