@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 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
- - **Secure Storage**: Wallets stored locally with encryption-ready design
10
+ - **Swaps**: Get quotes and execute token swaps
11
+ - **Dual Transport**: Stdio (default) and HTTP server modes
11
12
 
12
- ## Installation
13
+ ## Quick Start
13
14
 
14
15
  ```bash
15
- # In the monorepo
16
- pnpm install
17
- pnpm --filter @ton/mcp build
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": "node",
31
- "args": ["/path/to/kit/apps/mcp/dist/index.js"]
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
- ## Storage
112
-
113
- Wallet data is stored in `~/.ton-mcp/wallets.json`.
132
+ ### Swaps
114
133
 
115
- **Current Implementation:** Plaintext JSON storage
134
+ #### `get_swap_quote`
135
+ Get a quote for a token swap.
116
136
 
117
- **Security Note:** Mnemonics are currently stored in plaintext. The storage interface is designed to easily support encrypted storage in the future. Do not use this for production wallets with significant funds until encryption is implemented.
137
+ #### `execute_swap`
138
+ Execute a token swap.
118
139
 
119
140
  ## Development
120
141
 
121
142
  ```bash
122
- # Build
123
- pnpm build
143
+ # Run from source (stdio)
144
+ pnpm --filter @ton/mcp dev:cli
124
145
 
125
- # Watch mode
126
- pnpm dev
146
+ # Run from source (HTTP)
147
+ pnpm --filter @ton/mcp dev:cli:http
127
148
 
128
- # Run directly
129
- pnpm start
130
- ```
149
+ # Build
150
+ pnpm --filter @ton/mcp build
131
151
 
132
- ## Network
152
+ # Run built version
153
+ node packages/mcp/dist/cli.js
154
+ node packages/mcp/dist/cli.js --http 8080
155
+ ```
133
156
 
134
- The server uses TON Mainnet by default. This can be configured in the WalletService constructor.
157
+ ## Library Usage
135
158
 
136
- ## License
159
+ The package also exports a programmatic API for building custom MCP servers:
137
160
 
138
- MIT
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
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  /**
2
3
  * Copyright (c) TonTech.
3
4
  *
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":";AAEA;;;;;;GAMG"}
package/dist/cli.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ #!/usr/bin/env node
2
3
  import { createRequire } from "node:module";
3
4
  import { createServer } from "node:http";
4
5
  import { randomFillSync, randomUUID } from "node:crypto";
package/package.json CHANGED
@@ -1,15 +1,13 @@
1
1
  {
2
2
  "name": "@truecarry/mcp",
3
- "version": "0.1.0",
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": {