Connect LendingWise to ChatGPT: Manage Loans, Properties and Members
A complete engineering guide to generating a managed MCP server for LendingWise, connecting it to ChatGPT, and automating loan file management using AI agents.
If you need to connect LendingWise to ChatGPT to automate loan origination, manage broker assignments, or audit property collateral, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's native function calls and LendingWise's specific REST architecture. You can either spend weeks building and hosting 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 LendingWise to Claude or explore our broader architectural overview on connecting LendingWise to AI Agents.
Giving a Large Language Model (LLM) read and write access to a specialized Loan Origination System (LOS) like LendingWise is a serious engineering challenge. You have to handle rigid pipeline status schemas, complex relational payloads for borrowers and properties, and highly specific endpoint requirements. Every time an API schema drifts or a custom field is introduced, your custom server code must be updated, tested, and redeployed.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for LendingWise, connect it natively to ChatGPT, and execute complex lending 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 LendingWise 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 those tools against LendingWise's highly domain-specific API requires deep integration logic.
If you decide to build a custom MCP server for LendingWise, you own the entire API lifecycle. Here are the specific integration challenges you must solve:
The Merge-Patch Update Paradigm
LendingWise utilizes a strict merge-patch methodology for updating loan files. When calling update_a_lending_wise_loan_by_id, every field is optional. If you pass a field, it overwrites the existing value; if you omit a field, it remains untouched. If your custom MCP server forces the LLM to provide a full payload on update, you risk nullifying critical data like borrower contact info or broker assignments. Your JSON schemas must meticulously define all fields as optional while retaining their strict type constraints.
Moving Loans Through the Pipeline (primaryStatusId)
You cannot simply pass a string like "Underwriting" to change a loan's status. LendingWise requires a specific primaryStatusId (and often a sub-status ID) to move a file through the pipeline. Your AI agent must know how to first query list_all_lending_wise_loan_primary_statuses to resolve the human-readable status into the exact numeric ID configured for that specific company and loan type before attempting an update.
Complex Relational Assignments
LendingWise treats the loan file as the central hub, but properties, brokers, loan officers, and back-office employees all require distinct relational operations. For example, adding properties requires sending an array of objects where exactly one property must be marked with isPrimary: true. If the LLM generates a payload with zero primary properties or two primary properties, the API will reject the request. Similarly, employee assignments are absolute: when replacing employees, sending an empty array removes everyone, and including a single invalid ID rejects the entire transaction.
Rate Limits and Error Handling
When exposing APIs to autonomous agents, managing throughput is critical. LLMs can easily trigger rate limit errors (HTTP 429) if they execute loop-based tool calls across large datasets.
Crucial Architectural Note: Truto does not automatically retry, throttle, or apply backoff on rate limit errors. When the upstream LendingWise API returns an HTTP 429 Too Many Requests, Truto passes that error directly through to the caller (your LLM client).
Truto normalizes the upstream rate limit information into standardized headers per the IETF specification (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The caller - whether that is your LangGraph orchestration layer or the native ChatGPT client - is entirely responsible for reading these headers and implementing its own retry logic and exponential backoff. Do not rely on the MCP gateway to absorb these errors.
Generating the LendingWise MCP Server
Truto handles the complexities of schema generation and authentication by deriving MCP tools directly from integration resource definitions.
Before you start, you must connect a LendingWise account in Truto (via OAuth or API Key) to generate an integrated_account_id. Once connected, you can generate an MCP server mapped specifically to that account using either the Truto UI or the API.
Method 1: Generating via the Truto UI
For quick prototyping or manual setup:
- Log into your Truto dashboard.
- Navigate to the Integrated Accounts page and select your connected LendingWise account.
- Click on the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration (e.g., name the server "LendingWise ChatGPT Ops", apply method filters like
readorwrite, and set any tag filters). - Click Save and copy the generated MCP server URL. It will look like
https://api.truto.one/mcp/<token>. Treat this URL as a secure credential.
Method 2: Generating via the Truto API
For production deployments, you can provision MCP servers programmatically. This scopes a unique JSON-RPC endpoint to a specific tenant's connected account.
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": "LendingWise Loan Management",
"config": {
"methods": ["read", "write"],
"tags": ["loans", "properties", "members"]
},
"expires_at": null
}'The response will contain a url field. This URL handles protocol routing and authentication inherently - no extra headers are needed unless you explicitly configure secondary authentication.
Connecting the MCP Server to ChatGPT
Once you have your Truto MCP Server URL, you must register it with your LLM client. There are two primary ways to do this depending on your environment.
Method A: Connecting via the ChatGPT UI
If you are using ChatGPT Pro, Plus, Enterprise, or Education accounts, you can connect the server natively in the browser or desktop app.
- Open ChatGPT and navigate to Settings -> Apps -> Advanced settings.
- Enable the Developer mode toggle (MCP support is gated behind this setting).
- Under the MCP servers / Custom connectors section, click to add a new server.
- Enter a descriptive name (e.g., "LendingWise Integration").
- Paste your Truto MCP Server URL into the Server URL field and save.
ChatGPT will immediately ping the server's initialize endpoint, perform a handshake, and retrieve the list of available LendingWise tools.
Method B: Connecting via Manual Configuration File
If you are running a headless agent, using the Claude Desktop app, or utilizing a local dev framework like Cursor, you configure the connection using a JSON file to wrap the Server-Sent Events (SSE) transport.
Create an mcp.json or smithery.yaml config file in your project:
{
"mcpServers": {
"lendingwise_truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/<YOUR_TRUTO_TOKEN>"
]
}
}
}When your agent boots, it executes the wrapper to establish the JSON-RPC connection over HTTP, translating local tool calls into Truto proxy requests.
Hero Tools for LendingWise Automation
Once connected, Truto exposes LendingWise resources as strictly typed tools. The LLM automatically understands the parameters based on the derived JSON schema.
Here are the core high-leverage tools available for orchestrating LendingWise data.
list_all_lending_wise_loans
Fetches a summary of loan files. The LLM can pass optional filters for brokers, borrowers, or loan officers. The response includes critical metadata like id, loanNumber, and primaryStatusId, making it the starting point for most workflows.
"Find the last 25 loan files assigned to loan officer ID 405 and list their primary status IDs."
create_a_lending_wise_loan
Creates a new loan file. The LLM must provide the required attributes: branchID, fileType, loanProgram, primaryStatusId, and the borrower object. This tool returns the new loan record containing the unique id needed for subsequent relational operations.
"Create a new commercial loan file for borrower John Doe under branch ID 12. Set the program to STCode 'FIXFLIP' and put it in primary status ID 5."
update_a_lending_wise_loan_by_id
Executes a merge-patch update against a specific loan file. Because every field is optional, the LLM will only pass the fields it intends to change, such as moving a loan to a new pipeline stage or updating borrower contact details.
"Update loan ID 8902 to reflect the new pipeline stage by changing its primary status ID to 8, and update the borrower's email to new.address@example.com."
lending_wise_loans_add_properties
Attaches subject or collateral properties to an existing loan file. The agent must format the payload to include exactly one property with isPrimary: true. The primary property's address is then mirrored onto the main loan file by the upstream API.
"Add two collateral properties to loan ID 8902: 123 Main St (mark this as primary) and 456 Oak Ave (not primary)."
lending_wise_loans_assign_broker
Links a broker profile to a specific loan file. The LLM must pass the loan_id and the brokerId. The tool returns the updated broker profile currently active on the loan.
"Assign broker ID 774 to loan ID 8902."
lending_wise_loans_replace_employees
Replaces the entire list of back-office employees working on a loan file. The agent provides an array of employeeIds. If the LLM sends an empty array, all employees are removed.
"Update the back-office staff for loan ID 8902 so that only employees 45 and 92 are assigned to it."
To view the exact JSON schemas, required parameters, and the complete list of available tools, review the LendingWise integration page.
Workflows in Action
When you give ChatGPT these tools, it stops acting as a basic text generator and becomes an active participant in your lending operations. It chains together JSON responses to execute complex, multi-step workflows.
Scenario 1: Loan Origination and Collateral Setup
A loan officer receives an email with details for a new fix-and-flip project and asks the agent to originate the file and attach the property.
"Create a new fix-and-flip loan for borrower Alice Smith under branch 10, put it in status 2. Then, attach the property at 789 Pine Lane as the primary collateral, and assign broker ID 105."
How the agent executes this:
- Create the file: Calls
create_a_lending_wise_loanpassing the borrower object,branchID: 10, andprimaryStatusId: 2. LendingWise returns the newid(e.g.,4041). - Add property: Extracts the new loan ID and calls
lending_wise_loans_add_propertieswith{ "loan_id": "4041", "properties": [{ "address": "789 Pine Lane", "isPrimary": true }] }. - Assign broker: Calls
lending_wise_loans_assign_brokerwithloan_id: 4041andbrokerId: 105.
sequenceDiagram
participant User as User (ChatGPT)
participant Truto as Truto MCP
participant Upstream as Upstream API (LendingWise)
User->>Truto: Call create_a_lending_wise_loan
Truto->>Upstream: POST /loans
Upstream->>Truto: 201 Created (id: 4041)
Truto->>User: Returns loan ID 4041
User->>Truto: Call lending_wise_loans_add_properties (id: 4041)
Truto->>Upstream: POST /loans/4041/properties
Upstream->>Truto: 201 Created
Truto->>User: Returns property success
User->>Truto: Call lending_wise_loans_assign_broker (id: 4041)
Truto->>Upstream: POST /loans/4041/broker
Upstream->>Truto: 200 OK
Truto->>User: Returns assigned brokerScenario 2: Pipeline Movement and Staff Reallocation
A manager wants to move a stalled loan file forward and rotate the processing staff to fresh eyes.
"Find loan number LNW-8899. Move its primary status to ID 9 (Processing). Then remove the current back-office staff and assign employees 14 and 22 instead."
How the agent executes this:
- Search for the loan: Calls
list_all_lending_wise_loansfiltering byloanNumber: "LNW-8899". The tool returns the record, revealing its numeric databaseid(e.g.,5521). - Update status: Calls
update_a_lending_wise_loan_by_idpassingid: 5521andprimaryStatusId: 9. - Reallocate staff: Calls
lending_wise_loans_replace_employeespassingloan_id: 5521andemployeeIds: [14, 22].
The manager receives confirmation that the file has moved to processing and the new team has been successfully assigned.
Security and Access Control
Providing an LLM with write access to financial origination software requires stringent security boundaries. Truto MCP servers enforce configuration rules at the protocol edge before requests ever hit the proxy API.
- Method Filtering: Use
config.methodsduring server creation to restrict operations. Passing["read"]ensures the agent can only list and get records, entirely blocking create, update, and delete calls at the tool generation level. - Tag Filtering: Use
config.tagsto limit the server's scope to specific functional areas. For example, applying["loans", "brokers"]hides tools related to configuration, employees, or branches from the LLM. - Secondary Authentication (
require_api_token_auth): By default, an MCP server URL acts as a bearer token. By enablingrequire_api_token_auth: true, you force the client to pass a valid Truto API token in the Authorization header. This guarantees that possessing the URL alone is insufficient for access. - Auto-Expiration (
expires_at): You can set an ISO timestamp to automatically expire the MCP server. When the time is reached, cloud infrastructure automatically revokes the URL and deletes the associated configuration, perfect for granting temporary agent access to a third-party consultant. - Infrastructure Isolation: Each MCP server is strictly scoped to a single
integrated_account_id. It is mathematically impossible for an agent interacting with one company's LendingWise account to query or mutate data belonging to another tenant.
Rethinking Agent Connectivity
Connecting ChatGPT to LendingWise isn't about writing a few API calls; it's about translating complex relational mechanics, strictly typed IDs, and merge-patch paradigms into a format an LLM can safely ingest and execute.
Building that translation layer manually forces your engineering team into a perpetual cycle of maintenance, schema mapping, and error handling. By leveraging a documentation-driven MCP architecture, you shift from writing fragile point-to-point integration code to orchestrating secure, scalable AI workflows instantly.
FAQ
- Does Truto automatically retry rate-limited requests to LendingWise?
- No. Truto does not retry, throttle, or apply backoff on rate limit errors. When the LendingWise API returns an HTTP 429, Truto passes that error directly to the caller, normalizing the upstream rate limit info into standardized IETF headers. Your agent or client is responsible for handling retries.
- Can I restrict which LendingWise endpoints ChatGPT can access?
- Yes. When creating the MCP server in Truto, you can use method filtering (e.g., allowing only 'read' operations) and tag filtering (e.g., allowing only 'loans' or 'brokers') to strictly control the AI agent's access.
- How do I connect the MCP server to ChatGPT?
- You can connect via the ChatGPT UI (Settings -> Connectors -> Add) or configure a local client for headless testing using a JSON config file and the @modelcontextprotocol/server-sse command.