@truecarry/mcp 0.1.0 → 0.1.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 +57 -23
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -0
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -7,14 +7,20 @@ A Model Context Protocol (MCP) server for TON blockchain wallet operations. Buil
|
|
|
7
7
|
- **Wallet Management**: Create, import, list, and remove TON wallets
|
|
8
8
|
- **Balance Queries**: Check TON and Jetton balances
|
|
9
9
|
- **Transfers**: Send TON and Jettons to any address
|
|
10
|
-
- **
|
|
10
|
+
- **Swaps**: Get quotes and execute token swaps
|
|
11
|
+
- **Dual Transport**: Stdio (default) and HTTP server modes
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Quick Start
|
|
13
14
|
|
|
14
15
|
```bash
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
# Run as stdio MCP server
|
|
17
|
+
npx @ton/mcp
|
|
18
|
+
|
|
19
|
+
# Run as HTTP server (port 3000)
|
|
20
|
+
npx @ton/mcp --http
|
|
21
|
+
|
|
22
|
+
# Run as HTTP server on custom port
|
|
23
|
+
npx @ton/mcp --http 8080
|
|
18
24
|
```
|
|
19
25
|
|
|
20
26
|
## Usage with MCP Clients
|
|
@@ -27,13 +33,28 @@ Add to your MCP configuration:
|
|
|
27
33
|
{
|
|
28
34
|
"mcpServers": {
|
|
29
35
|
"ton": {
|
|
30
|
-
"command": "
|
|
31
|
-
"args": ["/
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["@ton/mcp"]
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
```
|
|
36
42
|
|
|
43
|
+
### HTTP mode
|
|
44
|
+
|
|
45
|
+
Start the server and point your MCP client to the endpoint:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @ton/mcp --http 3000
|
|
49
|
+
# MCP endpoint: http://localhost:3000/mcp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Environment Variables
|
|
53
|
+
|
|
54
|
+
| Variable | Default | Description |
|
|
55
|
+
|-----------|-----------|------------------------------|
|
|
56
|
+
| `NETWORK` | `mainnet` | TON network (`mainnet` / `testnet`) |
|
|
57
|
+
|
|
37
58
|
## Available Tools
|
|
38
59
|
|
|
39
60
|
### Wallet Management
|
|
@@ -108,34 +129,47 @@ Send Jettons to an address.
|
|
|
108
129
|
- `amount` (required): Amount in raw units (apply decimals yourself)
|
|
109
130
|
- `comment` (optional): Transaction comment/memo
|
|
110
131
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Wallet data is stored in `~/.ton-mcp/wallets.json`.
|
|
132
|
+
### Swaps
|
|
114
133
|
|
|
115
|
-
|
|
134
|
+
#### `get_swap_quote`
|
|
135
|
+
Get a quote for a token swap.
|
|
116
136
|
|
|
117
|
-
|
|
137
|
+
#### `execute_swap`
|
|
138
|
+
Execute a token swap.
|
|
118
139
|
|
|
119
140
|
## Development
|
|
120
141
|
|
|
121
142
|
```bash
|
|
122
|
-
#
|
|
123
|
-
pnpm
|
|
143
|
+
# Run from source (stdio)
|
|
144
|
+
pnpm --filter @ton/mcp dev:cli
|
|
124
145
|
|
|
125
|
-
#
|
|
126
|
-
pnpm dev
|
|
146
|
+
# Run from source (HTTP)
|
|
147
|
+
pnpm --filter @ton/mcp dev:cli:http
|
|
127
148
|
|
|
128
|
-
#
|
|
129
|
-
pnpm
|
|
130
|
-
```
|
|
149
|
+
# Build
|
|
150
|
+
pnpm --filter @ton/mcp build
|
|
131
151
|
|
|
132
|
-
|
|
152
|
+
# Run built version
|
|
153
|
+
node packages/mcp/dist/cli.js
|
|
154
|
+
node packages/mcp/dist/cli.js --http 8080
|
|
155
|
+
```
|
|
133
156
|
|
|
134
|
-
|
|
157
|
+
## Library Usage
|
|
135
158
|
|
|
136
|
-
|
|
159
|
+
The package also exports a programmatic API for building custom MCP servers:
|
|
137
160
|
|
|
138
|
-
|
|
161
|
+
```typescript
|
|
162
|
+
import { createTonWalletMCP, InMemoryStorageAdapter, LocalSignerAdapter, StaticUserContextProvider } from '@ton/mcp';
|
|
139
163
|
|
|
164
|
+
const server = createTonWalletMCP({
|
|
165
|
+
storage: new InMemoryStorageAdapter(),
|
|
166
|
+
signer: new LocalSignerAdapter(),
|
|
167
|
+
userContext: new StaticUserContextProvider('my-user'),
|
|
168
|
+
network: 'mainnet',
|
|
169
|
+
requireConfirmation: false,
|
|
170
|
+
});
|
|
171
|
+
```
|
|
140
172
|
|
|
173
|
+
## License
|
|
141
174
|
|
|
175
|
+
MIT
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG"}
|
package/dist/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truecarry/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "TON MCP Server - Model Context Protocol server for TON blockchain wallet operations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.cjs",
|
|
8
8
|
"module": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
|
-
"bin":
|
|
11
|
-
"ton-mcp": "./dist/cli.js"
|
|
12
|
-
},
|
|
10
|
+
"bin": "./dist/cli.js",
|
|
13
11
|
"exports": {
|
|
14
12
|
".": {
|
|
15
13
|
"import": {
|