@ton/mcp 0.1.15-alpha.0 → 0.1.15-alpha.2

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
@@ -4,60 +4,73 @@ A Model Context Protocol (MCP) server for TON blockchain wallet operations. Buil
4
4
 
5
5
  ## Features
6
6
 
7
- - **Balance Queries**: Check TON and Jetton balances, view transaction history
8
- - **Transfers**: Send TON, Jettons, and NFTs to any address
9
- - **Agentic Sub-wallet Deploy**: Deploy additional Agentic wallets from a root Agentic wallet
10
- - **Swaps**: Get quotes for token swaps via DEX aggregators
11
- - **NFTs**: List, inspect, and transfer NFTs
12
- - **DNS**: Resolve TON DNS-compatible domains and reverse-lookup addresses
13
- - **Known Jettons**: Built-in directory of popular tokens
14
- - **Wallet Registry Mode**: Work with multiple stored wallets, active wallet selection, and local config-backed management tools
15
- - **Agentic Onboarding**: Start and complete first root-agent wallet setup from MCP
16
- - **Multiple Transports**: Stdio (default), multi-session HTTP server, and serverless modes
7
+ - **Balance Queries**: Check TON and Jetton balances, view transaction history.
8
+ - **Transfers**: Send TON, Jettons, and NFTs to any address.
9
+ - **Swaps**: Get quotes for token swaps via DEX aggregators.
10
+ - **NFTs**: List, inspect, and transfer NFTs.
11
+ - **DNS**: Resolve TON DNS-compatible domains and reverse-lookup addresses.
12
+ - **Known Jettons**: Built-in directory of popular tokens.
13
+ - **Agentic Wallets**: Manage agentic wallets. Create, import, or manage your agentic wallets.
14
+ - **Multiple Transports**: Stdio (default), multi-session HTTP server, and serverless modes.
17
15
 
18
16
  ## Quick Start
19
17
 
20
18
  `@ton/mcp` supports two runtime modes.
21
19
 
22
- - **Registry mode**: if `MNEMONIC` and `PRIVATE_KEY` are not set, the server starts from local config registry at `~/.config/ton/config.json` or `TON_CONFIG_PATH`
20
+ - **Agentic Wallets mode**: Server starts from local config registry at `~/.config/ton/config.json` or `TON_CONFIG_PATH`
23
21
  - **Single-wallet mode**: if `MNEMONIC` or `PRIVATE_KEY` is set, the server starts with one in-memory wallet
24
22
 
23
+ ### Agentic Wallets mode
24
+
25
+ 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
+
27
+ **Learn more about [Agentic Wallets](https://agentic-wallets-dashboard.vercel.app/).**
28
+
29
+ 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
+
25
31
  ```bash
26
- # Run as stdio MCP server in registry mode
27
- npx @ton/mcp
32
+ # Install skills (recommended)
33
+ npx skills add ton-connect/kit/packages/mcp
34
+
35
+ # Run as stdio MCP server in agentic mode
36
+ npx @ton/mcp@alpha
37
+
38
+ # Run as HTTP server in agentic mode
39
+ npx @ton/mcp@alpha --http
28
40
 
29
41
  # Run in registry mode with a custom config path
30
- TON_CONFIG_PATH=/path/to/config.json npx @ton/mcp
42
+ TON_CONFIG_PATH=/path/to/config.json npx @ton/mcp@alpha
43
+ ```
44
+
45
+ ### Single-wallet mode
31
46
 
47
+ 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
+
49
+ ```bash
32
50
  # Run as stdio MCP server with mnemonic
33
- MNEMONIC="word1 word2 ..." npx @ton/mcp
51
+ MNEMONIC="word1 word2 ..." npx @ton/mcp@alpha
34
52
 
35
53
  # Run as HTTP server (port 3000)
36
- npx @ton/mcp --http
54
+ MNEMONIC="word1 word2 ..." npx @ton/mcp@alpha --http
37
55
 
38
- # Run as HTTP server on custom port
39
- npx @ton/mcp --http 8080
40
-
41
- # Run with custom agentic wallet contract
42
- PRIVATE_KEY="0xyour_private_key" \
43
- WALLET_VERSION="agentic" \
44
- AGENTIC_WALLET_ADDRESS="EQ..." \
45
- npx @ton/mcp
56
+ # Run as HTTP server on custom port and private key
57
+ PRIVATE_KEY="0xyour_private_key" npx @ton/mcp@alpha --http 8080
46
58
  ```
47
59
 
48
60
  ## Usage with MCP Clients
49
61
 
50
62
  ### Claude Desktop / Cursor
51
63
 
52
- Registry mode:
64
+ Agentic Wallets mode:
53
65
 
54
66
  ```json
55
67
  {
56
68
  "mcpServers": {
57
69
  "ton": {
58
70
  "command": "npx",
59
- "args": ["-y", "@ton/mcp"],
71
+ "args": ["-y", "@ton/mcp@alpha"],
60
72
  "env": {
73
+ "// optional config path": "",
61
74
  "TON_CONFIG_PATH": "/absolute/path/to/config.json"
62
75
  }
63
76
  }
@@ -72,7 +85,7 @@ Single-wallet mode:
72
85
  "mcpServers": {
73
86
  "ton": {
74
87
  "command": "npx",
75
- "args": ["-y", "@ton/mcp"],
88
+ "args": ["-y", "@ton/mcp@alpha"],
76
89
  "env": {
77
90
  "MNEMONIC": "word1 word2 word3 ...",
78
91
  "PRIVATE_KEY": "0xyour_private_key_here (optional, alternative to MNEMONIC)"
@@ -87,7 +100,7 @@ Single-wallet mode:
87
100
  Start the server and point your MCP client to the endpoint:
88
101
 
89
102
  ```bash
90
- npx @ton/mcp --http 3000
103
+ npx @ton/mcp@alpha --http 3000
91
104
  # MCP endpoint: http://localhost:3000/mcp
92
105
  ```
93
106
 
@@ -99,10 +112,10 @@ HTTP mode keeps a separate MCP session/transport per client session id, so multi
99
112
  |-------------------|-----------|-------------------------------------------------------|
100
113
  | `NETWORK` | `mainnet` | TON network (`mainnet` / `testnet`) and default env override target for `TONCENTER_API_KEY` |
101
114
  | `MNEMONIC` | | Space-separated 24-word mnemonic phrase for single-wallet mode |
102
- | `PRIVATE_KEY` | | Hex-encoded private key: 32-byte seed or 64-byte `private||public` (alternative to mnemonic) |
115
+ | `PRIVATE_KEY` | | Hex-encoded private key: 32-byte or 64-byte (alternative to mnemonic) |
103
116
  | `WALLET_VERSION` | `v5r1` | Wallet version to use in single-wallet mode (`v5r1`, `v4r2`, or `agentic`) |
104
117
  | `AGENTIC_WALLET_ADDRESS` | | Agentic wallet address (required for `WALLET_VERSION=agentic`, unless derived from init params) |
105
- | `AGENTIC_WALLET_NFT_INDEX` | | Agentic wallet NFT index / subwallet id (`uint256`, optional) |
118
+ | `AGENTIC_WALLET_NFT_INDEX` | | Agentic wallet NFT index (`uint256`, optional) |
106
119
  | `AGENTIC_COLLECTION_ADDRESS` | `EQByQ19qvWxW7VibSbGEgZiYMqilHY5y1a_eeSL2VaXhfy07` | Agentic collection address override for single-wallet mode |
107
120
  | `TONCENTER_API_KEY` | | API key for Toncenter (optional, for higher rate limits) |
108
121
  | `TON_CONFIG_PATH` | `~/.config/ton/config.json` | Config path for registry mode |
@@ -222,16 +235,6 @@ Send a raw transaction with full control over messages. Supports multiple messag
222
235
  - `validUntil` (optional): Unix timestamp after which the transaction becomes invalid
223
236
  - `fromAddress` (optional): Sender wallet address
224
237
 
225
- #### `agentic_deploy_subwallet`
226
- Deploy a new Agentic sub-wallet from the current wallet. Works only with an agentic root wallet that can sign and only when the current wallet is a user-root wallet (`deployedByUser=true`). Returns `normalizedHash`, deployed sub-wallet address, and computed sub-wallet NFT index. NFT metadata is written in onchain TEP-64 format.
227
-
228
- **Default flow:** Poll `get_transaction_status` with the returned `normalizedHash` until completion.
229
-
230
- **Parameters:**
231
- - `operatorPublicKey` (required): New sub-wallet operator public key (`uint256`, decimal or `0x`-prefixed hex)
232
- - `metadata` (required): Onchain TEP-64 metadata object. Must include at least `name` (non-empty string).
233
- - `amountTon` (optional): TON amount to attach for deployment in TON units (default: `"0.05"`)
234
-
235
238
  ### Swaps
236
239
 
237
240
  #### `get_swap_quote`
package/bin/mcp.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync } from 'node:fs';
4
+ import path from 'node:path';
5
+ import { fileURLToPath, pathToFileURL } from 'node:url';
6
+
7
+ const binDir = path.dirname(fileURLToPath(import.meta.url));
8
+ const cliEntrypoint = path.resolve(binDir, '../dist/cli.js');
9
+
10
+ if (!existsSync(cliEntrypoint)) {
11
+ process.stderr.write(
12
+ 'The @ton/mcp CLI has not been built yet. Run `pnpm --filter @ton/mcp build` from the workspace root and retry.\n',
13
+ );
14
+ process.exit(1);
15
+ }
16
+
17
+ await import(pathToFileURL(cliEntrypoint).href);