|
| 1 | +# API Gateway MCP |
| 2 | + |
| 3 | +The Trust Wallet API Gateway MCP server gives AI agents programmatic access to live blockchain data — token prices, swap quotes, trending tokens, address security, and more — through the [Model Context Protocol](https://modelcontextprotocol.io). |
| 4 | + |
| 5 | +**MCP endpoint:** |
| 6 | + |
| 7 | +``` |
| 8 | +https://mcp.trustwallet.com/tws |
| 9 | +``` |
| 10 | + |
| 11 | + |
| 12 | +## Get API credentials |
| 13 | + |
| 14 | +Register at [portal.trustwallet.com](https://portal.trustwallet.com) to obtain your **Access ID** and **HMAC Secret Key**. |
| 15 | + |
| 16 | +## Authentication |
| 17 | + |
| 18 | +Every request to the gateway must include two headers: |
| 19 | + |
| 20 | +| Header | Value | |
| 21 | +|--------|-------| |
| 22 | +| `X-TW-CREDENTIAL` | Your Access ID | |
| 23 | +| `X-TW-SECRET-KEY` | Your HMAC Secret Key | |
| 24 | + |
| 25 | +The gateway handles HMAC-SHA256 signing of all upstream requests automatically — you only need to pass your credentials as headers. The connection must use HTTPS; credentials travel as plaintext headers and depend on TLS for protection in transit. |
| 26 | + |
| 27 | +## Configuration |
| 28 | + |
| 29 | +### Claude Desktop |
| 30 | + |
| 31 | +Add to `~/Library/Application Support/Claude/claude_desktop_config.json`: |
| 32 | + |
| 33 | +```json |
| 34 | +{ |
| 35 | + "mcpServers": { |
| 36 | + "trust-wallet": { |
| 37 | + "url": "https://mcp.trustwallet.com/tws", |
| 38 | + "headers": { |
| 39 | + "X-TW-CREDENTIAL": "your-access-id", |
| 40 | + "X-TW-SECRET-KEY": "your-hmac-secret" |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +### Claude Code |
| 48 | + |
| 49 | +```bash |
| 50 | +claude mcp add --transport http trust-wallet https://mcp.trustwallet.com/tws \ |
| 51 | + --header "X-TW-CREDENTIAL: <your-access-id>" \ |
| 52 | + --header "X-TW-SECRET-KEY: <your-hmac-secret>" |
| 53 | +``` |
| 54 | + |
| 55 | +### Cursor |
| 56 | + |
| 57 | +Add to `.cursor/mcp.json` in your project (or the global `~/.cursor/mcp.json`): |
| 58 | + |
| 59 | +```json |
| 60 | +{ |
| 61 | + "mcpServers": { |
| 62 | + "trust-wallet": { |
| 63 | + "url": "https://mcp.trustwallet.com/tws", |
| 64 | + "headers": { |
| 65 | + "X-TW-CREDENTIAL": "your-access-id", |
| 66 | + "X-TW-SECRET-KEY": "your-hmac-secret" |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +### VS Code |
| 74 | + |
| 75 | +Add to `.vscode/mcp.json` in your project: |
| 76 | + |
| 77 | +```json |
| 78 | +{ |
| 79 | + "servers": { |
| 80 | + "trust-wallet": { |
| 81 | + "url": "https://mcp.trustwallet.com/tws", |
| 82 | + "headers": { |
| 83 | + "X-TW-CREDENTIAL": "your-access-id", |
| 84 | + "X-TW-SECRET-KEY": "your-hmac-secret" |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +## Available tools |
| 92 | + |
| 93 | +### Token Information |
| 94 | + |
| 95 | +| Tool | Description | |
| 96 | +|------|-------------| |
| 97 | +| `search_assets` | Search tokens by name, symbol, or contract address across 100+ blockchains | |
| 98 | +| `get_asset_details` | Get detailed info about a specific asset by ID or SLIP-44 coin number | |
| 99 | +| `get_coin_status` | Get coin status, feature flags, staking info, and optional security data | |
| 100 | + |
| 101 | +### Swap and Bridge |
| 102 | + |
| 103 | +| Tool | Description | |
| 104 | +|------|-------------| |
| 105 | +| `get_swap_domains` | List supported blockchain domains with available DEX providers | |
| 106 | +| `get_swap_providers` | List all available swap and bridge providers | |
| 107 | +| `get_provider_details` | Get details about a specific swap/bridge provider | |
| 108 | +| `get_swap_quote` | Get optimal swap/bridge routes for token swaps across chains | |
| 109 | +| `get_swap_route_step` | Get executable transaction data for a swap route step | |
| 110 | + |
| 111 | +### Market Data |
| 112 | + |
| 113 | +| Tool | Description | |
| 114 | +|------|-------------| |
| 115 | +| `get_token_prices` | Get current market prices for up to 50 tokens at once | |
| 116 | +| `get_trending_tokens` | Get trending/categorized token listings with multi-timeframe price data | |
| 117 | +| `get_listing_categories` | Get available categories (DeFi, NFT, Layer 2, AI, Memes, etc.) | |
| 118 | + |
| 119 | +### Security |
| 120 | + |
| 121 | +| Tool | Description | |
| 122 | +|------|-------------| |
| 123 | +| `validate_address` | Validate a wallet address for a given chain; returns `{"status":"ok"}` on success | |
| 124 | +| `check_token_security` | Analyze token risks: honeypot detection, audit status, freeze authority | |
| 125 | + |
| 126 | +## Usage examples |
| 127 | + |
| 128 | +| Prompt | Tools used | |
| 129 | +|--------|------------| |
| 130 | +| "What's the current price of ETH, SOL, and BNB?" | `get_token_prices` | |
| 131 | +| "Find me trending meme tokens right now" | `get_trending_tokens` with category filter | |
| 132 | +| "Is this token safe? `c60_t0xdAC17F...`" | `check_token_security` | |
| 133 | +| "Is this a valid Ethereum address? `0x...`" | `validate_address` | |
| 134 | +| "Get a swap quote for 1 ETH to USDC on Base" | `get_swap_quote` | |
| 135 | +| "Search for Arbitrum DeFi tokens" | `search_assets` with network filter | |
| 136 | + |
| 137 | +## Asset ID format |
| 138 | + |
| 139 | +Trust Wallet uses SLIP-44 based asset identifiers: |
| 140 | + |
| 141 | +- **Native coins**: `c{coinId}` — e.g., `c0` (Bitcoin), `c60` (Ethereum), `c714` (BNB) |
| 142 | +- **Tokens**: `c{coinId}_t{contractAddress}` — e.g., `c60_t0xdAC17F958D2ee523a2206206994597C13D831ec7` (USDT on Ethereum) |
| 143 | + |
| 144 | +Common coin IDs: |
| 145 | + |
| 146 | +| Coin ID | Blockchain | |
| 147 | +|---------|------------| |
| 148 | +| 0 | Bitcoin | |
| 149 | +| 60 | Ethereum | |
| 150 | +| 714 | BNB Smart Chain | |
| 151 | +| 501 | Solana | |
| 152 | +| 137 | Polygon | |
| 153 | +| 43114 | Avalanche | |
| 154 | +| 42161 | Arbitrum | |
| 155 | +| 10 | Optimism | |
| 156 | +| 8453 | Base | |
| 157 | + |
0 commit comments