Skip to content

Commit d9b0d27

Browse files
feat: tws mcp gateway documentation added (#423)
* feat: tws mcp gateway documentation added * fix: fixed mcp gateway endpoint * fix: fixed mcp gateway endpoint * fix: fixed mcp gateway endpoint
1 parent 18843d5 commit d9b0d27

5 files changed

Lines changed: 246 additions & 73 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ Trust Wallet's open-source, cross-platform cryptographic library. Supports 130+
5454

5555
## Tooling
5656

57-
### [MCP Server](mcp/mcp.md)
58-
Trust Wallet publishes a Model Context Protocol (MCP) server that gives AI coding assistants direct access to this documentation.
57+
### [MCP Servers](mcp/mcp.md)
58+
Trust Wallet publishes two MCP servers for AI coding assistants: a [Docs MCP](mcp/docs-mcp.md) for searching developer documentation, and an [API Gateway MCP](mcp/api-gateway.md) for querying live blockchain data (prices, swaps, security checks, and more).
5959

6060
### [Claude Code Skills](claude-code-skills/claude-code-skills.md)
6161
Domain-specific Claude Code skills for Trust Wallet libraries, enabling AI-assisted development with knowledge of Trust Wallet's APIs and conventions.

SUMMARY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
- [CLI Reference](agent-sdk/cli-reference.md)
77
- [Authentication](agent-sdk/authentication.md)
88
- [Key Management](agent-sdk/key-management.md)
9-
- [MCP Server](mcp/mcp.md)
9+
- [MCP Servers](mcp/mcp.md)
10+
- [Docs MCP](mcp/docs-mcp.md)
11+
- [API Gateway MCP](mcp/api-gateway.md)
1012
- [Agent Skills](claude-code-skills/claude-code-skills.md)
1113
- [Developing for Trust Wallet platform](develop-for-trust/develop-for-trust.md)
1214
- [Browser Extension](develop-for-trust/browser-extension/browser-extension.md)

mcp/api-gateway.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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+

mcp/docs-mcp.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Docs MCP
2+
3+
Trust Wallet publishes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server powered by GitBook, giving AI coding assistants direct access to the Trust Wallet developer documentation.
4+
5+
**MCP endpoint:**
6+
7+
```
8+
https://developer.trustwallet.com/developer/~gitbook/mcp
9+
```
10+
11+
## What is MCP?
12+
13+
MCP is an open standard that lets AI tools (Claude, Cursor, VS Code Copilot, etc.) connect to external knowledge sources and services. When an MCP server is configured, the AI can query it in real time rather than relying solely on its training data.
14+
15+
## Configuration
16+
17+
### Claude Desktop
18+
19+
Add the following to your `claude_desktop_config.json`:
20+
21+
```json
22+
{
23+
"mcpServers": {
24+
"trust-wallet-docs": {
25+
"command": "npx",
26+
"args": [
27+
"mcp-remote",
28+
"https://developer.trustwallet.com/developer/~gitbook/mcp"
29+
]
30+
}
31+
}
32+
}
33+
```
34+
35+
### Claude Code
36+
37+
```
38+
claude mcp add --transport http trust-wallet-docs https://developer.trustwallet.com/developer/~gitbook/mcp
39+
```
40+
41+
### Cursor
42+
43+
Add to `.cursor/mcp.json` in your project (or the global `~/.cursor/mcp.json`):
44+
45+
```json
46+
{
47+
"mcpServers": {
48+
"trust-wallet-docs": {
49+
"url": "https://developer.trustwallet.com/developer/~gitbook/mcp"
50+
}
51+
}
52+
}
53+
```
54+
55+
## What the server exposes
56+
57+
Once connected, your AI assistant can search and retrieve content from the full Trust Wallet developer documentation, including:
58+
59+
- Browser Extension and WalletConnect integration guides
60+
- Deep linking reference
61+
- Asset listing requirements and PR process
62+
- Wallet Core API usage, building, and blockchain support
63+
- Barz smart wallet documentation
64+
- Claude Code Skills for Trust Wallet
65+
66+
## Usage example
67+
68+
After configuring the MCP server, you can ask your AI assistant questions like:
69+
70+
> "How do I detect the Trust Wallet browser extension?"
71+
72+
> "What are the asset listing requirements for a new token?"
73+
74+
> "Show me how to sign a transaction with Wallet Core in Swift."
75+
76+
The assistant will query the Trust Wallet docs in real time and return accurate, up-to-date answers.

mcp/mcp.md

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,14 @@
1-
# MCP Server
1+
# MCP Servers
22

3-
Trust Wallet publishes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server powered by GitBook, giving AI coding assistants direct access to the Trust Wallet developer documentation.
3+
Trust Wallet publishes two [Model Context Protocol (MCP)](https://modelcontextprotocol.io) servers for AI coding assistants:
44

5-
**MCP endpoint:**
5+
- [**Docs MCP**](docs-mcp.md) — search and retrieve content from the full Trust Wallet developer documentation. Powered by GitBook; no API key required.
6+
- [**API Gateway MCP**](api-gateway.md) — query live blockchain data: token prices, swap quotes, trending tokens, address security checks, and more. Requires API credentials from [portal.trustwallet.com](https://portal.trustwallet.com).
67

7-
```
8-
https://developer.trustwallet.com/developer/~gitbook/mcp
9-
```
8+
## Which one should I use?
109

11-
## What is MCP?
10+
Use the **Docs MCP** when you want your AI assistant to answer questions about Trust Wallet's developer documentation — integration guides, Wallet Core, asset listing, and so on.
1211

13-
MCP is an open standard that lets AI tools (Claude, Cursor, VS Code Copilot, etc.) connect to external knowledge sources and services. When an MCP server is configured, the AI can query it in real time rather than relying solely on its training data.
12+
Use the **API Gateway MCP** when you want your AI agent to interact with live blockchain data and crypto services programmatically.
1413

15-
## Configuration
16-
17-
### Claude Desktop
18-
19-
Add the following to your `claude_desktop_config.json`:
20-
21-
```json
22-
{
23-
"mcpServers": {
24-
"trust-wallet-docs": {
25-
"command": "npx",
26-
"args": [
27-
"mcp-remote",
28-
"https://developer.trustwallet.com/developer/~gitbook/mcp"
29-
]
30-
}
31-
}
32-
}
33-
```
34-
35-
### Claude Code
36-
37-
```
38-
claude mcp add --transport http trust-wallet-docs https://developer.trustwallet.com/developer/~gitbook/mcp
39-
```
40-
41-
### Cursor
42-
43-
Add to `.cursor/mcp.json` in your project (or the global `~/.cursor/mcp.json`):
44-
45-
```json
46-
{
47-
"mcpServers": {
48-
"trust-wallet-docs": {
49-
"url": "https://developer.trustwallet.com/developer/~gitbook/mcp"
50-
}
51-
}
52-
}
53-
```
54-
55-
## What the server exposes
56-
57-
Once connected, your AI assistant can search and retrieve content from the full Trust Wallet developer documentation, including:
58-
59-
- Browser Extension and WalletConnect integration guides
60-
- Deep linking reference
61-
- Asset listing requirements and PR process
62-
- Wallet Core API usage, building, and blockchain support
63-
- Barz smart wallet documentation
64-
- Claude Code Skills for Trust Wallet
65-
66-
## Usage example
67-
68-
After configuring the MCP server, you can ask your AI assistant questions like:
69-
70-
> "How do I detect the Trust Wallet browser extension?"
71-
72-
> "What are the asset listing requirements for a new token?"
73-
74-
> "Show me how to sign a transaction with Wallet Core in Swift."
75-
76-
The assistant will query the Trust Wallet docs in real time and return accurate, up-to-date answers.
14+
Both servers can be active at the same time.

0 commit comments

Comments
 (0)