Connect Claude Code

Claude Code supports both authentication methods. Use OAuth for interactive work on your own
machine; use a machine token when you need a fixed environment, or when the client runs
unattended (scripts, CI).

Endpoint

https://mcp.lendapi.com/mcp

Option 1 — OAuth (recommended for interactive use)

Add the server:

claude mcp add --transport http lendapi https://mcp.lendapi.com/mcp/full

Claude Code loads tool definitions on demand, so it takes the full list at /mcp/full
(/mcp serves the smaller catalog meant for claude.ai, Claude Desktop and ChatGPT; both work).

Then authenticate:

  1. In Claude Code, run /mcp.
  2. Select lendapi.
  3. Choose the authenticate option. Your browser opens the LendAPI portal.
  4. Sign in (2FA and SSO are supported).
  5. On the consent screen, check the tenant name and click Allow access. One approval
    covers Live and Sandbox; every tool takes an optional environment argument and runs in
    Live unless asked for Sandbox.
  6. The browser returns control to Claude Code and the server shows as connected.

Nothing is stored in your project. Your first approval creates a dedicated API key per
environment on the tenant (LendAPI MCP (Live) · <your email> and LendAPI MCP (Sandbox) · <your email>) that you can
revoke from Admin Portal → API Settings.

Option 2 — Machine token in a header

claude mcp add --transport http lendapi https://mcp.lendapi.com/mcp \
  --header "Authorization: Bearer live_your_token_here"

The token decides both the tenant and the environment:

Token prefixEnvironment
live_Live
test_Sandbox

Create tokens in Admin Portal → Settings → Developer Settings → API settings → Add New Key.
See Authentication for the full procedure and the rules
about which environment a new key belongs to.

Keep the token out of your shell history and out of version control. Read it from your
environment instead:

claude mcp add --transport http lendapi https://mcp.lendapi.com/mcp \
  --header "Authorization: Bearer $LENDAPI_TOKEN"

Scopes: project vs. user

By default claude mcp add registers the server for the current project. To make it available
in every project on your machine, add a user scope:

claude mcp add --scope user --transport http lendapi https://mcp.lendapi.com/mcp

Use separate names for separate environments so you can tell them apart:

claude mcp add --transport http lendapi-live https://mcp.lendapi.com/mcp \
  --header "Authorization: Bearer $LENDAPI_LIVE_TOKEN"

claude mcp add --transport http lendapi-sandbox https://mcp.lendapi.com/mcp \
  --header "Authorization: Bearer $LENDAPI_TEST_TOKEN"

Verify

claude mcp list

Then in Claude Code:

List the decision workflows in my LendAPI tenant.

Managing the connection

# Inspect a single server's configuration
claude mcp get lendapi

# Remove it
claude mcp remove lendapi

To rotate a header token, remove the server and add it again with the new token. To change the
environment on an OAuth connection, remove it, add it again, and pick the other environment on
the consent screen.

Notes and limits

  • Workflow authoring works only on a Live connection. A sandbox token or a sandbox-approved
    OAuth connection can read applications, decisions, and products, but authoring tools are not
    yet supported there.
  • Action tools (app_update_stage, app_create_manual_offer, app_add_note) require a
    live-mode token.
  • Claude Code asks for permission before running a tool that writes. Approve those one at a
    time rather than granting a blanket allow.

Troubleshooting

SymptomWhat to do
401 on every callThe token is wrong, expired, or the key was switched off in API Settings.
403 on a specific toolThe token's tenant does not have access to that resource.
Authoring tools fail on a sandbox connectionExpected — use a Live connection to author.

More in Troubleshooting.

See also


Did this page help you?