Skip to main content

Overview

Claude Code can interact with the Laso Finance API using an x402-enabled MCP server. The MCP server wraps the x402 payment flow so Claude can call paywalled endpoints like any other tool.

Prerequisites

Setup

1. Install the x402 MCP server

The x402 project provides an MCP server that handles payment signing automatically.

2. Configure Claude Code

Add the x402 MCP server to your Claude Code configuration. Create or edit your MCP config file:

3. Use it

Once configured, Claude Code can call Laso Finance endpoints directly. The MCP server handles the x402 payment flow automatically.

How it works

  1. Claude Code calls the MCP server’s tool for the desired endpoint
  2. The MCP server makes an HTTP request to laso.finance
  3. If the server returns 402, the MCP server signs a USDC payment with your wallet
  4. The MCP server retries with the X-PAYMENT header
  5. The response is returned to Claude Code

Example prompts

Building your own MCP server

If you need custom behavior, you can build an MCP server using @x402/axios:

x402 MCP Example

Full MCP server example from the x402 repository.