Connect Lirium to Claude: Monitor Rates, Investments, and Balances
A definitive engineering guide to generating a secure Lirium MCP server and connecting it to Claude for automated crypto, fiat, and investment workflows.
If you are building autonomous workflows to monitor cryptocurrency rates, track customer investment portfolios, or manage fiat balances, you need to connect Lirium to Claude. The bridge that makes this possible is a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's natural language tool calls and Lirium's strictly typed REST endpoints. You can either build, host, and maintain this stateful middleware yourself, or use a managed platform like Truto to dynamically generate a secure MCP server URL. If your team uses ChatGPT instead, check out our sibling guide on connecting Lirium to ChatGPT, or explore broader multi-agent architectures in our post on connecting Lirium to AI Agents.
Giving a Large Language Model (LLM) direct read and write access to a live financial infrastructure ecosystem is high stakes. You have to handle complex KYC schemas, enforce strict contextual boundaries between Partner and Customer resources, and manage API quotas perfectly. Every time Lirium updates an endpoint or deprecates a fiat rail, you have to rewrite your server's JSON schemas and redeploy. This guide breaks down exactly how to bypass that boilerplate, generate a secure managed MCP server for Lirium, connect it natively to Claude, and execute complex trading and monitoring workflows.
The Engineering Reality of the Lirium API
A custom MCP server is essentially a self-hosted integration proxy. While Anthropic's open MCP standard dictates how Claude discovers tools, the reality of executing those tools against Lirium's specific API surface requires managing a lot of vendor-specific friction.
If you decide to build a custom MCP server for Lirium, you own the entire integration lifecycle. Here are the specific engineering challenges you will encounter:
The Partner vs. Customer Dichotomy
Lirium's API structure is heavily bifurcated. There are global "Partner" endpoints (like getting whitelisted withdrawal destinations or checking overall liquidity) and scoped "Customer" endpoints (placing orders, checking individual balances, submitting KYC documents). If you expose these raw endpoints to an LLM without strict boundary enforcement, the model will inevitably try to pass a customer_id to a partner-level endpoint, or vice versa, resulting in HTTP 400 errors. A proper MCP server must cleanly separate these contexts and enforce required parameters before the request ever hits Lirium.
Complex Nested KYC and Profiling Schemas
Creating or updating a customer in Lirium is not a simple flat JSON payload. The API requires deeply nested objects defining the profile (with specific identity requirements based on jurisdiction) and data_requirements. Writing the JSON schemas for Claude to understand exactly which fields are required for a Business account vs an Individual account in Argentina vs the EU is tedious and brittle. A managed MCP platform automatically parses Lirium's documentation and provides these schemas to the model natively.
Transparent Rate Limiting
Lirium enforces strict API quotas to prevent abuse on their trading infrastructure. When you hit a rate limit, the API returns a 429 Too Many Requests. Truto does not retry, throttle, or apply backoff on rate limit errors. This is a critical architectural decision for financial data: silent retries can cause race conditions or duplicate order executions. Instead, when Lirium returns a 429, Truto passes that error directly to the caller and normalizes the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). Your AI agent is responsible for reading these headers, waiting for the reset window, and retrying safely.
How to Generate a Lirium MCP Server with Truto
Truto dynamically generates MCP servers based on the live configuration of your connected Lirium account. Tools are not pre-compiled; they are generated on the fly by combining Lirium's available API resources with human-readable documentation records. This ensures that Claude only sees curated, AI-ready endpoints.
You can create an MCP server either through the Truto UI or programmatically via the API.
Method 1: Via the Truto UI
If you are configuring Claude Desktop for personal or internal team use, the UI is the fastest path.
- Navigate to your Truto dashboard and go to the Integrated Accounts page.
- Select your connected Lirium account.
- Click on the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration (e.g., restrict to
readmethods to prevent accidental trades). - Copy the generated MCP Server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4...).
Method 2: Via the Truto API
If you are programmatically provisioning AI workspaces for your users, you can generate MCP servers on demand. The API validates your request, generates a cryptographically hashed token, and provisions the server URL instantly.
Make a POST request to /integrated-account/:id/mcp:
const response = await fetch('https://api.truto.one/integrated-account/<LIRIUM_ACCOUNT_ID>/mcp', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TRUTO_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Lirium Trading Analytics Agent",
config: {
methods: ["read"], // Highly recommended for monitoring-only agents
tags: ["crypto", "investments"]
},
expires_at: "2026-12-31T23:59:59Z"
})
});
const data = await response.json();
console.log(data.url); // The MCP server URLBecause the resulting URL contains a secure cryptographic token tied directly to that specific Lirium tenant, it is entirely self-contained. No further auth is needed from the client by default.
How to Connect the MCP Server to Claude
Once you have your Truto MCP URL, connecting it to your AI client takes seconds.
Approach A: Via the Claude UI (or ChatGPT)
If you are using Claude's web interface (Enterprise/Team plans) or ChatGPT:
- Open Settings -> Integrations (or Connectors in ChatGPT).
- Select Add Custom Connector (or Add MCP Server).
- Paste the Truto MCP URL.
- Click Add. The client will immediately execute a
tools/listhandshake and discover the Lirium capabilities.
Approach B: Via the Claude Desktop Config File
If you are a developer using Claude Desktop, you manage MCP servers via your local JSON configuration file. Truto provides a Server-Sent Events (SSE) transport adapter that bridges Claude's standard stdio requirement to Truto's REST infrastructure.
Open your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add the Lirium server configuration:
{
"mcpServers": {
"lirium_crypto_ops": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/YOUR_SECURE_TOKEN"
]
}
}
}Restart Claude Desktop. The model now has full access to the Lirium tools based on the filters you applied.
Security and Access Control
Exposing financial infrastructure to an LLM requires strict governance. Truto MCP servers provide native, infrastructure-level controls:
- Method Filtering (
config.methods): Restrict the server to specific HTTP verbs or categories. Passing["read"]ensures the agent can query exchange rates and balances but physically cannot execute a POST request to create an order. - Tag Filtering (
config.tags): Scope the server by functional domain. You can restrict an agent to only see endpoints tagged withcomplianceto handle KYC, completely hiding trading endpoints. - Expiration Limits (
expires_at): Create short-lived MCP URLs for temporary audits. Once the timestamp passes, the distributed storage layer drops the token, neutralizing the URL immediately. - Layered Authentication (
require_api_token_auth): By default, the cryptographically secure MCP URL is sufficient to connect. If your team shares URLs in logs, enablerequire_api_token_auth: true. This forces the client to pass a valid Truto API token in the Authorization header to actually execute a tool.
Lirium MCP Hero Tools
Truto translates Lirium's API into dozens of distinct MCP tools. Here are the highest-leverage tools for financial automation.
list_all_lirium_exchange_rates
Retrieves the current market exchange rates for all supported cryptocurrencies on the Lirium platform. It returns ask and bid prices, which is essential before calculating order sizes.
"Check the current exchange rates for Bitcoin and Ethereum against USD in Lirium. Tell me the current ask price for both."
get_single_lirium_customer_by_id
Retrieves the complete profile of a specific Lirium customer, including their identity verification (KYC) state, available products, and any missing data requirements blocking them from trading.
"Pull the profile for customer ID 'cust_892nf92'. Are they fully verified to trade, or are there pending data requirements?"
list_all_lirium_customer_accounts
Fetches the per-currency account balances for a specific customer. Crucially, this returns both the total amount and the available_amount (excluding funds locked in pending orders).
"What is the available balance in USDC and BTC for customer 'cust_892nf92'? Ignore funds currently locked in pending limit orders."
list_all_lirium_investments_rates
Lists the current Annual Percentage Yield (APY) and Annual Percentage Rate (APR) for available investment and staking instruments. Useful for automated portfolio advisory agents.
"List all currently available investment instruments in Lirium. Which asset currently offers the highest APY?"
list_all_lirium_customer_investments
Retrieves the active investments for a specific customer, showing the invested amount, unrealized PnL, PnL percentage, and net fee details.
"Get the active investment portfolio for customer 'cust_892nf92'. What is their current PnL percentage across all assets?"
create_a_lirium_customer_order
Executes a new order on behalf of a Lirium customer. Depending on the payload, this can handle buys, sells, sends, or investment subscriptions.
"The customer wants to buy $500 USD worth of Bitcoin at market price. Draft the tool call to create a buy order for customer 'cust_892nf92' using their USD fiat balance."
For the complete schema definitions and the full list of available tools - including webhook management, historical prices, and partner archives - check out the Lirium integration page.
Workflows in Action
How does an LLM actually string these tools together to execute complex financial operations? Here are two real-world scenarios.
Scenario 1: Customer Portfolio and Rate Advisory
A VIP support agent needs to summarize a customer's active positions and recommend if they should move stagnant fiat into an investment product based on current rates.
User: "Analyze the portfolio for customer ID 'cust_4029x'. Look at their fiat balances, check current investment rates, and draft an email suggesting how they might allocate any idle USD into a high-yield product."
Step-by-step execution:
get_single_lirium_customer_by_id: Claude calls this to confirm the customer's account state is active and that they are eligible for investment products.list_all_lirium_customer_accounts: Claude fetches current balances, noting the customer has $15,000 inavailable_amountfor USD.list_all_lirium_customer_investments: Claude checks existing investments to understand their current risk exposure and PnL.list_all_lirium_investments_rates: Claude queries the global APY rates, discovering that a stablecoin (USDC) staking product is yielding 6.5%.- Synthesize: Claude writes the email, referencing the specific $15,000 idle balance and the exact 6.5% APY data retrieved live from Lirium.
sequenceDiagram
participant User
participant Agent as "AI Agent (Claude)"
participant MCP as "Truto MCP Server"
participant Lirium
User->>Agent: "Analyze portfolio for cust_4029x..."
Agent->>MCP: Call list_all_lirium_customer_accounts
MCP->>Lirium: GET /customers/cust_4029x/accounts
Lirium-->>MCP: Returns balances ($15,000 USD)
MCP-->>Agent: JSON balance data
Agent->>MCP: Call list_all_lirium_investments_rates
MCP->>Lirium: GET /investments/rates
Lirium-->>MCP: Returns APYs (USDC 6.5%)
MCP-->>Agent: JSON rate data
Agent-->>User: Delivers customized advisory emailScenario 2: Automated Order Execution and Confirmation
An internal treasury bot is instructed to liquidate a specific asset for a customer based on market conditions, requiring a two-step create-and-confirm process.
User: "Customer 'cust_1120a' requested to sell exactly 0.5 ETH to USD. Check the current exchange rate, create the sell order, and if it succeeds, confirm the order."
Step-by-step execution:
list_all_lirium_exchange_rates: Claude checks the ETH/USD bid price to calculate the expected fiat return.list_all_lirium_customer_accounts: Claude verifies the customer actually has 0.5 ETH in theiravailable_amount.create_a_lirium_customer_order: Claude executes the tool call, specifying theoperationas "sell",assetas ETH, andamountas 0.5. Lirium returns a pending order object with anorder_id.create_a_lirium_order_confirm: Because Lirium requires explicit confirmation for certain operations, Claude immediately uses the newly acquiredorder_idto call the confirmation tool.- Synthesize: Claude responds to the user, confirming the order execution, the final exchange rate utilized, and the resulting fiat amount expected to settle.
Moving Fast in Financial Tech
Building AI agents that interact with crypto and fiat infrastructure requires an obsessive focus on reliability and security. You cannot afford to hallucinate API payloads or mismanage OAuth tokens.
By leveraging Truto to generate your Lirium MCP servers, you eliminate the integration boilerplate. Your agents get immediate access to clean, fully-documented schemas for KYC data, investment rates, and order execution - perfectly normalized and continuously updated. Instead of spending weeks wrestling with Lirium's API documentation and pagination quirks, you can focus on building intelligent trading algorithms and automated support workflows.
FAQ
- How does the Lirium MCP server handle API rate limits?
- Truto does not absorb or retry rate limit errors. When the Lirium API returns a 429 Too Many Requests error, Truto passes the error directly to the caller, normalizing the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). Your AI agent or framework must handle its own backoff and retry logic.
- Can I restrict the Claude agent to read-only access for Lirium?
- Yes. When creating the MCP server via Truto, you can configure method filtering by passing 'methods': ['read']. This ensures the agent can only list rates, investments, and balances, completely blocking it from creating orders or modifying customer data.
- Do I have to write custom JSON schemas for Lirium API endpoints?
- No. Truto dynamically generates MCP-compliant tool definitions, complete with query and body schemas, directly from the authenticated Lirium integration. The schemas are injected into the MCP server in real-time.