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.
Clone the repository and navigate to the project directory:
git clone https://github.com/lgcarrier/xrpl-mcp-server.git
cd xrpl-mcp-server
Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Alternatively, you can install the package directly using pip:
pip install xrpl-mcp-server
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/")After installation, you can launch the server with:
python -m xrpl_mcp_server
If you installed via pip, simply run:
xrpl-mcp-server
To use XRPL MCP Server with Claude or other MCP-compatible AI assistants:
Install the MCP:
mcp install xrpl-mcp-server
Once installed, the XRPL tools become available to your AI assistant, allowing you to request XRP Ledger data directly.
Retrieves basic information about an XRP Ledger account.
Parameters:
address
(string): The XRP Ledger account address (starts with "r")Returns:
Retrieves trust lines for an XRP Ledger account.
Parameters:
address
(string): The XRP Ledger account addresspeer
(string, optional): Address of a counterparty account to filter resultslimit
(integer, optional): Maximum number of trust lines to returnRetrieves NFTs owned by an XRP Ledger account.
Parameters:
address
(string): The XRP Ledger account addresslimit
(integer, optional): Maximum number of NFTs to returnRetrieves transaction history for an account.
Parameters:
address
(string): The XRP Ledger account addresslimit
(integer, optional): Maximum number of transactions to returnbinary
(boolean, optional): Return transactions in binary format (default False)forward
(boolean, optional): Search forward in ledger history (default False)Retrieves information about the connected XRP Ledger server.
Parameters: None
Submits a signed transaction to the XRP Ledger.
Parameters:
tx_blob
(string): The signed transaction blob in hexadecimal formatRetrieves details about a specific transaction.
Parameters:
transaction_hash
(string): The hash of the transactionRetrieves order book offers for a currency pair on the decentralized exchange (DEX).
Parameters:
taker_gets
(object): Currency the taker wants to receivetaker_pays
(object): Currency the taker wants to paylimit
(integer, optional): Maximum number of offers to returnHere are some examples of how to use the XRPL MCP Server with an AI assistant:
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
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.
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.
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.
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": []
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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