@ton/mcp 0.1.15-alpha.2 → 0.1.15-alpha.21
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 +34 -3
- package/USAGE_EXAMPLES.md +360 -0
- package/dist/cli.d.ts +29 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +36643 -8054
- package/dist/contracts/agentic_wallet/AgenticWalletAdapter.d.ts +17 -10
- package/dist/contracts/agentic_wallet/AgenticWalletAdapter.d.ts.map +1 -1
- package/dist/factory.d.ts +5 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.cjs +36604 -8026
- package/dist/index.js +36569 -7995
- package/dist/registry/config.d.ts +4 -1
- package/dist/registry/config.d.ts.map +1 -1
- package/dist/registry/protected-file.d.ts +16 -0
- package/dist/registry/protected-file.d.ts.map +1 -0
- package/dist/runtime/wallet-runtime.d.ts +3 -1
- package/dist/runtime/wallet-runtime.d.ts.map +1 -1
- package/dist/serverless.cjs +36784 -8206
- package/dist/serverless.js +36749 -8175
- package/dist/services/AgenticSetupSessionManager.d.ts +8 -7
- package/dist/services/AgenticSetupSessionManager.d.ts.map +1 -1
- package/dist/services/McpWalletService.d.ts +34 -1
- package/dist/services/McpWalletService.d.ts.map +1 -1
- package/dist/services/WalletRegistryService.d.ts +3 -1
- package/dist/services/WalletRegistryService.d.ts.map +1 -1
- package/dist/suppress-punycode-deprecation.d.ts +9 -0
- package/dist/suppress-punycode-deprecation.d.ts.map +1 -0
- package/dist/tools/address-tools.d.ts +6 -6
- package/dist/tools/address-tools.d.ts.map +1 -1
- package/dist/tools/agentic-onboarding-tools.d.ts +4 -4
- package/dist/tools/balance-tools.d.ts.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/sanitize.d.ts.map +1 -1
- package/dist/tools/ton-proof-tools.d.ts +37 -0
- package/dist/tools/ton-proof-tools.d.ts.map +1 -0
- package/dist/tools/transfer-tools.d.ts +74 -0
- package/dist/tools/transfer-tools.d.ts.map +1 -1
- package/dist/tools/wallet-management-tools.d.ts +4 -4
- package/dist/utils/agentic.d.ts +1 -0
- package/dist/utils/agentic.d.ts.map +1 -1
- package/dist/utils/proxy.d.ts +9 -0
- package/dist/utils/proxy.d.ts.map +1 -0
- package/dist/utils/ton-client.d.ts.map +1 -1
- package/llms.txt +39 -10
- package/package.json +23 -12
- package/skills/ton-balance/SKILL.md +4 -4
- package/skills/ton-cli/SKILL.md +30 -13
- package/skills/ton-create-wallet/SKILL.md +11 -9
- package/skills/ton-manage-wallets/SKILL.md +5 -2
- package/skills/ton-nfts/SKILL.md +4 -2
- package/skills/ton-proof/SKILL.md +46 -0
- package/skills/ton-send/SKILL.md +5 -3
- package/skills/ton-swap/SKILL.md +6 -4
- package/skills/ton-xstocks/SKILL.md +111 -0
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ A Model Context Protocol (MCP) server for TON blockchain wallet operations. Buil
|
|
|
9
9
|
- **Swaps**: Get quotes for token swaps via DEX aggregators.
|
|
10
10
|
- **NFTs**: List, inspect, and transfer NFTs.
|
|
11
11
|
- **DNS**: Resolve TON DNS-compatible domains and reverse-lookup addresses.
|
|
12
|
+
- **TonProof Authentication**: Generate signed TonConnect proof-of-ownership payloads for third-party services.
|
|
12
13
|
- **Known Jettons**: Built-in directory of popular tokens.
|
|
13
14
|
- **Agentic Wallets**: Manage agentic wallets. Create, import, or manage your agentic wallets.
|
|
14
15
|
- **Multiple Transports**: Stdio (default), multi-session HTTP server, and serverless modes.
|
|
@@ -20,11 +21,15 @@ A Model Context Protocol (MCP) server for TON blockchain wallet operations. Buil
|
|
|
20
21
|
- **Agentic Wallets mode**: Server starts from local config registry at `~/.config/ton/config.json` or `TON_CONFIG_PATH`
|
|
21
22
|
- **Single-wallet mode**: if `MNEMONIC` or `PRIVATE_KEY` is set, the server starts with one in-memory wallet
|
|
22
23
|
|
|
24
|
+
Choose one control path per task: either run `@ton/mcp` as an MCP server (stdio or HTTP) or call tools through raw CLI. Agents must not mix MCP server mode and raw CLI against the same workflow/session, because that creates competing control paths over the same wallet/config state.
|
|
25
|
+
|
|
23
26
|
### Agentic Wallets mode
|
|
24
27
|
|
|
25
28
|
Self-custody wallets for autonomous agents. Your AI agent gets TON wallet capabilities — transfers, swaps, NFTs. User keeps the master key, agent keeps the operator key.
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
Key storage in this mode: wallet secrets are persisted inside the local config registry at `TON_CONFIG_PATH` or `~/.config/ton/config.json`. The config directory is created with `0700` permissions and the config file with `0600` permissions. The file is not stored as plain text, but the current protected-file format is only obfuscation-in-file, not real cryptographic protection with an external secret or password.
|
|
31
|
+
|
|
32
|
+
**Learn more about [Agentic Wallets](https://agents.ton.org/).**
|
|
28
33
|
|
|
29
34
|
Agentic Wallets mode is the default mode that allows you to manage agentic wallets. To create your first agentic wallet, ask your agent to `create agentic wallet` and follow the instructions.
|
|
30
35
|
|
|
@@ -46,6 +51,8 @@ TON_CONFIG_PATH=/path/to/config.json npx @ton/mcp@alpha
|
|
|
46
51
|
|
|
47
52
|
Single-wallet mode is a mode where the server starts with one in-memory wallet. This mode is useful when you want to manage a single wallet or when you want to use the server for a one-off task.
|
|
48
53
|
|
|
54
|
+
Key storage in this mode: `MNEMONIC` / `PRIVATE_KEY` are read from environment variables and used only in memory for the current process; `@ton/mcp` does not persist them to disk in this mode. The values come in as plain environment variables, so any non-plain-text storage or encryption is the responsibility of the caller or host environment, not `@ton/mcp`.
|
|
55
|
+
|
|
49
56
|
```bash
|
|
50
57
|
# Run as stdio MCP server with mnemonic
|
|
51
58
|
MNEMONIC="word1 word2 ..." npx @ton/mcp@alpha
|
|
@@ -106,6 +113,10 @@ npx @ton/mcp@alpha --http 3000
|
|
|
106
113
|
|
|
107
114
|
HTTP mode keeps a separate MCP session/transport per client session id, so multiple clients can initialize and reconnect independently.
|
|
108
115
|
|
|
116
|
+
## Usage Examples
|
|
117
|
+
|
|
118
|
+
Examples of user requests, approximate corresponding raw CLI commands via `npx @ton/mcp@alpha`, and expected agent responses are collected in [USAGE_EXAMPLES.md](./USAGE_EXAMPLES.md).
|
|
119
|
+
|
|
109
120
|
## Environment Variables
|
|
110
121
|
|
|
111
122
|
| Variable | Default | Description |
|
|
@@ -188,7 +199,7 @@ List Jettons held by any address with balances and metadata.
|
|
|
188
199
|
Get metadata for a Jetton master contract.
|
|
189
200
|
|
|
190
201
|
**Parameters:**
|
|
191
|
-
- `
|
|
202
|
+
- `jettonAddress` (required): Jetton master contract address
|
|
192
203
|
|
|
193
204
|
#### `get_transactions`
|
|
194
205
|
Get recent transaction history for the wallet (TON transfers, Jetton transfers, swaps, etc.).
|
|
@@ -235,6 +246,13 @@ Send a raw transaction with full control over messages. Supports multiple messag
|
|
|
235
246
|
- `validUntil` (optional): Unix timestamp after which the transaction becomes invalid
|
|
236
247
|
- `fromAddress` (optional): Sender wallet address
|
|
237
248
|
|
|
249
|
+
#### `emulate_transaction`
|
|
250
|
+
Dry-run a raw transaction without broadcasting it. Accepts the same `messages` format as `send_raw_transaction` and returns the expected TON and Jetton balance changes, fees, and high-level actions so agents can verify a transaction before sending.
|
|
251
|
+
|
|
252
|
+
**Parameters:**
|
|
253
|
+
- `messages` (required): Array of messages, each with `address`, `amount` in nanotons, and optional `stateInit` / `payload`
|
|
254
|
+
- `validUntil` (optional): Unix timestamp after which the transaction becomes invalid
|
|
255
|
+
|
|
238
256
|
### Swaps
|
|
239
257
|
|
|
240
258
|
#### `get_swap_quote`
|
|
@@ -291,6 +309,19 @@ Reverse-resolve a TON wallet address to its associated DNS domain when available
|
|
|
291
309
|
**Parameters:**
|
|
292
310
|
- `address` (required): TON wallet address to reverse resolve
|
|
293
311
|
|
|
312
|
+
### Authentication
|
|
313
|
+
|
|
314
|
+
#### `generate_ton_proof`
|
|
315
|
+
Generate a signed TonConnect proof-of-ownership payload for the active wallet. Use it to authenticate with third-party services that accept TonProof, such as APIs that ask for a domain and challenge payload.
|
|
316
|
+
|
|
317
|
+
**Parameters:**
|
|
318
|
+
- `domain` (required): Domain to generate the proof for (for example, `"getgems.io"`)
|
|
319
|
+
- `payload` (required): Challenge or payload string provided by the verifying service
|
|
320
|
+
|
|
321
|
+
**Returns:** Address, chain id, wallet state init, public key, timestamp, domain, payload, and base64 signature ready to submit to the verifying service.
|
|
322
|
+
|
|
323
|
+
TonProof does not broadcast a transaction, but it does require signing access to the selected wallet. Imported read-only agentic wallets need operator key rotation completed before this tool can generate a proof.
|
|
324
|
+
|
|
294
325
|
### Utility
|
|
295
326
|
|
|
296
327
|
#### `get_known_jettons`
|
|
@@ -321,7 +352,7 @@ Import an existing agentic wallet into the local TON config registry, recovering
|
|
|
321
352
|
- `name` (optional): Wallet display name
|
|
322
353
|
|
|
323
354
|
#### `agentic_start_root_wallet_setup` (registry mode only)
|
|
324
|
-
Start first-root-agent setup: generate operator keys, persist a pending draft, and return a dashboard URL for the user to create the wallet from their main wallet.
|
|
355
|
+
Start first-root-agent setup: generate operator keys, persist a pending draft, and return a dashboard URL for the user to create the wallet from their main wallet. Agents with local shell/browser access should open the dashboard URL for the user. Callback-based completion is for long-lived stdio/HTTP server sessions; raw CLI should use manual completion.
|
|
325
356
|
|
|
326
357
|
**Parameters:**
|
|
327
358
|
- `network` (optional): Network for the new root wallet
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# Usage Examples
|
|
2
|
+
|
|
3
|
+
These examples show how `@ton/mcp` can be used in raw CLI mode. They are illustrative rather than literal agent logs: each example includes a representative user request, the `npx @ton/mcp@alpha` commands an agent would typically run, and the kind of response it would usually return.
|
|
4
|
+
|
|
5
|
+
## Agentic Wallets
|
|
6
|
+
|
|
7
|
+
### Create an agentic wallet
|
|
8
|
+
|
|
9
|
+
**User request**
|
|
10
|
+
|
|
11
|
+
`Create an agentic wallet`
|
|
12
|
+
|
|
13
|
+
**Approximate command list**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @ton/mcp@alpha agentic_start_root_wallet_setup --name "My Agent" --network mainnet
|
|
17
|
+
open <DASHBOARD_URL>
|
|
18
|
+
npx @ton/mcp@alpha agentic_complete_root_wallet_setup --setupId <SETUP_ID> --walletAddress <WALLET_ADDRESS>
|
|
19
|
+
npx @ton/mcp@alpha get_current_wallet
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Approximate agent response**
|
|
23
|
+
|
|
24
|
+
> A new agentic wallet setup was started, and the dashboard link was opened. After the dashboard step was completed, wallet `EQ...` was added and set as the active wallet.
|
|
25
|
+
|
|
26
|
+
### Import an existing agentic wallet
|
|
27
|
+
|
|
28
|
+
**User request**
|
|
29
|
+
|
|
30
|
+
`Import my existing agentic wallet EQ...`
|
|
31
|
+
|
|
32
|
+
**Approximate command list**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx @ton/mcp@alpha agentic_validate_wallet --address EQ...
|
|
36
|
+
npx @ton/mcp@alpha agentic_import_wallet --address EQ... --name "Imported wallet"
|
|
37
|
+
npx @ton/mcp@alpha agentic_rotate_operator_key --walletSelector "Imported wallet"
|
|
38
|
+
open <DASHBOARD_URL>
|
|
39
|
+
npx @ton/mcp@alpha list_wallets
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Approximate agent response**
|
|
43
|
+
|
|
44
|
+
> Wallet `EQ...` was validated and imported into the local registry under the name `Imported wallet`. The dashboard link for the `Public Key` update was opened. Until that on-chain confirmation is completed, the wallet is available in read-only mode.
|
|
45
|
+
|
|
46
|
+
### Rotate the operator key
|
|
47
|
+
|
|
48
|
+
**User request**
|
|
49
|
+
|
|
50
|
+
`Rotate the operator key for the active agentic wallet`
|
|
51
|
+
|
|
52
|
+
**Approximate command list**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx @ton/mcp@alpha agentic_rotate_operator_key
|
|
56
|
+
open <DASHBOARD_URL>
|
|
57
|
+
npx @ton/mcp@alpha agentic_get_pending_operator_key_rotation --rotationId <ROTATION_ID>
|
|
58
|
+
npx @ton/mcp@alpha agentic_complete_rotate_operator_key --rotationId <ROTATION_ID>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Approximate agent response**
|
|
62
|
+
|
|
63
|
+
> The dashboard link for the `Public Key` update was opened. After the main wallet confirms the change, write access is restored.
|
|
64
|
+
|
|
65
|
+
### List agentic wallets by owner
|
|
66
|
+
|
|
67
|
+
**User request**
|
|
68
|
+
|
|
69
|
+
`Which agentic wallets belong to owner address EQ...?`
|
|
70
|
+
|
|
71
|
+
**Approximate command list**
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx @ton/mcp@alpha agentic_list_wallets_by_owner --ownerAddress EQ...
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Approximate agent response**
|
|
78
|
+
|
|
79
|
+
> Several agentic wallets were found for owner address `EQ...`. For each wallet, the agent typically shows the wallet address and basic metadata.
|
|
80
|
+
|
|
81
|
+
## Wallet Registry and Balances
|
|
82
|
+
|
|
83
|
+
### List wallets in the registry
|
|
84
|
+
|
|
85
|
+
**User request**
|
|
86
|
+
|
|
87
|
+
`Which wallets do I have?`
|
|
88
|
+
|
|
89
|
+
**Approximate command list**
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npx @ton/mcp@alpha list_wallets
|
|
93
|
+
npx @ton/mcp@alpha get_current_wallet
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Approximate agent response**
|
|
97
|
+
|
|
98
|
+
> Several wallets were found. The active wallet is `EQ...`. The others can be selected by `id`, name, or address via `set_active_wallet`.
|
|
99
|
+
|
|
100
|
+
### Switch the active wallet
|
|
101
|
+
|
|
102
|
+
**User request**
|
|
103
|
+
|
|
104
|
+
`Make wallet "treasury" active`
|
|
105
|
+
|
|
106
|
+
**Approximate command list**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npx @ton/mcp@alpha set_active_wallet --walletSelector treasury
|
|
110
|
+
npx @ton/mcp@alpha get_current_wallet
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Approximate agent response**
|
|
114
|
+
|
|
115
|
+
> The active wallet was switched to `treasury`. Current address: `UQ...`. Network: `mainnet`.
|
|
116
|
+
|
|
117
|
+
### Show the active wallet balance
|
|
118
|
+
|
|
119
|
+
**User request**
|
|
120
|
+
|
|
121
|
+
`Show my balance in TON and jettons`
|
|
122
|
+
|
|
123
|
+
**Approximate command list**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npx @ton/mcp@alpha get_balance
|
|
127
|
+
npx @ton/mcp@alpha get_jettons
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Approximate agent response**
|
|
131
|
+
|
|
132
|
+
> Active wallet balance: `12.84 TON`. Jetton balances include `USDT 53.2`, `NOT 1400`, and `STON 18.05`.
|
|
133
|
+
|
|
134
|
+
### Show the balance of any address
|
|
135
|
+
|
|
136
|
+
**User request**
|
|
137
|
+
|
|
138
|
+
`Show the balance of address EQ...`
|
|
139
|
+
|
|
140
|
+
**Approximate command list**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx @ton/mcp@alpha get_balance_by_address --address EQ...
|
|
144
|
+
npx @ton/mcp@alpha get_jettons_by_address --address EQ...
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Approximate agent response**
|
|
148
|
+
|
|
149
|
+
> Address `EQ...` has a balance of `3.21 TON`. No jettons were found for that address.
|
|
150
|
+
|
|
151
|
+
### Find a known jetton address
|
|
152
|
+
|
|
153
|
+
**User request**
|
|
154
|
+
|
|
155
|
+
`Show the address of USDT`
|
|
156
|
+
|
|
157
|
+
**Approximate command list**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npx @ton/mcp@alpha get_known_jettons
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Approximate agent response**
|
|
164
|
+
|
|
165
|
+
> `USDT` was found in the list of known jettons with master contract address `EQ...`. That address can be used with `send_jetton` or `get_swap_quote`.
|
|
166
|
+
|
|
167
|
+
## TON Proof Authentication
|
|
168
|
+
|
|
169
|
+
### Generate a TonProof for a service challenge
|
|
170
|
+
|
|
171
|
+
**User request**
|
|
172
|
+
|
|
173
|
+
`Generate a TonProof for getgems.io using payload getgems-llm`
|
|
174
|
+
|
|
175
|
+
**Approximate command list**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
npx @ton/mcp@alpha generate_ton_proof --domain getgems.io --payload getgems-llm
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Approximate agent response**
|
|
182
|
+
|
|
183
|
+
> A signed TonProof was generated for `getgems.io`. The proof includes the wallet address, chain id, wallet state init, public key, timestamp, domain, payload, and signature needed by the verifying service.
|
|
184
|
+
|
|
185
|
+
## Transfers and Swaps
|
|
186
|
+
|
|
187
|
+
### Send TON to a TON DNS name
|
|
188
|
+
|
|
189
|
+
**User request**
|
|
190
|
+
|
|
191
|
+
`Send 1 TON to foundation.ton`
|
|
192
|
+
|
|
193
|
+
**Approximate command list**
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
npx @ton/mcp@alpha resolve_dns --domain foundation.ton
|
|
197
|
+
npx @ton/mcp@alpha send_ton --toAddress EQ... --amount 1
|
|
198
|
+
npx @ton/mcp@alpha get_transaction_status --normalizedHash <NORMALIZED_HASH>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Approximate agent response**
|
|
202
|
+
|
|
203
|
+
> `foundation.ton` was resolved to TON address `EQ...`. The `1 TON` transfer was sent with `normalizedHash: <NORMALIZED_HASH>`. Transaction status: `completed`.
|
|
204
|
+
|
|
205
|
+
### Send a jetton
|
|
206
|
+
|
|
207
|
+
**User request**
|
|
208
|
+
|
|
209
|
+
`Send 25 USDT to UQAbc...`
|
|
210
|
+
|
|
211
|
+
**Approximate command list**
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx @ton/mcp@alpha get_jettons
|
|
215
|
+
npx @ton/mcp@alpha send_jetton --jettonAddress EQ... --toAddress UQAbc... --amount 25
|
|
216
|
+
npx @ton/mcp@alpha get_transaction_status --normalizedHash <NORMALIZED_HASH>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Approximate agent response**
|
|
220
|
+
|
|
221
|
+
> `USDT` was found in the wallet, and the `25 USDT` transfer to `UQAbc...` was sent. `normalizedHash: <NORMALIZED_HASH>`. Current status: `completed`.
|
|
222
|
+
|
|
223
|
+
### Swap TON for a jetton
|
|
224
|
+
|
|
225
|
+
**User request**
|
|
226
|
+
|
|
227
|
+
`Swap 2 TON to USDT`
|
|
228
|
+
|
|
229
|
+
**Approximate command list**
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npx @ton/mcp@alpha get_known_jettons
|
|
233
|
+
# quote
|
|
234
|
+
npx @ton/mcp@alpha get_swap_quote --fromToken TON --toToken EQ... --amount 2 --slippageBps 100
|
|
235
|
+
# pass messages from quote if user approved
|
|
236
|
+
npx @ton/mcp@alpha send_raw_transaction --messages '<quote.transaction.messages>'
|
|
237
|
+
# If the quote includes transaction.validUntil, add --validUntil to the send_raw_transaction invocation above
|
|
238
|
+
npx @ton/mcp@alpha get_transaction_status --normalizedHash <NORMALIZED_HASH>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Approximate agent response**
|
|
242
|
+
|
|
243
|
+
> A quote was received for swapping `2 TON` to `USDT`. After confirmation, the swap was executed with an expected output of about `X USDT` after slippage. `normalizedHash: <NORMALIZED_HASH>`.
|
|
244
|
+
|
|
245
|
+
### Show recent transactions
|
|
246
|
+
|
|
247
|
+
**User request**
|
|
248
|
+
|
|
249
|
+
`Show my last 5 transactions`
|
|
250
|
+
|
|
251
|
+
**Approximate command list**
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npx @ton/mcp@alpha get_transactions --limit 5
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Approximate agent response**
|
|
258
|
+
|
|
259
|
+
> The last 5 operations were shown, including incoming and outgoing TON transfers, jetton transfers, and swaps. For each transaction, the agent typically shows the time, action type, amount, and final status.
|
|
260
|
+
|
|
261
|
+
## TON DNS
|
|
262
|
+
|
|
263
|
+
### Resolve a TON DNS name
|
|
264
|
+
|
|
265
|
+
**User request**
|
|
266
|
+
|
|
267
|
+
`What does foundation.ton resolve to?`
|
|
268
|
+
|
|
269
|
+
**Approximate command list**
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
npx @ton/mcp@alpha resolve_dns --domain foundation.ton
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Approximate agent response**
|
|
276
|
+
|
|
277
|
+
> Domain `foundation.ton` resolves to address `EQ...`.
|
|
278
|
+
|
|
279
|
+
### Reverse-resolve an address
|
|
280
|
+
|
|
281
|
+
**User request**
|
|
282
|
+
|
|
283
|
+
`Does address EQ... have a TON DNS name?`
|
|
284
|
+
|
|
285
|
+
**Approximate command list**
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
npx @ton/mcp@alpha back_resolve_dns --address EQ...
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Approximate agent response**
|
|
292
|
+
|
|
293
|
+
> If reverse resolution succeeds, address `EQ...` maps to a DNS name such as `foundation.ton`. Otherwise, the agent reports that no DNS name was found.
|
|
294
|
+
|
|
295
|
+
## NFTs
|
|
296
|
+
|
|
297
|
+
### List NFTs in the active wallet
|
|
298
|
+
|
|
299
|
+
**User request**
|
|
300
|
+
|
|
301
|
+
`Show my NFTs`
|
|
302
|
+
|
|
303
|
+
**Approximate command list**
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
npx @ton/mcp@alpha get_nfts --limit 20
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Approximate agent response**
|
|
310
|
+
|
|
311
|
+
> A list of NFTs from the active wallet was shown, including addresses, collection names, preview metadata, and key attributes.
|
|
312
|
+
|
|
313
|
+
### Show NFT details
|
|
314
|
+
|
|
315
|
+
**User request**
|
|
316
|
+
|
|
317
|
+
`Show details for NFT EQ...`
|
|
318
|
+
|
|
319
|
+
**Approximate command list**
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
npx @ton/mcp@alpha get_nft --nftAddress EQ...
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Approximate agent response**
|
|
326
|
+
|
|
327
|
+
> For NFT `EQ...`, the agent shows metadata, collection information, owner, content URI, and attributes.
|
|
328
|
+
|
|
329
|
+
### Send an NFT
|
|
330
|
+
|
|
331
|
+
**User request**
|
|
332
|
+
|
|
333
|
+
`Send NFT EQ... to UQReceiver...`
|
|
334
|
+
|
|
335
|
+
**Approximate command list**
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
npx @ton/mcp@alpha send_nft --nftAddress EQ... --toAddress UQReceiver...
|
|
339
|
+
npx @ton/mcp@alpha get_transaction_status --normalizedHash <NORMALIZED_HASH>
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
**Approximate agent response**
|
|
343
|
+
|
|
344
|
+
> NFT `EQ...` was sent to `UQReceiver...`. `normalizedHash: <NORMALIZED_HASH>`. Transaction status: `completed`.
|
|
345
|
+
|
|
346
|
+
### Show NFTs owned by any address
|
|
347
|
+
|
|
348
|
+
**User request**
|
|
349
|
+
|
|
350
|
+
`Show NFTs owned by address EQ...`
|
|
351
|
+
|
|
352
|
+
**Approximate command list**
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npx @ton/mcp@alpha get_nfts_by_address --address EQ... --limit 10
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Approximate agent response**
|
|
359
|
+
|
|
360
|
+
> NFTs owned by address `EQ...` were shown, even though that address is not one of the saved wallets.
|
package/dist/cli.d.ts
CHANGED
|
@@ -5,5 +5,33 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* TON MCP CLI - Command-line MCP server for TON wallet management
|
|
10
|
+
*
|
|
11
|
+
* This CLI runs a Model Context Protocol server that provides
|
|
12
|
+
* TON wallet management tools for use with Claude Desktop or other MCP clients.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* npx @ton/mcp@alpha # stdio mode (default)
|
|
16
|
+
* npx @ton/mcp@alpha --http # HTTP server on 0.0.0.0:3000
|
|
17
|
+
* npx @ton/mcp@alpha --http 8080 # HTTP server on custom port
|
|
18
|
+
* npx @ton/mcp@alpha --http --host 127.0.0.1 # HTTP server on custom host
|
|
19
|
+
* npx @ton/mcp@alpha get_balance # raw CLI: call tool and exit
|
|
20
|
+
* npx @ton/mcp@alpha get_transactions --limit 5
|
|
21
|
+
* npx @ton/mcp@alpha get_jetton_balance --jettonAddress EQAbc...
|
|
22
|
+
*
|
|
23
|
+
* Environment variables:
|
|
24
|
+
* NETWORK - Network to use (mainnet or testnet, default: mainnet)
|
|
25
|
+
* MNEMONIC - 24-word mnemonic phrase for wallet
|
|
26
|
+
* PRIVATE_KEY - Hex-encoded private key (alternative to MNEMONIC)
|
|
27
|
+
* WALLET_VERSION - Wallet version (v5r1, v4r2, or agentic; default: v5r1)
|
|
28
|
+
* AGENTIC_WALLET_ADDRESS - Agentic wallet address (required for WALLET_VERSION=agentic unless derived from init params)
|
|
29
|
+
* AGENTIC_WALLET_NFT_INDEX - walletNftIndex / subwallet id for agentic wallet (uint256, optional)
|
|
30
|
+
* AGENTIC_COLLECTION_ADDRESS - collection address for agentic wallet state init derivation (optional)
|
|
31
|
+
* TONCENTER_API_KEY - API key for Toncenter (optional, for higher rate limits)
|
|
32
|
+
* AGENTIC_CALLBACK_BASE_URL - optional public callback base URL for agentic onboarding
|
|
33
|
+
* AGENTIC_CALLBACK_HOST - host for local callback server in stdio mode (default: 127.0.0.1)
|
|
34
|
+
* AGENTIC_CALLBACK_PORT - port for local callback server in stdio mode (default: random free port)
|
|
35
|
+
*/
|
|
36
|
+
import './suppress-punycode-deprecation.js';
|
|
9
37
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,oCAAoC,CAAC"}
|