Claude Code Integration
Integrate MCP Wallet with Claude Code to enable AI-powered wallet management directly from your coding assistant.
Overview
Claude Code is Anthropic's AI-powered coding assistant that supports MCP integration. This guide shows you how to connect MCP Wallet to Claude Code using HTTP transport and OAuth 2.1 authentication.
Features:
- ✅ HTTP Transport (Direct integration, no adapter needed)
- ✅ OAuth 2.1 authentication with PKCE
- ✅ Balance checking
- ✅ Transaction sending
- ✅ Transaction monitoring
- ✅ Multi-token support
Prerequisites
Before you begin, ensure you have:
MCP Wallet installed and running
- Download: MCP Wallet Releases
- Installation Guide
Wallet created and unlocked
Claude Code installed
- Version with MCP support required
- Claude Code Download
API access enabled
- Settings → Accounts → Enable API toggle
Step-by-Step Setup
Step 1: Start MCP Wallet
- Launch MCP Wallet application
- Unlock your wallet with your password
- The MCP server starts automatically on port
8580
TIP
You can verify the MCP server is running by checking Settings → MCP Server. You should see "Server Status: Running".
Step 2: Enable API Access
- Go to Settings → Accounts
- Find the account you want AI to use
- Toggle "Enable API" to ON
Recommended
Create a dedicated account for AI access and keep limited funds in it for better security.
Step 3: Add MCP Wallet to Claude Code
Use the Claude Code CLI to add MCP Wallet:
claude mcp add --transport http mcp-wallet http://localhost:8580/mcpThis command:
- Adds MCP Wallet to your Claude Code configuration
- Sets up HTTP transport to connect to the MCP server
- Configures the connection to
http://localhost:8580/mcp
TIP
If you don't have the claude CLI installed, you can manually add the configuration to ~/.claude/config.json (macOS/Linux) or %APPDATA%\.claude\config.json (Windows).
Step 4: Authorize Claude Code
Now let's connect Claude Code to your wallet:
Open Claude Code terminal
Run the
/mcpcommandbash/mcpClaude will open your browser to the authorization page
Click "Auth" button on the authorization page
MCP Wallet will show authorization dialog
The dialog displays:
- Client name: "Claude Code"
- Requested permissions
- Your account address
Review and click "Approve"
Return to browser and click "Redirect"
Done! You'll see: "Authentication successful. Connected to wallet."
Troubleshooting
If the authorization dialog doesn't appear:
- Make sure MCP Wallet is running and unlocked
- Check that API access is enabled for at least one account
- Verify the MCP server is running in Settings → MCP Server
Step 5: Test the Connection
Try these commands in Claude Code to test your connection:
Check your wallet address:
What's my wallet address?Check your balance:
How much BNB do I have?Send a test transaction (testnet recommended):
Send 0.001 BNB to 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbAvailable Commands
Here's what you can ask Claude Code to do:
Balance Queries
How much BNB do I have?
What's my USDT balance?
Show me all my token balancesAddress Information
What's my wallet address?
Show my wallet addressTransactions
Send 0.01 BNB to 0x742d35...
Transfer 10 USDT to 0x8388af...
Send 0.001 BNB to vitalik.ethTransaction Status
What's the status of transaction 0x4952c33d...?
Check my last transactionSecurity Features
OAuth 2.1 Authentication
MCP Wallet uses industry-standard OAuth 2.1 with PKCE for security:
- Authorization Code Flow - Secure token exchange
- PKCE (S256) - Prevents authorization code interception
- Short-lived tokens - Access tokens expire after 1 hour
- Refresh tokens - Valid for 30 days
One-Time Approval
After completing OAuth authorization, Claude Code can execute transactions:
- Initial authorization - You approve once during OAuth flow
- Automatic execution - Transactions executed without further approval
- Transaction history - All AI transactions are logged and labeled as "AI-initiated"
- Revoke access - Disable API access anytime in Settings to stop all AI transactions
Coming Soon: Spending Limits
Per-transaction and daily spending limits will be added in a future update for additional control over AI transactions.
Troubleshooting
Authorization Dialog Not Appearing
Problem: Authorization dialog doesn't show when clicking "Auth"
Solutions:
- Make sure MCP Wallet is running and unlocked
- Check API is enabled: Settings → Accounts → Enable API
- Verify MCP server is running: Settings → MCP Server
"HTTP 500" Error
Problem: Claude Code shows "HTTP 500: Internal Server Error"
Solutions:
- Restart MCP Wallet
- Re-unlock your wallet
- Check MCP server logs in Settings → Logs
- Update to latest version of MCP Wallet
Transaction Failed
Problem: Transaction rejected or failed
Solutions:
- Insufficient funds - Make sure you have enough balance + gas fees
- Network issues - Check your internet connection
- Wrong network - Verify you're on the correct network (testnet vs mainnet)
- API disabled - Check that API access is still enabled
Unauthorized Error
Problem: "401 Unauthorized" or "Invalid token"
Solutions:
- Re-authorize - Run
/mcpcommand again in Claude Code - Check token expiry - Access tokens expire after 1 hour
- Restart Claude Code - Sometimes helps refresh the connection
Best Practices
Testing
- Start with testnet - Use BSC Testnet before mainnet
- Small amounts - Test with tiny amounts first
- Verify transactions - Always check transaction hashes on block explorer
Security
- Separate account - Use a dedicated account for AI access
- Limited funds - Keep only needed amount in AI-accessible account
- Regular monitoring - Check transaction history regularly
- Revoke when not in use - Disable API access when you don't need it
Network Configuration
BSC Testnet (for testing):
- Network: BSC Testnet
- Chain ID: 97
- Get testnet BNB: BSC Faucet
BSC Mainnet (for production):
- Network: BSC Mainnet
- Chain ID: 56
- Real BNB required
Production Warning
When using mainnet:
- Double-check addresses - Transactions are irreversible
- Start with small amounts - Test first!
- Monitor closely - Check all AI-initiated transactions
Advanced Configuration
Custom Port
If port 8580 conflicts with another service:
- Go to Settings → MCP Server
- Change port (e.g., to 8581)
- Update Claude Code config:json
{ "url": "http://localhost:8581/mcp", "oauth": { "authorizationEndpoint": "http://localhost:8581/oauth/authorize", // ... rest of config } }
Multiple Accounts
To use multiple accounts with Claude Code:
- Set up first account as described above
- To switch accounts:
- Go to Settings → AI Agent Account
- Select different account
- Claude Code will use the new account automatically
Scopes Customization
You can request fewer permissions if desired:
{
"scopes": ["wallet:read"] // Read-only access
}Available scopes:
wallet:read- Balance and address querieswallet:write- Send transactionswallet:transaction- Transaction statuswallet:admin- Advanced operations (future)
Next Steps
Now that you're connected:
- 📖 Learn about Security Best Practices
- 💰 Learn about Managing Transactions
- 🆘 Get help in Troubleshooting Guide
Need Help?
- 📢 Telegram Community - Community discussion and support
- 🐛 GitHub Issues - Bug reports and feature requests
- 📖 FAQ