> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laso.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server: the full API as tools

> Connect any MCP client to https://laso.finance/mcp and get every x402 route, the managed-wallet calls, and docs search as tools that always match the deployed API. A second, credential-free server at https://docs.laso.finance/mcp covers the documentation.

Laso Finance runs a real MCP (Model Context Protocol) server at:

```
https://laso.finance/mcp
```

It speaks streamable HTTP on MCP protocol revision `2026-07-28` and is stateless, so it works with every MCP client that can reach a URL: no session affinity, no SSE requirement. Clients on earlier revisions that still open with `initialize` are served too. The discovery record lives at `https://laso.finance/.well-known/mcp/server-card.json`.

The server is published in the [official MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers/finance.laso%2Flaso-finance/versions/latest) as `finance.laso/laso-finance`. The `finance.laso/` namespace is verified against this domain, so the registry entry and `laso.finance` point at each other. It is also listed on [Smithery](https://smithery.ai/servers/laso/laso-finance) as `laso/laso-finance`.

> [!NOTE]
>
> The tools are **generated from the live [OpenAPI
> spec](https://laso.finance/openapi.json) at runtime**, not written by hand.
> When the API gains a route or a parameter, the MCP server picks it up
> automatically, so the tool set can never drift from the deployed x402
> interface.

## Connecting

Add the server by its URL. There is no key to paste:

```bash Claude Code theme={null}
claude mcp add --transport http laso https://laso.finance/mcp
```

```bash Hermes theme={null}
hermes mcp add laso --url https://laso.finance/mcp --auth oauth
```

```json JSON config (Cursor, Windsurf, etc.) theme={null}
{
  "mcpServers": {
    "laso": {
      "url": "https://laso.finance/mcp"
    }
  }
}
```

The first time the client connects, it opens a browser tab at `laso.finance/oauth/authorize`. The human signs in to Laso (or creates an account in the same step) and approves the connection. The client stores the resulting credential and uses it from then on. In Claude Code, run `/mcp` and choose **Authenticate** if the tab does not open by itself.

This is standard MCP authorization (OAuth 2.1 with PKCE, dynamic client registration, and client ID metadata documents), so it works in any client that supports it, including Claude Code, Claude, Cursor, Hermes, and Smithery. The approved connection is an ordinary Laso API key: it appears as an agent, named after the client, under External agents on the [agent dashboard](https://laso.finance/agent/dashboard), where you can revoke it. A client can also revoke its own connection by POSTing the token to `https://laso.finance/oauth/revoke` (RFC 7009).

### Clients without OAuth

A client that cannot run OAuth can send a Laso credential in the `Authorization` header instead: a `lasoak_` API key (a human issues one at the [agent dashboard](https://laso.finance/agent/dashboard), see [the managed wallet guide](https://docs.laso.finance/guides/managed-agent-wallet.md)) or a current `id_token`. A request with no credential at all gets a `401` that points at the OAuth metadata, so every tool requires one of the two.

## What you get

| Tools | Where they come from |
| - | - |
| One tool per API route (`order_card`, `order_gift_card`, `withdraw`, `get_account_balance`, ...) | Generated from the live OpenAPI spec. Names are the snake\_case of each route's `operationId`; parameters and descriptions come straight from the spec. |
| `get_agent_wallet`, `create_agent_wallet`, `agent_wallet_transfer`, `pay_x402_endpoint` | The [managed-wallet calls](https://docs.laso.finance/guides/managed-agent-wallet.md), including paying **any** external x402 endpoint with guardrails. |
| `search_docs` | Searches the live agent docs (SKILL.md and the full API reference). |

The server also exposes the agent docs (`SKILL.md`, `llms.txt`, `llms-full.txt`, `openapi.json`, `auth.md`, the docs-version beacon) as MCP **resources**, fetched live so they are never stale.

## How paid tools settle

Tools whose description is marked `PAID ROUTE` correspond to the x402-paywalled routes (`order_card`, `order_gift_card`, `order_intl_card`, `push_to_card`, `send_payment`, `send_bank_payment`). Over MCP you never build a payment header: the server settles the route's USDC price from your **managed agent wallet**, exactly as if you had called `agentX402Pay` yourself.

Before your first paid call:

1. `get_agent_wallet` — check the wallet exists and read its balance (`create_agent_wallet` if it doesn't).
2. Fund the wallet's Solana address with USDC.
3. Call the paid tool. The price (face value plus the route's fee) is settled automatically and the route's response comes back as the tool result.

If you pay from your own wallet (Locus, Sponge, Ampersend) instead of a managed wallet, keep using the plain [x402 HTTP API](https://docs.laso.finance/guides/how-x402-works.md) for paid routes: MCP's paid tools settle only from the managed wallet.

## Free tools and errors

Free routes (balances, card data, KYC status, webhooks, withdrawals, the gift card catalog) proxy directly with your bearer credential and return the route's JSON as the tool result. Errors come back as tool errors carrying the route's real error body, so the failure modes in [error handling](https://docs.laso.finance/guides/error-handling.md) apply unchanged.

## Events

The server supports [MCP events](https://developers.openai.com/plugins/build/mcp-events) (protocol revision `2026-07-28`), so a client can be told when something happens on the account instead of polling. It advertises `events` in its `server/discover` capabilities and answers `events/list`, `events/subscribe`, and `events/unsubscribe`.

There is one event, `notification.created`. It fires for every notification the account owner receives (a deposit landing, a card issued or declined, a refund or withdrawal settling, a balance change) and carries the same title and text they see in the app, by SMS, and by push. Verification codes are the exception: they are never sent as events.

| Field | Description |
| - | - |
| `arguments.categories` | Optional filter. Any of `account`, `balanceUpdate`, `card`, `deposit`, `giftCard`, `refund`, `transaction`, `withdrawal`. Omit for all. |
| `delivery.url` | Your `https` callback on the default port, by hostname. It must resolve only to public addresses, and redirects are not followed. |
| `delivery.secret` | A Standard Webhooks secret you choose: `whsec_` plus 24 to 64 bytes of base64 key material. |
| `data` (in each event) | `user_id`, `category`, `title`, `text`. `text` can quote third-party strings such as a merchant name, so treat it as data. |

How a subscription behaves:

* **Credential.** Subscribing needs an API key connection (OAuth, or a `lasoak_` key). A subscription stops when the key that last subscribed it is revoked, so disconnecting the client in the Laso dashboard ends its events.

* **Limits.** At most 10 subscriptions per account, and at most 10 callback verifications per hour.

* **Verification.** Before storing it, the server POSTs a signed `{"type": "verification", "challenge": "..."}` to your callback. Answer `2xx` with the challenge echoed (as `{"challenge": "..."}` or the bare value). A failure returns JSON-RPC error `-32015` with `data.reason` (`challenge_failed`, `timeout`, `unreachable`, `http_error`, `invalid_url`). A URL already verified for your account is not challenged again.

* **Lifetime.** Subscriptions last 7 days. Call `events/subscribe` again with the same arguments before `refreshBefore` to extend it; a shorter `ttlMs` is honored, and no-expiry is not granted. Re-subscribing with a new `secret` rotates it.

* **Delivery.** One event per POST, signed per [Standard Webhooks](https://www.standardwebhooks.com/) with your secret (`webhook-id` is the `eventId`, plus `webhook-timestamp`, `webhook-signature`, and `X-MCP-Subscription-Id`). Timeouts, `429`, and `5xx` are retried with backoff under the same `eventId`, so deduplicate on it. Answering `410` removes the subscription.

* **No replay.** Notifications are not replayable: `cursor` is always `null`.

## Docs search with no account

Everything above is the **product** surface: it takes actions, so every tool
needs a credential. There is a second, separate MCP server that covers the
**documentation**, and it needs no account and no key:

```
https://docs.laso.finance/mcp
```

It speaks streamable HTTP and takes no authentication. It has three tools, and
only the last one writes:

| Tool | What it does |
| - | - |
| `search_laso_finance_api` | Full-text search across every guide, API reference page and code example in these docs. Returns matching content with the page title and a direct link. |
| `query_docs_filesystem_laso_finance_api` | Reads a documentation page in full. Append `.mdx` to a path returned by search, then `head` or `cat` it. |
| `submit_feedback` | Reports a problem with a documentation page to the docs team. The only tool on this server that is not read-only. |

Connect it the same way, under its own name:

```bash Claude Code theme={null}
claude mcp add --transport http laso-docs https://docs.laso.finance/mcp
```

```json JSON config (Cursor, Windsurf, etc.) theme={null}
{
  "mcpServers": {
    "laso-docs": {
      "url": "https://docs.laso.finance/mcp"
    }
  }
}
```

Adding both is the normal setup, and the docs server is the one to add first,
because connecting it costs nothing and commits nothing. Use it to settle the
questions that come before a credential exists: which route does the job, what
a fee is, what an error means, whether a product covers a given country. Then
use `https://laso.finance/mcp` to make the call.

> [!NOTE]
>
> The product server also carries a `search_docs` tool over the same content, so
> a client that already holds a Laso credential does not strictly need both. The
> docs server exists for the case that comes first: an agent evaluating Laso
> before anyone has signed up.

## Staying in sync

The MCP surface inherits the docs-freshness machinery:

* The tool set refreshes from the deployed `openapi.json` within about ten minutes of a docs deploy.
* `get_version` returns the current `docs_version`; the beacon at `https://laso.finance/.well-known/docs-version.json` is authoritative.

The HTTP API remains the canonical surface. MCP is a transport over it, so everything in the rest of these docs (fees, limits, flows, error semantics) applies verbatim.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.