0xgasless-mcp-server

achiit/0xgasless-mcp-server

3.3

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.

Tools
  1. get-address

    Retrieve your smart account address.

  2. get-balance

    Check token balances with ERC20 support.

  3. transfer-token

    Send tokens gaslessly.

  4. swap-tokens

    Exchange tokens without gas.

  5. 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

ToolDescriptionExample Usage
šŸ  get-addressRetrieve your smart account address"What's my wallet address?"
šŸ’° get-balanceCheck token balances (ERC20 support)"Show my USDC balance"
šŸ“¤ transfer-tokenSend tokens gaslessly"Send 10 USDT to alice.eth"
šŸ”„ swap-tokensExchange tokens without gas"Swap 100 USDT for USDC"
šŸŽÆ buy-openrouter-creditsPurchase 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
🟔 BSC56BNBhttps://bsc-dataseed.binance.org/
šŸ”µ Base8453ETHhttps://mainnet.base.org
⚫ Ethereum1ETHhttps://eth.llamarpc.com
🟣 Polygon137MATIChttps://polygon-rpc.com
šŸ”“ Avalanche43114AVAXhttps://api.avax.network/ext/bc/C/rpc
šŸ”µ Fantom250FTMhttps://rpc.ftm.tools
šŸŒ™ Moonbeam1284GLMRhttps://rpc.api.moonbeam.network
🟢 Metis1088METIShttps://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

  1. 🌐 Visit 0xGasless Dashboard
  2. šŸ“ Create an account and new project
  3. šŸ”‘ Copy your API key
  4. šŸ’³ Add credits to your account

šŸ¤– OpenRouter API Key (Optional)

  1. 🌐 Visit OpenRouter.ai
  2. šŸ“ Sign up and navigate to API Keys
  3. šŸ”‘ Generate a new API key
  4. šŸ’° 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

  1. šŸ“ Fork the repository
  2. 🌿 Create a feature branch: git checkout -b feature/amazing-feature
  3. šŸ’¾ Commit your changes: git commit -m 'Add amazing feature'
  4. šŸ“¤ Push to branch: git push origin feature/amazing-feature
  5. šŸ”„ 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:


šŸ“š Resources & Links

šŸ“– Documentation

šŸ”— Project Links


šŸš€ Made with ā¤ļø for the blockchain community

Empowering AI-driven blockchain interactions

Follow on GitHub Star this repo