XRP Ledger MCP server

Provides direct access to XRP Ledger data and functionality, enabling querying account information, transaction history, and submitting signed transactions to the network.
Back to servers
Setup instructions
Provider
lgcarrier
Release date
Apr 06, 2025
Language
Python
Stats
6 stars

The XRPL MCP Server is a bridge that enables AI models like Claude and GPT to interact with the XRP Ledger through a standardized API interface. It allows AI assistants to retrieve account information, query transaction data, and even submit transactions to the XRP Ledger network.

Installation

Installing from Source

  1. Clone the repository and navigate to the project directory:

    git clone https://github.com/lgcarrier/xrpl-mcp-server.git
    cd xrpl-mcp-server
    
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    

Installing with pip

Alternatively, you can install the package directly using pip:

pip install xrpl-mcp-server

Configuration

The server uses the following environment variable for configuration:

  • XRPL_NODE_URL - The URL of the XRP Ledger node to connect to (defaults to "https://s1.ripple.com:51234/")

Running the Server

Running from Source

After installation, you can launch the server with:

python -m xrpl_mcp_server

Running as an Installed Package

If you installed via pip, simply run:

xrpl-mcp-server

Integration with AI Assistants

To use XRPL MCP Server with Claude or other MCP-compatible AI assistants:

  1. Install the MCP:

    mcp install xrpl-mcp-server
    
  2. Once installed, the XRPL tools become available to your AI assistant, allowing you to request XRP Ledger data directly.

Available Tools

Account Information

get_account_info

Retrieves basic information about an XRP Ledger account.

Parameters:

  • address (string): The XRP Ledger account address (starts with "r")

Returns:

  • Account balance in XRP
  • Account sequence number

get_account_lines

Retrieves trust lines for an XRP Ledger account.

Parameters:

  • address (string): The XRP Ledger account address
  • peer (string, optional): Address of a counterparty account to filter results
  • limit (integer, optional): Maximum number of trust lines to return

get_account_nfts

Retrieves NFTs owned by an XRP Ledger account.

Parameters:

  • address (string): The XRP Ledger account address
  • limit (integer, optional): Maximum number of NFTs to return

get_account_transactions

Retrieves transaction history for an account.

Parameters:

  • address (string): The XRP Ledger account address
  • limit (integer, optional): Maximum number of transactions to return
  • binary (boolean, optional): Return transactions in binary format (default False)
  • forward (boolean, optional): Search forward in ledger history (default False)

Server and Transaction Operations

get_server_info

Retrieves information about the connected XRP Ledger server.

Parameters: None

submit_transaction

Submits a signed transaction to the XRP Ledger.

Parameters:

  • tx_blob (string): The signed transaction blob in hexadecimal format

get_transaction_info

Retrieves details about a specific transaction.

Parameters:

  • transaction_hash (string): The hash of the transaction

get_book_offers

Retrieves order book offers for a currency pair on the decentralized exchange (DEX).

Parameters:

  • taker_gets (object): Currency the taker wants to receive
  • taker_pays (object): Currency the taker wants to pay
  • limit (integer, optional): Maximum number of offers to return

Usage Examples

Here are some examples of how to use the XRPL MCP Server with an AI assistant:

Checking an Account Balance

Ask the AI assistant:

What is the balance of the XRP account rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe?

The assistant will use the get_account_info tool to retrieve this information directly from the XRP Ledger and provide a response like:

Account: rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe
XRP Balance: 25.5
Sequence: 123456

Viewing NFTs in an Account

Ask the AI assistant:

What NFTs does account rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe own?

The assistant will use the get_account_nfts tool to retrieve this information from the XRP Ledger.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "xrpl-mcp-server" '{"command":"xrpl-mcp-server","args":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "xrpl-mcp-server": {
            "command": "xrpl-mcp-server",
            "args": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "xrpl-mcp-server": {
            "command": "xrpl-mcp-server",
            "args": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later