@verusidx/send-mcp 0.1.0
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/LICENSE +21 -0
- package/README.md +98 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +19 -0
- package/build/index.js.map +1 -0
- package/build/tools.d.ts +3 -0
- package/build/tools.d.ts.map +1 -0
- package/build/tools.js +277 -0
- package/build/tools.js.map +1 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VerusIDX Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @verusidx/send-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for sending, converting, and transferring currency on Verus. Covers simple sends, currency conversions through fractional baskets, cross-chain transfers, currency/ID exports, balance queries, and transaction history.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
**Prerequisite:** `@verusidx/chain-mcp` must be configured and `refresh_chains` called at least once so the chain registry exists.
|
|
8
|
+
|
|
9
|
+
Add to your MCP client config (e.g., Claude Code `claude_desktop_config.json`):
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"verusidx-send": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["@verusidx/send-mcp"],
|
|
17
|
+
"env": {}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Alternative: local install.** If you prefer a pinned version or offline use, install into a project directory with `npm install @verusidx/send-mcp` (or `pnpm add` / `yarn add`) and point your config at the local path instead of using `npx`.
|
|
24
|
+
|
|
25
|
+
### Environment Variables
|
|
26
|
+
|
|
27
|
+
| Variable | Default | Description |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `VERUSIDX_READ_ONLY` | `false` | Set to `true` to disable write tools. All read tools remain available. |
|
|
30
|
+
| `VERUSIDX_AUDIT_LOG` | `true` | Set to `false` to disable audit logging of write operations. |
|
|
31
|
+
| `VERUSIDX_AUDIT_DIR` | OS default | Custom directory for audit log files. |
|
|
32
|
+
|
|
33
|
+
### Read-Only Mode
|
|
34
|
+
|
|
35
|
+
Set `VERUSIDX_READ_ONLY=true` to disable write tools. In read-only mode, 7 tools remain available:
|
|
36
|
+
|
|
37
|
+
- All read tools (`getcurrencybalance`, `getcurrencyconverters`, `estimateconversion`, `listcurrencies`, `z_getoperationstatus`, `gettransaction`, `listtransactions`)
|
|
38
|
+
|
|
39
|
+
The write tool (`sendcurrency`) is not registered and won't appear in the tool list.
|
|
40
|
+
|
|
41
|
+
You can set read-only mode independently per MCP server. For example, keep send-mcp read-write while running identity-mcp in read-only mode.
|
|
42
|
+
|
|
43
|
+
## Tools
|
|
44
|
+
|
|
45
|
+
### Always available (including read-only mode)
|
|
46
|
+
|
|
47
|
+
| Tool | Description |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `getcurrencybalance` | Get multi-currency balances for an address (transparent, z-address, VerusID, wildcards) |
|
|
50
|
+
| `getcurrencyconverters` | Find fractional baskets that can convert between specified currencies |
|
|
51
|
+
| `estimateconversion` | Estimate conversion output with fees and slippage (read-only preview) |
|
|
52
|
+
| `listcurrencies` | List and search currencies with filters (launch state, system type, reserves) |
|
|
53
|
+
| `z_getoperationstatus` | Check the status of async operations (companion to `sendcurrency`) |
|
|
54
|
+
| `gettransaction` | Get detailed info about a wallet transaction by txid |
|
|
55
|
+
| `listtransactions` | List recent wallet transactions with pagination |
|
|
56
|
+
|
|
57
|
+
### Write tools (disabled in read-only mode)
|
|
58
|
+
|
|
59
|
+
| Tool | Description |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `sendcurrency` | Send, convert, or cross-chain transfer currency — returns an opid to poll |
|
|
62
|
+
|
|
63
|
+
## Async Send Workflow
|
|
64
|
+
|
|
65
|
+
`sendcurrency` is asynchronous. It returns an operation ID, not a transaction ID:
|
|
66
|
+
|
|
67
|
+
1. **`sendcurrency`** — returns an `opid` (e.g., `"opid-f4422247-..."`)
|
|
68
|
+
2. **Poll `z_getoperationstatus`** with the opid
|
|
69
|
+
3. When `status` is `"success"`, `result.txid` contains the transaction ID
|
|
70
|
+
4. Optionally call `gettransaction` with the txid for full details
|
|
71
|
+
|
|
72
|
+
## Spending Limits
|
|
73
|
+
|
|
74
|
+
On first run, send-mcp creates a default `spending-limits.json` if one doesn't exist:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"VRSC": 10
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This caps any single `sendcurrency` call at 10 VRSC. Edit the file to adjust limits — add entries for any currency (e.g., `{ "VRSC": 100, "Bridge.vETH": 0.5 }`). Currency names are case-insensitive. To remove all limits, set the file contents to `{}` (empty object).
|
|
83
|
+
|
|
84
|
+
File location:
|
|
85
|
+
- **macOS:** `~/Library/Application Support/verusidx-mcp/spending-limits.json`
|
|
86
|
+
- **Linux:** `~/.config/verusidx-mcp/spending-limits.json`
|
|
87
|
+
- **Windows:** `%APPDATA%\verusidx-mcp\spending-limits.json`
|
|
88
|
+
- **Override:** set `VERUSIDX_SPENDING_LIMITS_PATH` environment variable
|
|
89
|
+
|
|
90
|
+
## Audit Logging
|
|
91
|
+
|
|
92
|
+
All write operations are logged to date-stamped JSONL files in the audit directory. Each entry records the tool name, chain, parameters (with sensitive fields summarized), result, and success status. Logs are append-only with `0600` permissions.
|
|
93
|
+
|
|
94
|
+
## Requirements
|
|
95
|
+
|
|
96
|
+
- Node.js >= 18.0.0
|
|
97
|
+
- `@verusidx/chain-mcp` installed and `refresh_chains` called (chain registry must exist)
|
|
98
|
+
- At least one Verus daemon running for RPC tools
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { ensureSpendingLimitsFile } from '@verusidx/shared';
|
|
5
|
+
import { registerTools } from './tools.js';
|
|
6
|
+
// Create default spending-limits.json if it doesn't exist yet
|
|
7
|
+
ensureSpendingLimitsFile();
|
|
8
|
+
const server = new McpServer({
|
|
9
|
+
name: 'verusidx-send-mcp',
|
|
10
|
+
version: '0.1.0',
|
|
11
|
+
});
|
|
12
|
+
registerTools(server);
|
|
13
|
+
const transport = new StdioServerTransport();
|
|
14
|
+
await server.connect(transport);
|
|
15
|
+
process.on('SIGINT', async () => {
|
|
16
|
+
await server.close();
|
|
17
|
+
process.exit(0);
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,8DAA8D;AAC9D,wBAAwB,EAAE,CAAC;AAE3B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEhC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/build/tools.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAyCzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqSrD"}
|
package/build/tools.js
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { rpcCall, auditLog, isReadOnly, assertWriteEnabled, VerusError, checkSpendingLimits, sumOutputAmounts, } from '@verusidx/shared';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Response helpers
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
function ok(data) {
|
|
7
|
+
return {
|
|
8
|
+
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function fail(category, message) {
|
|
12
|
+
return {
|
|
13
|
+
content: [{ type: 'text', text: JSON.stringify({ error: category, message }, null, 2) }],
|
|
14
|
+
isError: true,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function handleError(err) {
|
|
18
|
+
if (err instanceof VerusError) {
|
|
19
|
+
return fail(err.category, err.message);
|
|
20
|
+
}
|
|
21
|
+
return fail('INTERNAL_ERROR', err instanceof Error ? err.message : 'Unknown error');
|
|
22
|
+
}
|
|
23
|
+
const SERVER_NAME = 'verusidx-send-mcp';
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Tool registration
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
export function registerTools(server) {
|
|
28
|
+
// ------ Read-only tools (always registered) ------
|
|
29
|
+
server.tool('getcurrencybalance', 'Get multi-currency balances for a specific address. Returns all currency balances held at the address, including the native chain currency and any reserve/token currencies. Supports transparent addresses, private (z) addresses, VerusIDs, and wildcard patterns. Use this for detailed per-address multi-currency holdings. For a quick overview of the wallet\'s total native balance, use getwalletinfo in chain-mcp instead.', {
|
|
30
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
31
|
+
address: z.union([
|
|
32
|
+
z.string(),
|
|
33
|
+
z.object({
|
|
34
|
+
address: z.string(),
|
|
35
|
+
currency: z.string(),
|
|
36
|
+
}),
|
|
37
|
+
]).describe('Address to check. Can be a string ("alice@", "R...", "i*", "R*", "*") or an object {"address": "...", "currency": "currencyname"} to filter to a specific currency.'),
|
|
38
|
+
minconf: z.number().optional().describe('Only include transactions confirmed at least this many times. Default: 1.'),
|
|
39
|
+
friendlynames: z.boolean().optional().describe('Use friendly names instead of i-addresses for currency keys. Default: true.'),
|
|
40
|
+
includeshared: z.boolean().optional().describe('Include outputs that can also be spent by others. Default: false.'),
|
|
41
|
+
}, async ({ chain, address, minconf, friendlynames, includeshared }) => {
|
|
42
|
+
try {
|
|
43
|
+
// getcurrencybalance "address" (minconf) (friendlynames) (includeshared)
|
|
44
|
+
// Daemon expects the first param as a string — if address is an object
|
|
45
|
+
// (e.g., {"address":"...","currency":"..."}), JSON-stringify it so the
|
|
46
|
+
// daemon can parse it internally.
|
|
47
|
+
const addressParam = typeof address === 'object' && address !== null
|
|
48
|
+
? JSON.stringify(address)
|
|
49
|
+
: address;
|
|
50
|
+
const params = [addressParam];
|
|
51
|
+
if (minconf !== undefined || friendlynames !== undefined || includeshared !== undefined) {
|
|
52
|
+
params.push(minconf ?? 1);
|
|
53
|
+
}
|
|
54
|
+
if (friendlynames !== undefined || includeshared !== undefined) {
|
|
55
|
+
params.push(friendlynames ?? true);
|
|
56
|
+
}
|
|
57
|
+
if (includeshared !== undefined) {
|
|
58
|
+
params.push(includeshared);
|
|
59
|
+
}
|
|
60
|
+
const result = await rpcCall(chain, 'getcurrencybalance', params);
|
|
61
|
+
return ok(result);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
return handleError(err);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
server.tool('getcurrencyconverters', 'Find fractional basket currencies that can convert between specified currencies. Returns all baskets that hold the listed currencies as reserves, along with their current state (reserves, prices, conversion volumes). Use this to discover conversion paths before calling estimateconversion or sendcurrency with convertto. Two input modes: simple (pass currency names) or advanced (pass a query object with target conversion details).', {
|
|
68
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
69
|
+
currencies: z.array(z.string()).optional().describe('Simple mode: array of currency names. Returns all baskets containing all listed currencies as reserves.'),
|
|
70
|
+
params: z.record(z.unknown()).optional().describe('Advanced mode: query object with convertto, fromcurrency, targetprice, amount, slippage fields. See tool spec for details.'),
|
|
71
|
+
}, async ({ chain, currencies, params: queryParams }) => {
|
|
72
|
+
try {
|
|
73
|
+
// Simple mode: getcurrencyconverters "currency1" "currency2" ...
|
|
74
|
+
// Advanced mode: getcurrencyconverters '{"convertto":"...", ...}'
|
|
75
|
+
let rpcParams;
|
|
76
|
+
if (queryParams) {
|
|
77
|
+
rpcParams = [queryParams];
|
|
78
|
+
}
|
|
79
|
+
else if (currencies && currencies.length > 0) {
|
|
80
|
+
// Each currency is a separate string argument
|
|
81
|
+
rpcParams = [...currencies];
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return fail('INVALID_PARAMS', 'Provide either currencies (array of names) or params (query object).');
|
|
85
|
+
}
|
|
86
|
+
const result = await rpcCall(chain, 'getcurrencyconverters', rpcParams);
|
|
87
|
+
return ok(result);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
return handleError(err);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
server.tool('estimateconversion', 'Estimate the output of converting one currency to another, accounting for pending conversions, fees, and slippage. Does not broadcast a transaction — this is a read-only estimate. Use this before sendcurrency with convertto to preview the expected output. Can estimate a single conversion or an array of conversions using the same basket. IMPORTANT: when both source and destination currencies are reserves of a fractional basket (neither is the basket itself), you MUST specify "via" with the basket name — use getcurrencyconverters to find valid baskets. For more options (getcurrencyconverters filters out low-reserve baskets), use listcurrencies with {"converter":["currency1","currency2"]} to discover all baskets holding those reserves. Omitting "via" for reserve-to-reserve conversions will fail.', {
|
|
94
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
95
|
+
conversion: z.union([
|
|
96
|
+
z.object({
|
|
97
|
+
currency: z.string().describe('Source currency name'),
|
|
98
|
+
amount: z.number().describe('Amount of source currency to convert'),
|
|
99
|
+
convertto: z.string().describe('Destination currency name'),
|
|
100
|
+
via: z.string().optional().describe('Fractional basket to convert through. REQUIRED when both source and destination are reserve currencies (e.g., VRSC→vDEX via SUPER🛒). Use getcurrencyconverters to discover valid baskets.'),
|
|
101
|
+
preconvert: z.boolean().optional().describe('Convert at market price before currency launch'),
|
|
102
|
+
}),
|
|
103
|
+
z.array(z.object({
|
|
104
|
+
currency: z.string(),
|
|
105
|
+
amount: z.number(),
|
|
106
|
+
convertto: z.string(),
|
|
107
|
+
via: z.string().optional(),
|
|
108
|
+
preconvert: z.boolean().optional(),
|
|
109
|
+
})),
|
|
110
|
+
]).describe('Single conversion object or array of conversion objects.'),
|
|
111
|
+
}, async ({ chain, conversion }) => {
|
|
112
|
+
try {
|
|
113
|
+
const result = await rpcCall(chain, 'estimateconversion', [conversion]);
|
|
114
|
+
return ok(result);
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
return handleError(err);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
server.tool('listcurrencies', 'List and search currencies registered on the blockchain. Returns an array of currency definitions with their current state. Supports filtering by launch state, system type, source system, and converter reserves. Without a query object, returns all currencies on the local chain. Use filters when possible — unfiltered queries on mainnet can return very large result sets.', {
|
|
121
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
122
|
+
query: z.record(z.unknown()).optional().describe('Filter object with optional fields: launchstate ("prelaunch"|"launched"|"refund"|"complete"), systemtype ("local"|"imported"|"gateway"|"pbaas"), fromsystem (system name or i-address), converter (string[] of reserve currencies).'),
|
|
123
|
+
startblock: z.number().optional().describe('Only return currencies defined at or after this block height.'),
|
|
124
|
+
endblock: z.number().optional().describe('Only return currencies defined at or before this block height.'),
|
|
125
|
+
}, async ({ chain, query, startblock, endblock }) => {
|
|
126
|
+
try {
|
|
127
|
+
// listcurrencies (query) (startblock) (endblock)
|
|
128
|
+
const params = [];
|
|
129
|
+
if (query !== undefined || startblock !== undefined || endblock !== undefined) {
|
|
130
|
+
params.push(query ?? {});
|
|
131
|
+
}
|
|
132
|
+
if (startblock !== undefined || endblock !== undefined) {
|
|
133
|
+
params.push(startblock ?? 0);
|
|
134
|
+
}
|
|
135
|
+
if (endblock !== undefined) {
|
|
136
|
+
params.push(endblock);
|
|
137
|
+
}
|
|
138
|
+
const result = await rpcCall(chain, 'listcurrencies', params);
|
|
139
|
+
return ok(result);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
return handleError(err);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
server.tool('z_getoperationstatus', 'Check the status of async operations. Returns status, result, and timing for one or more operations. Operations remain in memory after completion — call this to retrieve results. This is the companion tool to sendcurrency, which returns an operation ID that must be polled here to get the transaction ID. Without operationids, returns all operations known to the node.', {
|
|
146
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
147
|
+
operationids: z.array(z.string()).optional().describe('Array of operation IDs to check (e.g., ["opid-f4422247-..."]). Omit to return all operations.'),
|
|
148
|
+
}, async ({ chain, operationids }) => {
|
|
149
|
+
try {
|
|
150
|
+
const params = [];
|
|
151
|
+
if (operationids !== undefined) {
|
|
152
|
+
params.push(operationids);
|
|
153
|
+
}
|
|
154
|
+
const result = await rpcCall(chain, 'z_getoperationstatus', params);
|
|
155
|
+
return ok(result);
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
return handleError(err);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
server.tool('gettransaction', 'Get detailed information about a wallet transaction by transaction ID. Returns amounts, confirmations, block info, and detailed input/output breakdowns including reserve transfers and multi-currency details. The transaction must be in the node\'s wallet.', {
|
|
162
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
163
|
+
txid: z.string().describe('The transaction ID'),
|
|
164
|
+
includewatchonly: z.boolean().optional().describe('Include watchonly addresses in balance calculation and details. Default: false.'),
|
|
165
|
+
}, async ({ chain, txid, includewatchonly }) => {
|
|
166
|
+
try {
|
|
167
|
+
const params = [txid];
|
|
168
|
+
if (includewatchonly !== undefined) {
|
|
169
|
+
params.push(includewatchonly);
|
|
170
|
+
}
|
|
171
|
+
const result = await rpcCall(chain, 'gettransaction', params);
|
|
172
|
+
return ok(result);
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
return handleError(err);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
server.tool('listtransactions', 'List recent wallet transactions with pagination. Returns an array of transactions including sends, receives, and multi-currency operations. Each entry includes amounts, confirmations, block info, and — for multi-currency transactions — token amounts and reserve output details. Results are returned most-recent-last.', {
|
|
179
|
+
chain: z.string().describe('Chain to query (e.g., "VRSC", "vrsctest")'),
|
|
180
|
+
count: z.number().optional().describe('Number of transactions to return. Default: 10.'),
|
|
181
|
+
from: z.number().optional().describe('Number of transactions to skip (for pagination). Default: 0.'),
|
|
182
|
+
includewatchonly: z.boolean().optional().describe('Include watchonly addresses. Default: false.'),
|
|
183
|
+
}, async ({ chain, count, from, includewatchonly }) => {
|
|
184
|
+
try {
|
|
185
|
+
// listtransactions "account" count from includewatchonly
|
|
186
|
+
// account is always "*" (all accounts)
|
|
187
|
+
const params = ['*'];
|
|
188
|
+
if (count !== undefined || from !== undefined || includewatchonly !== undefined) {
|
|
189
|
+
params.push(count ?? 10);
|
|
190
|
+
}
|
|
191
|
+
if (from !== undefined || includewatchonly !== undefined) {
|
|
192
|
+
params.push(from ?? 0);
|
|
193
|
+
}
|
|
194
|
+
if (includewatchonly !== undefined) {
|
|
195
|
+
params.push(includewatchonly);
|
|
196
|
+
}
|
|
197
|
+
const result = await rpcCall(chain, 'listtransactions', params);
|
|
198
|
+
return ok(result);
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
return handleError(err);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
// ------ Write tools (registered only when not read-only) ------
|
|
205
|
+
if (!isReadOnly()) {
|
|
206
|
+
server.tool('sendcurrency', 'Send, convert, or cross-chain transfer currency. This is the primary tool for moving value on Verus. Supports simple sends, currency conversions through fractional baskets, cross-chain transfers, currency/ID exports, minting, burning, and data storage. Returns an operation ID (opid) — poll z_getoperationstatus with the opid to check for completion and get the resulting transaction ID. If returntxtemplate is true, returns the raw transaction template instead of broadcasting. IMPORTANT: when converting between two reserve currencies (neither is the basket itself), you MUST include "via" with the basket name in the output — use getcurrencyconverters to find valid baskets. For more options (getcurrencyconverters filters out low-reserve baskets), use listcurrencies with {"converter":["currency1","currency2"]} to discover all baskets holding those reserves.', {
|
|
207
|
+
chain: z.string().describe('Chain to send on (e.g., "VRSC", "vrsctest")'),
|
|
208
|
+
fromaddress: z.string().describe('Source address for funds. Can be a VerusID ("alice@"), transparent address ("R..."), Sapling address ("zs..."), or wildcard ("*", "R*", "i*").'),
|
|
209
|
+
outputs: z.array(z.object({
|
|
210
|
+
address: z.string().describe('Destination address — VerusID, R-address, z-address. For cross-chain: append "@chainname".'),
|
|
211
|
+
amount: z.number().describe('Amount to send in the source currency. Can be 0 for export-only operations.'),
|
|
212
|
+
currency: z.string().describe('Source currency name (e.g., "VRSC", "vrsctest")'),
|
|
213
|
+
convertto: z.string().optional().describe('Currency to convert to.'),
|
|
214
|
+
via: z.string().optional().describe('Fractional basket to convert through. REQUIRED when both source and destination are reserve currencies (e.g., VRSC→vDEX via SUPER🛒). Use getcurrencyconverters to discover valid baskets.'),
|
|
215
|
+
exportto: z.string().optional().describe('Chain or system name to export/send to (e.g., "vDEX", "vETH").'),
|
|
216
|
+
exportid: z.boolean().optional().describe('If true, export the full identity to the destination chain.'),
|
|
217
|
+
exportcurrency: z.boolean().optional().describe('If true, export the currency definition to the destination chain.'),
|
|
218
|
+
feecurrency: z.string().optional().describe('Currency to use for paying the fee.'),
|
|
219
|
+
addconversionfees: z.boolean().optional().describe('If true, calculate additional fees so the full amount is converted after fees.'),
|
|
220
|
+
refundto: z.string().optional().describe('Address for refunds on pre-conversions. Defaults to fromaddress.'),
|
|
221
|
+
memo: z.string().optional().describe('String message for z-address destinations.'),
|
|
222
|
+
data: z.record(z.unknown()).optional().describe('Data-only output. See signdata in identity-mcp for the data object format.'),
|
|
223
|
+
preconvert: z.boolean().optional().describe('Convert at market price before currency launch.'),
|
|
224
|
+
burn: z.boolean().optional().describe('Destroy the currency and subtract from supply.'),
|
|
225
|
+
mintnew: z.boolean().optional().describe('Create new currency. Must send from the currency\'s ID and the currency must be centralized.'),
|
|
226
|
+
})).describe('Array of output objects'),
|
|
227
|
+
minconf: z.number().optional().describe('Only use funds confirmed at least this many times. Default: 1.'),
|
|
228
|
+
feeamount: z.number().optional().describe('Specific fee amount instead of default miner\'s fee.'),
|
|
229
|
+
returntxtemplate: z.boolean().optional().describe('If true, returns the raw transaction template (hex + output totals) instead of broadcasting. Default: false.'),
|
|
230
|
+
}, async ({ chain, fromaddress, outputs, minconf, feeamount, returntxtemplate }) => {
|
|
231
|
+
try {
|
|
232
|
+
assertWriteEnabled();
|
|
233
|
+
// Pre-RPC spending limits check
|
|
234
|
+
const amounts = sumOutputAmounts(outputs);
|
|
235
|
+
checkSpendingLimits(amounts);
|
|
236
|
+
// sendcurrency "fromaddress" '[outputs]' (minconf) (feeamount) (returntxtemplate)
|
|
237
|
+
const params = [fromaddress, outputs];
|
|
238
|
+
if (minconf !== undefined || feeamount !== undefined || returntxtemplate !== undefined) {
|
|
239
|
+
params.push(minconf ?? 1);
|
|
240
|
+
}
|
|
241
|
+
if (feeamount !== undefined || returntxtemplate !== undefined) {
|
|
242
|
+
params.push(feeamount ?? 0);
|
|
243
|
+
}
|
|
244
|
+
if (returntxtemplate !== undefined) {
|
|
245
|
+
params.push(returntxtemplate);
|
|
246
|
+
}
|
|
247
|
+
const result = await rpcCall(chain, 'sendcurrency', params);
|
|
248
|
+
auditLog({
|
|
249
|
+
server: SERVER_NAME,
|
|
250
|
+
tool: 'sendcurrency',
|
|
251
|
+
chain,
|
|
252
|
+
params: {
|
|
253
|
+
fromaddress,
|
|
254
|
+
outputs: outputs.map(o => ({
|
|
255
|
+
address: o.address,
|
|
256
|
+
amount: o.amount,
|
|
257
|
+
currency: o.currency,
|
|
258
|
+
convertto: o.convertto,
|
|
259
|
+
via: o.via,
|
|
260
|
+
exportto: o.exportto,
|
|
261
|
+
})),
|
|
262
|
+
minconf,
|
|
263
|
+
feeamount,
|
|
264
|
+
returntxtemplate,
|
|
265
|
+
},
|
|
266
|
+
result,
|
|
267
|
+
success: true,
|
|
268
|
+
});
|
|
269
|
+
return ok(result);
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
return handleError(err);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,SAAS,EAAE,CAAC,IAAa;IACvB,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,QAAgB,EAAE,OAAe;IAC7C,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAA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,gBAAgB;qBACjB;oBACD,MAAM;oBACN,OAAO,EAAE,IAAI;iBACd,CAAC,CAAC;gBAEH,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@verusidx/send-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Verus currency operations — send, convert, cross-chain transfer, check balances and conversion paths",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"verusidx-send-mcp": "./build/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"build"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
18
|
+
"zod": "^3.23.0",
|
|
19
|
+
"@verusidx/shared": "0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^22.0.0",
|
|
23
|
+
"typescript": "^5.7.0",
|
|
24
|
+
"vitest": "^3.0.0"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"test": "vitest run"
|
|
29
|
+
}
|
|
30
|
+
}
|