License: MIT | XRPL Networks | TypeScript | xrpl.js A comprehensive Model Context Protocol (MCP) server that provides blockchain services for the XRP Ledger ecosystem. This server enables AI agents to interact with XRPL MainNet, TestNet, and DevNet with a unified interface. - Overview - Features - Supported Networks - Prerequisites - Installation - Server Configuration - API Reference
Add this skill
npx mdskills install RomThpt/mcp-xrplComprehensive XRPL MCP server with extensive blockchain tools and clear documentation
1# XRP Ledger Model Context Protocol Server23[](https://glama.ai/mcp/servers/%40RomThpt/mcp-xrpl)45License: MIT | XRPL Networks | TypeScript | xrpl.js67A comprehensive Model Context Protocol (MCP) server that provides blockchain services for the XRP Ledger ecosystem. This server enables AI agents to interact with XRPL MainNet, TestNet, and DevNet with a unified interface.89## ๐ Contents1011- [Overview](#-overview)12- [Features](#-features)13- [Supported Networks](#-supported-networks)14- [Prerequisites](#๏ธ-prerequisites)15- [Installation](#-installation)16- [Server Configuration](#๏ธ-server-configuration)17- [Usage](#-usage)18- [API Reference](#-api-reference)19- [Security Considerations](#-security-considerations)20- [Project Structure](#-project-structure)21- [Development](#๏ธ-development)22- [License](#-license)2324## ๐ญ Overview2526The MCP XRPL Server leverages the Model Context Protocol to provide XRP Ledger services to AI agents. It supports a wide range of services including:2728- Reading ledger state (balances, transactions, account info, etc.)29- Interacting with smart contracts (via Hooks)30- Transferring XRP and issued tokens31- Querying token metadata and balances32- Managing decentralized identifiers (DIDs)33- Working with NFTs on the XRPL34- Automated Market Maker (AMM) operations35- Payment channels, escrows, and checks36- Oracle data operations37- Trustline management3839All services are exposed through a consistent interface of MCP tools and resources, making it easy for AI agents to discover and use XRPL functionality.4041## โจ Features4243### Account Management4445- Connect to XRPL networks (MainNet, TestNet, DevNet)46- Account information retrieval47- Account property management48- Deposit preauthorization49- Regular key management5051### XRP and Token Operations5253- Transfer XRP between accounts54- Get token metadata (name, symbol, decimals, supply)55- Check token balances56- Transfer tokens between addresses57- Approve token spending58- Token clawback5960### NFT Operations6162- Mint NFTs on the XRP Ledger63- View NFT metadata64- Verify NFT ownership65- Transfer NFTs between addresses66- Get NFT collections6768### Decentralized Identifier (DID)6970- Create DIDs on the XRPL71- Resolve DIDs72- Update DID documents73- Deactivate DIDs7475### AMM Operations7677- Create Automated Market Makers78- Deposit to AMMs79- Place bids on AMMs80- Vote on AMM parameters81- Delete AMMs82- Clawback assets from AMMs8384### Check Operations8586- Create checks87- Cash checks88- Cancel checks8990### Offer/DEX Operations9192- Create offers93- Cancel offers9495### Oracle Operations9697- Set oracle data98- Delete oracle data99100### Payment Channels101102- Create payment channels103- Fund payment channels104- Claim from payment channels105106### Escrow107108- Create escrows109- Finish escrows110- Cancel escrows111112### Trustlines113114- Set and manage trustlines115116### Ticketing117118- Create tickets for transaction processing119120## ๐ Supported Networks121122- **MainNet**: Production XRP Ledger network123- **TestNet**: Test network for development124- **DevNet**: Development network for experimental features125126## ๐ ๏ธ Prerequisites127128- Node.js 18.0.0 or higher129130## ๐ฆ Installation131132```bash133# Clone the repository134git clone https://github.com/yourusername/mcp-xrpl.git135cd mcp-xrpl136137# Install dependencies138npm install139140# Build the project141npm run build142```143144## โ๏ธ Server Configuration145146Create a `.env` file in the project root with the following variables:147148```149# Optional: XRPL wallet seed for automatic connection150# If not provided, you can connect using the connect-to-xrpl tool151DEFAULT_SEED=sEdVoKkRRF8RsNYZ689NDeMyrijiCbg # Example - replace with your own or remove152153# Network selection (default is "testnet")154XRPL_NETWORK=testnet # Options: mainnet, testnet, devnet155```156157## ๐ Usage158159### Starting the Server160161```bash162# Start the server in stdio mode (for CLI tools)163npm start164```165166### Connecting to the Server167168Connect to this MCP server using any MCP-compatible client. For testing and debugging, you can use the MCP Inspector.169170## ๐ API Reference171172### Tools173174The server provides the following MCP tools for agents:175176#### Account Management177178| Tool Name | Description | Key Parameters |179| ------------------------ | ---------------------------------- | -------------------------------- |180| `connect-to-xrpl` | Connect to XRP Ledger using a seed | seed, network |181| `get-account-info` | Get account information | address, network |182| `delete-account` | Delete an XRPL account | privateKey, destination, network |183| `set-account-properties` | Set account properties | privateKey, properties, network |184| `deposit-preauth` | Preauthorize a deposit | privateKey, authorize, network |185| `set-regular-key` | Set a regular key for an account | privateKey, regularKey, network |186187#### XRP and Token Operations188189| Tool Name | Description | Key Parameters |190| ------------------------ | ---------------------- | ----------------------------------------------- |191| `transfer-xrp` | Send XRP to an account | privateKey, to, amount, network |192| `get-token-metadata` | Get token metadata | tokenAddress, network |193| `check-token-balance` | Check token balance | tokenAddress, ownerAddress, network |194| `transfer-token` | Transfer tokens | privateKey, tokenAddress, to, amount, network |195| `approve-token-spending` | Approve token spending | privateKey, tokenAddress, limit, network |196| `token-clawback` | Clawback tokens | privateKey, tokenAddress, from, amount, network |197198#### NFT Operations199200| Tool Name | Description | Key Parameters |201| --------------------- | ------------------------ | -------------------------------- |202| `nft-mint` | Mint an NFT | privateKey, uri, flags, network |203| `get-nft-info` | Get NFT metadata | tokenID, network |204| `check-nft-ownership` | Verify NFT ownership | tokenID, ownerAddress, network |205| `transfer-nft` | Transfer an NFT | privateKey, tokenID, to, network |206| `get-nft-collection` | Get NFTs in a collection | address, network |207208#### DID Operations209210| Tool Name | Description | Key Parameters |211| ---------------- | ---------------- | ------------------------------ |212| `create-did` | Create a DID | privateKey, data, network |213| `resolve-did` | Resolve a DID | did, network |214| `update-did` | Update a DID | privateKey, did, data, network |215| `deactivate-did` | Deactivate a DID | privateKey, did, network |216217#### AMM Operations218219| Tool Name | Description | Key Parameters |220| -------------- | ------------------------ | ---------------------------------- |221| `amm-create` | Create an AMM | privateKey, assets, network |222| `amm-deposit` | Deposit to an AMM | privateKey, ammID, assets, network |223| `amm-bid` | Place bid on an AMM | privateKey, ammID, bid, network |224| `amm-vote` | Vote on AMM parameters | privateKey, ammID, vote, network |225| `amm-delete` | Delete an AMM | privateKey, ammID, network |226| `amm-clawback` | Clawback assets from AMM | privateKey, ammID, assets, network |227228### Resources229230The server exposes XRPL data through the following MCP resource URIs:231232#### Ledger Resources233234| Resource URI Pattern | Description |235| -------------------------------------------- | -------------------------- |236| `xrpl://{network}/ledger/current` | Current ledger information |237| `xrpl://{network}/ledger/{ledger_index}` | Ledger by index |238| `xrpl://{network}/account/{address}` | Account information |239| `xrpl://{network}/account/{address}/balance` | Account XRP balance |240| `xrpl://{network}/tx/{tx_hash}` | Transaction details |241242#### Token Resources243244| Resource URI Pattern | Description |245| ---------------------------------------------------------------- | ------------------------- |246| `xrpl://{network}/token/{currency}/{issuer}` | Token information |247| `xrpl://{network}/token/{currency}/{issuer}/balanceOf/{address}` | Token balance |248| `xrpl://{network}/nft/{tokenID}` | NFT information |249| `xrpl://{network}/nft/{tokenID}/owner` | NFT ownership information |250251## ๐ Security Considerations252253- Wallet seeds are used only for transaction signing and should be kept secure254- Consider implementing additional authentication mechanisms for production use255- For high-value services, consider adding confirmation steps256- Default operations are performed on TestNet to ensure safety during development257- Use environment variables for sensitive configuration258259## ๐ Project Structure260261```262mcp-xrpl/263โโโ src/264โ โโโ core/ # Core utilities and services265โ โ โโโ constants.ts # XRPL network URLs and other constants266โ โ โโโ state.ts # State management for connected wallet267โ โ โโโ utils.ts # Helper functions268โ โ โโโ services/ # Service modules269โ โโโ server/ # MCP server implementation270โ โโโ transactions/ # XRPL transaction implementation271โ โ โโโ token/ # Token-related transactions272โ โ โโโ nft/ # NFT-related transactions273โ โ โโโ did/ # DID-related transactions274โ โ โโโ amm/ # AMM-related transactions275โ โ โโโ check/ # Check-related transactions276โ โ โโโ offer/ # Offer-related transactions277โ โ โโโ oracle/ # Oracle-related transactions278โ โ โโโ payment/ # Payment-related transactions279โ โ โโโ escrow/ # Escrow-related transactions280โ โ โโโ trust/ # Trust line-related transactions281โ โโโ index.ts # Entry point282โโโ build/ # Compiled JavaScript output283โโโ package.json284โโโ package-lock.json285โโโ tsconfig.json286```287288## ๐ ๏ธ Development289290### Adding New Tools291292To add a new tool:2932941. Create a new TypeScript file in the appropriate directory under `src/transactions/`2952. Import the server from `server/server.js`2963. Define the tool using `server.tool()`2974. Import the tool in `src/index.ts`298299### Project Dependencies300301- [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk): MCP SDK302- [`xrpl`](https://www.npmjs.com/package/xrpl): XRP Ledger JavaScript/TypeScript API303- [`dotenv`](https://www.npmjs.com/package/dotenv): Environment variable management304- [`zod`](https://www.npmjs.com/package/zod): TypeScript-first schema declaration and validation305306## ๐ License307308This project is licensed under the terms of the MIT License.309310## โ ๏ธ Disclaimer311312This software is provided for educational and development purposes only. Use it at your own risk. Always test thoroughly on the Testnet before using on Mainnet with real XRP.313
Full transparency โ inspect the skill content before installing.