@ton/mcp 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ A Model Context Protocol (MCP) server for TON blockchain wallet operations. Buil
10
10
  - **NFTs**: List, inspect, and transfer NFTs
11
11
  - **DNS**: Resolve `.ton` domains and reverse-lookup addresses
12
12
  - **Known Jettons**: Built-in directory of popular tokens
13
- - **Dual Transport**: Stdio (default) and HTTP server modes
13
+ - **Multiple Transports**: Stdio (default), HTTP server, and serverless modes
14
14
 
15
15
  ## Quick Start
16
16
 
@@ -98,10 +98,18 @@ Get recent transaction history for the wallet (TON transfers, Jetton transfers,
98
98
  **Parameters:**
99
99
  - `limit` (optional): Maximum number of transactions to return (default: 20, max: 100)
100
100
 
101
+ #### `get_transaction_status`
102
+ Get the status of a transaction by its normalized hash to know if it is pending, completed, or failed. In TON, a transaction is considered "complete" only when the entire trace finishes processing.
103
+
104
+ **Default flow:** After sending a transaction, poll this until status is completed or failed. User can specify whether to check status.
105
+
106
+ **Parameters:**
107
+ - `normalizedHash` (required): Normalized hash of the external-in transaction (Hex string). Note: This must be the *normalized* hash of the message sent to the network.
108
+
101
109
  ### Transfers
102
110
 
103
111
  #### `send_ton`
104
- Send TON to an address. Amount is in human-readable format (e.g., `"1.5"` means 1.5 TON).
112
+ Send TON to an address. Amount is in human-readable format (e.g., `"1.5"` means 1.5 TON). Returns `normalizedHash`. Default flow: poll `get_transaction_status` until completed or failed; user can skip.
105
113
 
106
114
  **Parameters:**
107
115
  - `toAddress` (required): Recipient TON address
@@ -109,7 +117,7 @@ Send TON to an address. Amount is in human-readable format (e.g., `"1.5"` means
109
117
  - `comment` (optional): Transaction comment/memo
110
118
 
111
119
  #### `send_jetton`
112
- Send Jettons to an address. Amount is in human-readable format.
120
+ Send Jettons to an address. Amount is in human-readable format. Returns `normalizedHash`. Default flow: poll `get_transaction_status` until completed or failed; user can skip.
113
121
 
114
122
  **Parameters:**
115
123
  - `toAddress` (required): Recipient TON address
@@ -118,7 +126,7 @@ Send Jettons to an address. Amount is in human-readable format.
118
126
  - `comment` (optional): Transaction comment/memo
119
127
 
120
128
  #### `send_raw_transaction`
121
- Send a raw transaction with full control over messages. Supports multiple messages in a single transaction.
129
+ Send a raw transaction with full control over messages. Supports multiple messages. Returns `normalizedHash`. Default flow: poll `get_transaction_status` until completed or failed; user can skip.
122
130
 
123
131
  **Parameters:**
124
132
  - `messages` (required): Array of messages, each with:
@@ -156,7 +164,7 @@ Get detailed information about a specific NFT by its address.
156
164
  - `nftAddress` (required): NFT item contract address
157
165
 
158
166
  #### `send_nft`
159
- Transfer an NFT from the wallet to another address.
167
+ Transfer an NFT from the wallet to another address. Returns `normalizedHash`. Default flow: poll `get_transaction_status` until completed or failed; user can skip.
160
168
 
161
169
  **Parameters:**
162
170
  - `nftAddress` (required): NFT item contract address to transfer
@@ -182,6 +190,53 @@ Reverse-resolve a TON wallet address to its `.ton` domain.
182
190
  #### `get_known_jettons`
183
191
  Get a list of known/popular Jettons on TON with their addresses and metadata. Useful for looking up token addresses for swaps or transfers.
184
192
 
193
+ ## Serverless Deployment
194
+
195
+ The package exports a `@ton/mcp/serverless` entry point for deploying as a serverless function (AWS Lambda, Vercel, Cloudflare Workers, etc.). Credentials are passed via request headers instead of environment variables.
196
+
197
+ ### Headers
198
+
199
+ | Header | Description |
200
+ |-----------------|----------------------------------------------------------|
201
+ | `MNEMONIC` | 24-word mnemonic phrase |
202
+ | `PRIVATE_KEY` | Hex-encoded private key (takes priority over `MNEMONIC`) |
203
+ | `NETWORK` | `mainnet` (default) or `testnet` |
204
+ | `TONCENTER_KEY` | Optional TonCenter API key for higher rate limits |
205
+
206
+ ### AWS Lambda
207
+
208
+ ```typescript
209
+ import { createServerlessHandler } from '@ton/mcp/serverless';
210
+
211
+ export const handler = createServerlessHandler();
212
+ ```
213
+
214
+ ### Vercel
215
+
216
+ ```typescript
217
+ import { createServerlessHandler } from '@ton/mcp/serverless';
218
+
219
+ export default createServerlessHandler();
220
+ ```
221
+
222
+ ### Custom Integration
223
+
224
+ ```typescript
225
+ import { createServerlessHandler } from '@ton/mcp/serverless';
226
+
227
+ const handle = createServerlessHandler();
228
+
229
+ const response = await handle({
230
+ method: 'POST',
231
+ url: '/mcp',
232
+ headers: {
233
+ 'MNEMONIC': 'word1 word2 word3 ...',
234
+ 'NETWORK': 'mainnet',
235
+ },
236
+ body: mcpRequestBody,
237
+ });
238
+ ```
239
+
185
240
  ## Development
186
241
 
187
242
  ```bash