achiit/0xgasless-mcp-server
If you are the rightful owner of 0xgasless-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The 0xGasless MCP Server is a Model Context Protocol server that facilitates gasless blockchain operations through natural language interactions with Claude AI.
get-address
Retrieve your smart account address.
get-balance
Check token balances with ERC20 support.
transfer-token
Send tokens gaslessly.
swap-tokens
Exchange tokens without gas.
buy-openrouter-credits
Purchase AI credits with USDC.
š 0xGasless MCP Server
š Seamless Blockchain Integration for Claude AI
Execute gasless transactions, swaps, and transfers directly from your Claude conversations
š Quick Start ⢠š Documentation ⢠š ļø Development ⢠š¤ Contributing
š What is 0xGasless MCP Server?
The 0xGasless MCP Server is a powerful Model Context Protocol server that bridges Claude AI with blockchain networks. Built on ERC-4337 Account Abstraction, it enables gasless blockchain operations through natural language conversations.
⨠Key Highlights
- š Zero Gas Fees - Execute transactions without holding native tokens
- š Multi-Chain Support - 8+ blockchain networks supported
- š¤ AI-Native - Natural language blockchain interactions
- š Secure - Smart account abstraction with enhanced security
- ā” Instant Setup - One-command Claude integration
š ļø Available Tools
Tool | Description | Example Usage |
---|---|---|
š get-address | Retrieve your smart account address | "What's my wallet address?" |
š° get-balance | Check token balances (ERC20 support) | "Show my USDC balance" |
š¤ transfer-token | Send tokens gaslessly | "Send 10 USDT to alice.eth" |
š swap-tokens | Exchange tokens without gas | "Swap 100 USDT for USDC" |
šÆ buy-openrouter-credits | Purchase AI credits with USDC | "Buy $25 OpenRouter credits" |
š Quick Start
š¦ Installation
Choose your preferred installation method:
# Global installation (recommended)
npm install -g 0xgasless-mcp
# Or use directly with npx
npx 0xgasless-mcp
āļø Configuration
1ļøā£ Automatic Setup (Easiest)
0xgasless-mcp configure
This interactive command will:
- ā Collect your API keys and configuration
- ā Detect your operating system
- ā Configure Claude Desktop automatically
- ā Validate all inputs
2ļøā£ Manual Environment Setup
Create a .env
file with your configuration:
# š Required Configuration
PRIVATE_KEY=0x... # Your wallet private key
RPC_URL=https://... # Blockchain RPC endpoint
API_KEY=your_0xgasless_api_key # From dashboard.0xgasless.com
CHAIN_ID=56 # Target blockchain (see table below)
# šÆ Optional Configuration
OPENROUTER_API_KEY=your_key # For AI credit purchases
š Supported Networks
š Network | š Chain ID | š Native Token | š RPC Endpoint |
---|---|---|---|
š” BSC | 56 | BNB | https://bsc-dataseed.binance.org/ |
šµ Base | 8453 | ETH | https://mainnet.base.org |
ā« Ethereum | 1 | ETH | https://eth.llamarpc.com |
š£ Polygon | 137 | MATIC | https://polygon-rpc.com |
š“ Avalanche | 43114 | AVAX | https://api.avax.network/ext/bc/C/rpc |
šµ Fantom | 250 | FTM | https://rpc.ftm.tools |
š Moonbeam | 1284 | GLMR | https://rpc.api.moonbeam.network |
š¢ Metis | 1088 | METIS | https://andromeda.metis.io/?owner=1088 |
š Claude Desktop Integration
šÆ Automatic Configuration
The easiest way to integrate with Claude Desktop:
0xgasless-mcp configure
š Manual Configuration
Add to your Claude Desktop configuration file:
š Configuration Locations:
- š macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- šŖ Windows:
%APPDATA%\Claude\claude_desktop_config.json
- š§ Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"0xgasless": {
"command": "npx",
"args": ["0xgasless-mcp-server"],
"env": {
"PRIVATE_KEY": "0x...",
"RPC_URL": "https://...",
"API_KEY": "your_0xgasless_api_key",
"CHAIN_ID": "56",
"OPENROUTER_API_KEY": "your_openrouter_key"
}
}
}
}
š¬ Usage Examples
Once configured, interact with blockchain using natural language:
š° Balance Inquiries
š¬ "What's my wallet balance?"
š¬ "Check my USDC balance on BSC"
š¬ "Show all my token balances"
š¤ Token Transfers
š¬ "Send 10 USDT to 0x742d35Cc6634C0532925a3b8D4C9db96590b5c8e"
š¬ "Transfer 0.1 BNB to alice.eth"
š¬ "Send 50 USDC to my friend's wallet"
š Token Swaps
š¬ "Swap 100 USDT for USDC"
š¬ "Exchange 0.5 BNB to WETH"
š¬ "Convert 1000 BUSD to BNB"
šÆ AI Credit Purchases
š¬ "Buy $10 worth of OpenRouter credits"
š¬ "Purchase $25 OpenRouter credits with USDC"
š API Keys Setup
šÆ 0xGasless API Key
- š Visit 0xGasless Dashboard
- š Create an account and new project
- š Copy your API key
- š³ Add credits to your account
š¤ OpenRouter API Key (Optional)
- š Visit OpenRouter.ai
- š Sign up and navigate to API Keys
- š Generate a new API key
- š° Add credits for AI model access
š ļø Development
šļø Local Development Setup
# Clone the repository
git clone https://github.com/achiit/0xgasless-mcp-server.git
cd 0xgasless-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Development mode with hot reload
npm run dev
# Start the server
npm start
š Project Structure
src/
āāā šÆ main.ts # Core MCP server implementation
āāā š index.ts # CLI entry point & configuration
āāā š version.ts # Version management
āāā š types/ # TypeScript definitions
š Security & Best Practices
š”ļø Security Guidelines
- š Private Keys: Store securely in environment variables, never in code
- š API Keys: Keep 0xGasless and OpenRouter keys confidential
- š¦ Smart Accounts: Enhanced security through account abstraction
- ā½ Gasless Operations: No native tokens required for transactions
ā ļø Important Notes
- š« Never share your private key with anyone
- š¾ Use environment variables for sensitive data
- š Regularly rotate your API keys
- š Monitor your account usage and credits
š Troubleshooting
š Common Issues & Solutions
š“ "Chain ID not supported"
Solution:
- ā Verify you're using a supported chain ID from the table above
- ā Check the supported networks section
š“ "API Key invalid"
Solution:
- ā Verify your 0xGasless API key is correct
- ā Ensure sufficient credits in your 0xGasless account
- ā Check API key permissions and expiration
š“ "Insufficient balance"
Solution:
- ā Check token balance before operations
- ā Ensure you have enough tokens for the transaction
- ā Verify token contract address is correct
š“ "Private key format error"
Solution:
- ā Ensure private key starts with "0x"
- ā Verify it's exactly 66 characters (64 + "0x")
- ā Check for any extra spaces or characters
š Debug Mode
Enable detailed logging for troubleshooting:
DEBUG=1 0xgasless-mcp-server
š¤ Contributing
We welcome contributions! Here's how to get started:
š Quick Contribution Guide
- š“ Fork the repository
- šæ Create a feature branch:
git checkout -b feature/amazing-feature
- š¾ Commit your changes:
git commit -m 'Add amazing feature'
- š¤ Push to branch:
git push origin feature/amazing-feature
- š Open a Pull Request
š Development Guidelines
- ā Follow TypeScript best practices
- ā Add tests for new features
- ā Update documentation as needed
- ā Ensure all tests pass before submitting
š License
This project is licensed under the MIT License - see the file for details.
š Acknowledgments
Special thanks to the amazing teams and projects that make this possible:
- šÆ 0xGasless - Smart account infrastructure
- š¤ Model Context Protocol - MCP specification
- š§ Claude - AI integration capabilities
- š OpenRouter - AI API access platform
š Resources & Links
š Documentation
- š 0xGasless Documentation
- š MCP Documentation
- š Claude MCP Guide
š Project Links
- š GitHub Repository
- š¦ npm Package
- š Report Issues
- š¬ Discussions