Plasma Testnet MCP Server
Enables AI assistants to interact with the Plasma Network blockchain testnet, supporting XPL token transfers, transaction monitoring, gas estimation, wallet balance queries, and smart contract interactions through natural language.
README
<div align="center">
🌐 Plasma Testnet MCP Server v0.1
Production-ready Model Context Protocol (MCP) server for Plasma Testnet
Features • Quick Start • API • Tools • Examples • Prompts • Security
</div>
🚀 Features
🎯 Complete Blockchain Integration
- Full Plasma Network testnet support with native XPL token operations
- Real-time transaction monitoring and status tracking
- Gas estimation and optimization for cost-effective operations
- Multi-signature wallet support (coming soon)
- Smart contract interaction capabilities
- Comprehensive block explorer integration
🧠 Intelligent Transaction Engine
- Automatic gas price calculation and optimization
- Transaction simulation before execution
- Nonce management and conflict resolution
- Error recovery with automatic retry logic
- Transaction receipt confirmation
- Real-time network status monitoring
🤖 MCP Protocol Implementation
- 14+ specialized tools for blockchain automation
- Compatible with Claude Desktop and AI assistants
- HTTP and stdio transport support
- Zod schema validation for all parameters
- Comprehensive error handling and logging
- Production-tested components
🏛️ Enterprise-Ready Architecture
- Built with Express.js for scalability
- Ethers.js v5 for blockchain interactions
- Full TypeScript type safety (via Zod)
- Docker containerization support
- Comprehensive logging and monitoring
- Environment-based configuration
📦 Quick Start
✅ Prerequisites
# Required
Node.js >= 18.0.0
npm >= 9.0.0
# Optional
Docker & Docker Compose (for containerized deployment)
Private key for transaction execution
📥 Installation
# Clone the repository
git clone https://github.com/tairon-ai/plasma-mcp.git
cd plasma-mcp
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your configuration
# Start the server
npm start
# Development mode
npm run dev
# MCP stdio server for Claude Desktop
npm run mcp
🐳 Docker Deployment
# Build and run with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
🤖 Claude Desktop Integration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"plasma-network": {
"command": "node",
"args": ["/path/to/plasma-mcp/mcp/index.js"],
"env": {
"RPC_URL": "https://testnet-rpc.plasma.to",
"WALLET_PRIVATE_KEY": "your_private_key_without_0x"
}
}
}
}
🛠 Available Tools
🏦 Blockchain Operations
| Tool | Description | Parameters |
|---|---|---|
getServiceInfo |
Get server capabilities and config | - |
getNetworkInfo |
Get Plasma network information | - |
getAccountBalance |
Get XPL balance for address | address (optional) |
sendTransaction |
Send custom transaction | to, value, data, gasLimit, gasPrice |
sendXPL |
Send XPL tokens | to, amount |
getTransactionStatus |
Check transaction status | txHash |
requestFaucet |
Get testnet faucet info | address, faucetName |
estimateGas |
Estimate gas for transaction | from, to, value, data |
getLatestBlocks |
Get recent blocks | count |
getGasPrice |
Get current gas price | - |
getTokenInfo |
Get token details | tokenAddress |
getWalletBalances |
Get wallet token balances | walletAddress, tokens |
🔗 API Endpoints
🌐 Core Endpoints
GET / # Server status and info
GET /health # Health check
GET /info # Service information
GET /mcp # MCP server information
POST /mcp # MCP protocol endpoint
💡 Examples
💰 Get Account Balance
// Get XPL balance
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getAccountBalance",
"arguments": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb9"
}
},
"id": 1
}
🔄 Send XPL Tokens
// Send 10 XPL to address
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "sendXPL",
"arguments": {
"to": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb9",
"amount": "10.0"
}
},
"id": 1
}
📊 Check Transaction Status
// Check transaction by hash
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getTransactionStatus",
"arguments": {
"txHash": "0x123...abc"
}
},
"id": 1
}
🤖 Prompts
💬 Example Prompts for Claude, ChatGPT, or Other AI Assistants
These prompts demonstrate how to interact with the MCP server through natural language when integrated with AI assistants:
💱 Token Operations
"What's my XPL balance?"
"Send 5 XPL to 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb9"
"Check the status of transaction 0x123...abc"
"Estimate gas for sending 100 XPL to this address"
📊 Network Analysis
"Show me the current gas price on Plasma Network"
"Get the latest 5 blocks from the network"
"What's the current network status?"
"Show me network information including block height"
💼 Wallet Management
"Get my wallet nonce and balance"
"Show all token balances in my wallet"
"Request testnet XPL from the faucet"
"Calculate the cost of a transaction with current gas prices"
🔧 Smart Contract Interaction
"Get information about token at address 0x..."
"Send a custom transaction with data payload"
"Estimate gas for a contract interaction"
"Check if a transaction was successful"
🔧 Integration Tips for AI Assistants
When using these prompts with the MCP server:
- Always specify addresses in full format (0x...)
- Use decimal amounts for XPL (e.g., "10.5" not "10500000000000000000")
- Check gas prices before large transactions
- Verify balances before attempting transfers
- Monitor transaction status after sending
🧪 Testing
🔍 API Testing with cURL
# Check server health
curl http://localhost:8080/health
# Get MCP server info
curl http://localhost:8080/mcp
# Get service information
curl http://localhost:8080/info
# Execute a tool
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getNetworkInfo",
"arguments": {}
},
"id": 1
}'
🔒 Security
🔐 Best Practices
- Private Key Management: Never commit private keys. Use environment variables
- Transaction Validation: All parameters are validated with Zod schemas
- Gas Limits: Automatic gas estimation with safety margins
- Error Handling: Comprehensive error handling for all operations
- Access Control: Implement authentication for production deployments
- Monitoring: Use block explorer to track all transactions
🛡️ Security Features
- Zod schema validation for all inputs
- Automatic gas estimation with buffer
- Transaction simulation capabilities
- Private key encryption support
- Rate limiting ready
- Comprehensive audit logging
📊 Supported Networks & Tokens
🌐 Network
- Plasma Testnet (Chain ID: 9746)
- RPC:
https://testnet-rpc.plasma.to - Explorer: Plasma Explorer
🪙 Native Token
- XPL: Native Plasma Network token
- Decimals: 18
- Used for gas fees and transfers
📜 Future Contracts (Pending Deployment)
- DEX Router: Decentralized exchange routing
- Token Factory: ERC20 token deployment
- Liquidity Pools: Automated market making
🚀 Deployment
🏭 Production Deployment
# Build for production
npm run build
# Start production server
NODE_ENV=production npm start
# With PM2
pm2 start server.js --name plasma-mcp
# With Docker
docker build -t plasma-mcp .
docker run -d -p 8080:8080 --env-file .env plasma-mcp
🔑 Environment Variables
# Required for transactions
WALLET_PRIVATE_KEY=your_private_key_without_0x
# Network configuration
RPC_URL=https://testnet-rpc.plasma.to
# Optional
PORT=8080
NODE_ENV=production
📈 Performance
- Response Time: <100ms for read operations
- Transaction Speed: ~2-5s on Plasma Network
- Throughput: 100+ requests per second
- Gas Optimization: Automatic gas price calculation
- Caching: Optimized for repeated queries
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
# Fork and clone
git fork https://github.com/tairon-ai/plasma-mcp
git clone https://github.com/tairon-ai/plasma-mcp
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and test
npm test
# Commit and push
git commit -m 'feat: add amazing feature'
git push origin feature/amazing-feature
# Open Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Plasma Network - Next-generation blockchain platform
- Model Context Protocol - AI integration standard
- Ethers.js - Ethereum library
- Anthropic - Claude AI assistant
<div align="center">
Built by Tairon.ai team with help from Claude
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。