π Seamless Blockchain Integration for Claude AI
Execute gasless transactions, swaps, and transfers directly from your Claude conversations
π Quick Start β’ π Documentation β’ π οΈ Development β’ π€ Contributing
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.
- π 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
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" |
π bridge-tokens |
Bridge tokens across chains using deBridge | "Bridge 100 USDC from Avalanche to Ethereum" |
π sxt-query-data |
Query blockchain data using Space and Time | "Show my transaction history" |
Choose your preferred installation method:
# Global installation (recommended)
npm install -g 0xgasless-mcp
# Or use directly with npx
npx 0xgasless-mcp
0xgasless-mcp configure
This interactive command will:
- β Collect your API keys and configuration
- β Detect your operating system
- β Configure Claude Desktop automatically
- β Validate all inputs
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
π 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 |
The easiest way to integrate with Claude Desktop:
0xgasless-mcp configure
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"
}
}
}
}
Once configured, interact with blockchain using natural language:
π¬ "What's my wallet balance?"
π¬ "Check my USDC balance on BSC"
π¬ "Show all my token balances"
π¬ "Send 10 USDT to 0x742d35Cc6634C0532925a3b8D4C9db96590b5c8e"
π¬ "Transfer 0.1 BNB to alice.eth"
π¬ "Send 50 USDC to my friend's wallet"
π¬ "Swap 100 USDT for USDC"
π¬ "Exchange 0.5 BNB to WETH"
π¬ "Convert 1000 BUSD to BNB"
π¬ "Buy $10 worth of OpenRouter credits"
π¬ "Purchase $25 OpenRouter credits with USDC"
- π Visit 0xGasless Dashboard
- π Create an account and new project
- π Copy your API key
- π³ Add credits to your account
- π Visit OpenRouter.ai
- π Sign up and navigate to API Keys
- π Generate a new API key
- π° Add credits for AI model access
# 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
src/
βββ π― main.ts # Core MCP server implementation
βββ π index.ts # CLI entry point & configuration
βββ π version.ts # Version management
βββ π types/ # TypeScript definitions
- π 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
- π« Never share your private key with anyone
- πΎ Use environment variables for sensitive data
- π Regularly rotate your API keys
- π Monitor your account usage and credits
π΄ "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
Enable detailed logging for troubleshooting:
DEBUG=1 0xgasless-mcp-server
We welcome contributions! Here's how to get started:
- π΄ 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
- β Follow TypeScript best practices
- β Add tests for new features
- β Update documentation as needed
- β Ensure all tests pass before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
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
- π 0xGasless Documentation
- π MCP Documentation
- π Claude MCP Guide
- π GitHub Repository
- π¦ npm Package
- π Report Issues
- π¬ Discussions