LendMCP authentication and permissions
Every LendMCP request carries a credential that identifies your tenant and your environment.
There are two ways to supply it:
| Method | Best for | What you handle |
|---|---|---|
| OAuth | claude.ai, Claude Desktop, ChatGPT developer mode, Claude Code | Nothing — you sign in to the LendAPI portal and approve |
| Machine token | Claude Code, scripts, CI, other MCP clients | One token string, kept in a secret store |
Both methods end up at the same place: a request authenticated as one tenant, in one
environment, with the permissions that tenant already has.
Endpoint
https://mcp.lendapi.com/mcp
OAuth
What you see
- You paste the endpoint URL into your client and click Connect.
- The client finds LendMCP's authorization metadata and registers itself automatically. There
is no client ID or secret for you to create. - Your browser opens the LendAPI portal login. Sign in as you normally would — 2FA and SSO
are supported. If you are already signed in, you go straight to the next step. - A consent screen shows:
- the client that is asking, and the host it will return you to,
- your tenant name and the account you are signed in as,
- what the connection will be allowed to do,
- which environments it covers: Live and Sandbox, or Live only when your account has
no sandbox workspace yet.
- You click Allow access (or Cancel to abort).
- You are returned to the client, connected. Each tool call runs in Live unless the
assistant passesenvironment: sandbox; it names which one it used.
Signing in through the LendAPI portal is the only way to authorize an OAuth connection. If your
client can send request headers directly (for example a script or CLI), use
machine-token authentication instead of OAuth.
The dedicated API key
The first time you approve a connection for an environment, LendAPI creates a dedicated API
key on your tenant for you and that environment:
| Environment | Key name |
|---|---|
| Live | LendAPI MCP (Live) · [email protected] |
| Sandbox | LendAPI MCP (Sandbox) · [email protected] |
Facts worth knowing:
- It is created automatically, on your first approval, and reused on every later
re-authorization by you for that environment. Each user who approves gets their own key, so a
connection always carries the role of the person who approved it. - It requires an active paid plan. API access is part of the plan; if the tenant's plan does
not include it, the consent screen says so and no key is created. - It is visible in Admin Portal → Settings → Developer Settings → API settings, listed
by name alongside your other keys. - It is separate from every other key you use. MCP connections never ride on the key your
other integrations use, so revoking one never breaks the other. - It is your off switch. Switching the key off (or deactivating it) disconnects every client
that user authorized, immediately. Deactivating the user does the same.
Token lifetimes
| Token | Lifetime | Behavior |
|---|---|---|
| Access token | 8 hours | Refreshed silently by the client; you see nothing |
| Refresh token | 90 days, sliding | Every refresh issues a fresh pair, so a client in regular use stays connected indefinitely |
A connection only goes stale if it sits unused for 90 days. Then the client asks you to sign in
again. Restarting your machine or your client does not disconnect you.
Revoking OAuth access
Pick whichever fits:
| To do this | Do that |
|---|---|
| Disconnect one client, keep others | Remove the connector in that client |
| Disconnect one user's MCP clients on an environment, immediately | Switch off that user's LendAPI MCP (Live) · … or LendAPI MCP (Sandbox) · … key in Admin Portal → API Settings |
| Disconnect every MCP client on the tenant | Switch off every LendAPI MCP (…) key |
| Change environment on a connection | Disconnect the connector, add it again, pick the other environment |
Switching the dedicated key back on does not restore the old connections — reconnect the client.
Machine tokens
A machine token is a long-lived string you send as a header:
Authorization: Bearer live_your_token_here
Creating one
- Sign in to the LendAPI portal as an admin.
- Go to Settings → Developer Settings → API settings.
- Put the portal in the environment you want the key for — Live or Sandbox. This is
what decides the new key's environment. - Click Add New Key, give it a name that says where it will be used (for example
"Claude Code — Bob", "CI pipeline"), and submit. - Reveal the key with the eye icon, copy it with the copy icon, and store it in a secret
manager.
Creating keys requires an admin role and a plan that includes API access.
Prefixes and environment
| Prefix | Environment | Data |
|---|---|---|
live_ | Live | Production applications, products, and workflows |
test_ | Sandbox | Test applications and data |
The prefix is not decoration — it is how the platform routes the request. One token means one
tenant and one environment; a tool call that asks for the other environment gets a clear
validation error. To work in both environments from a header connection, create two tokens and
register two servers under different names — or connect with OAuth sign-in, which carries both.
Using one
Claude Code:
claude mcp add --transport http lendapi https://mcp.lendapi.com/mcp \
--header "Authorization: Bearer $LENDAPI_TOKEN"Any other MCP client:
{
"mcpServers": {
"lendapi": {
"type": "http",
"url": "https://mcp.lendapi.com/mcp",
"headers": {
"Authorization": "Bearer live_your_token_here"
}
}
}
}Rotating and revoking
- Rotate: create a new key, update the client to use it, then switch the old key off.
- Revoke: switch the key off in Admin Portal → API settings (the toggle in the Status
column). Requests using it start failing immediately with
Invalid or expired API token. - Name keys per consumer. One key per client or pipeline means you can cut off one consumer
without disturbing anything else.
What a connected client can do
Be clear-eyed about this before you approve a connection. A connected client, acting on your
prompts, can:
| Category | Effect |
|---|---|
| Read workflow configuration | List and inspect variables, outcomes, decision trees and their versions, and products |
| Author workflows | Create variables and outcomes, create and modify decision trees, submit versions, promote a version to default, and run a tree against test values |
| Read applications | Stage and status, computed variable values, provider results, decision outcomes, document statuses — always PII-filtered |
| Change applications | Approve, decline, request documents, withdraw; create a manual offer; add an underwriter note |
Boundaries that always hold:
- One tenant. The credential fixes the tenant. Tools do not accept a tenant parameter and
cannot reach another tenant's data. - One environment. Live and Sandbox never mix within a connection.
- No PII. Applicant names, SSNs, addresses, emails, phone numbers, and dates of birth are
stripped from application and provider responses before the assistant sees them. Raw provider
responses are never returned. - No credentials in output. Tools never echo tokens or upstream authentication details.
- Authoring works in both environments. Variables, outcomes, decision trees, products and
pages can be authored with a Sandbox key;variables_create_derivedis the one Live-only
write.
Actions are irreversible in the sense that matters: a stage change records an outcome, triggers
your webhooks, and writes to the application's history. Treat app_update_stage and
app_create_manual_offer as production changes.
Reducing what a client can do
- Turn tools off. Most clients let you disable individual tools on a connector. Disabling
app_update_stage,app_create_manual_offer, andapp_add_notegives you a read-only
underwriting assistant. - Approve writes one at a time. Keep your client's confirmation prompts on rather than
granting a blanket allow for write tools. - Use Sandbox for exploration. A sandbox connection cannot touch production applications.
- Use narrow tokens per consumer so revocation is surgical.
Auth errors
| Response | Meaning | Fix |
|---|---|---|
401 with a WWW-Authenticate challenge | No credential was sent, or the OAuth access token expired | OAuth clients start the sign-in flow automatically; header clients need a valid token |
{"error": "Invalid or expired API token", "status": 401} | LendAPI rejected the token — wrong value, or the key was switched off | Check the key in API Settings; rotate or reconnect |
{"error": "Token does not have access to this resource", "status": 403} | The token's tenant cannot reach that resource | Confirm you are on the right tenant and environment, and that the record belongs to it |
More detail in Troubleshooting.
See also
- Quickstart
- Per-client setup: claude.ai ·
Claude Desktop · Claude Code ·
ChatGPT · other clients - Tool reference
Updated about 14 hours ago

